Skip to content

Plan: vCon LangChain tool set#196

Draft
howethomas wants to merge 1 commit into
mainfrom
claude/vcons-lang-chain-plan-8gkkz1
Draft

Plan: vCon LangChain tool set#196
howethomas wants to merge 1 commit into
mainfrom
claude/vcons-lang-chain-plan-8gkkz1

Conversation

@howethomas

Copy link
Copy Markdown
Contributor

Summary

Adds a design/implementation plan (docs/design/langchain-toolset-plan.md) for exposing vCons to LangChain agents as a first-class tool set. No code changes yet — this PR is the plan for review before implementation.

The proposal:

  • A standalone, installable vcon_langchain package (kept dep-light and separate from server-only deps).
  • REST-backed by default via a small VconBackend protocol (VconApiBackend over the existing api/api.py), so agents don't need to share a process/Redis with the conserver. An in-process VconRedis backend can be added later without touching the tool layer.
  • A set of langchain_core StructuredTools with typed Pydantic args schemas and LLM-facing descriptions — read tools (get_vcon, search_vcons, list_recent_vcons, convenience get_vcon_transcript / get_vcon_analysis / get_vcon_parties / get_vcon_tags) plus opt-in write tools (add_vcon_tag, create_vcon, submit_vcon_to_chain). Destructive delete_vcon excluded by default.
  • A VconToolkit(BaseToolkit) assembling the tools; sync + async execution.
  • Optional langchain dependency group in pyproject.toml (langchain-core, httpx), with a guarded import mirroring the Milvus backend pattern.
  • Unit tests using a fake backend (no live conserver), and docs under docs/extending/ + mkdocs nav.

Why this is a new surface (not a "link")

Links are pushed work by the conserver worker (run(vcon_uuid, link_name, opts)); LangChain tools are pulled by an LLM agent on demand (BaseTool + args schema). They're complementary — existing links are unchanged.

Design decisions grounded in the codebase

  • Convenience extract tools return only the salient slice of a vCon (transcript/analysis/parties) to save tokens, reusing the server's encoding: json body-decode semantics (Vcon.decoded_body) as a pure function with no server dependency.
  • Mutations are read-modify-write against the API (no PATCH endpoint) — documented as last-write-wins.
  • create_vcon uses the canonical vcon>=0.9.2 library already in core deps rather than re-implementing UUID8 generation.

Open questions for reviewers

Captured in §11 of the doc: REST-first vs in-process backend default, package home, whether v1 should be read-only, and keeping delete_vcon opt-in.

🤖 Generated with Claude Code


Generated by Claude Code

Design/proposal doc for exposing vCons to LangChain agents as a tool set:
a standalone vcon_langchain package (REST-backed backend, StructuredTools,
VconToolkit), optional langchain dependency group, tests, and docs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ztZ77HirosvbtA99WXVae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants