Tech Doc Chat

LangChain + LangGraph + 2 public MCP servers

Status: idle
This session history is persisted with a Durable Object per session ID.
1) Tools / Platform / Stack
  • Platform: Cloudflare Workers (Python runtime)
  • Model: Cloudflare Workers AI (@cf/meta/llama-3.1-8b-instruct)
  • Tooling: MCP via MultiServerMCPClient
  • MCP Servers: Cloudflare Docs + AWS Knowledge
  • Frameworks/Libraries: LangChain + LangGraph + langchain-mcp-adapters
2) Chat Design (Architecture)
  • Worker route POST /api/chat receives user prompt.
  • AgentRuntime runs a LangGraph flow: planner -> tools -> finalize.
  • Planner decides model-only or MCP tool path.
  • Tools node runs one or more MCP tools and collects links.
  • Finalize node returns structured response + provenance metadata.
  • Session context is keyed by client cookie (sid) and persisted in a Durable Object for cross-request continuity.
3) User Flow
  • User enters prompt and clicks Send.
  • Status bar updates: request -> planning -> tool/generation.
  • Agent executes graph with session history context.
  • Assistant returns User Intent + detailed Answer (+ Resources when available).
  • UI shows provenance path/tool usage for transparency.
4) Future Expansion
  • LangSmith tracing: add node-level trace and latency visibility.
  • Security hardening: prompt-injection guardrails, output filtering, and tool allowlists.
  • Auth & policy: role-based access and per-tool permission controls.
  • Observability: structured logs, error taxonomy, and token/cost dashboards.