6,451
stars
365
commits
TypeScript
primary language
Sep 11, 2026
updated
A documentation assistant deployed as a Managed Deep Agent.
This is a documentation assistant agent that helps answer questions about LangChain, LangGraph, and LangSmith. It demonstrates how to build a production-ready agent using:
The repo also includes a Next.js frontend in frontend/ for the public chat UI.
# Clone the repository
git clone https://github.com/langchain-ai/chat-langchain.git
cd chat-langchain
# Install dependencies with uv
uv sync
# Or with pip
pip install -e .
# Copy environment template
cp .env.example .env
# Edit .env with your API keys
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY | Anthropic API key (or use another provider) |
PYLON_API_KEY | Pylon API key for support KB |
PYLON_KB_ID | Pylon knowledge base ID for support articles |
USE_LOCAL_PROMPTS | Optional. Set to true to use local prompt files instead of pulling Prompt Hub prompts |
# Build the Managed Deep Agent bundle
uv run mda dev .
# Or with pip
mda dev .
cd frontend
npm ci
npm run dev:local
Point the frontend at the local MDA deployment via NEXT_PUBLIC_LANGGRAPH_API_URL
(see frontend/.env.local.example). Auth, guest issuance, and LangSmith
operations go through the managed identity and connector surface.
├── agent.py # Managed Deep Agent entrypoint
├── identity.py # MDA identity contract (Supabase + guest)
├── instructions.md # Managed Deep Agent system prompt
├── connectors/
│ ├── langsmith.py # LangSmith feedback + trace connector
│ └── mcp.py # Managed MCP docs connector
├── src/
│ ├── agent/
│ │ └── config.py # Model configuration
│ ├── tools/
│ │ ├── pylon_tools.py # Support KB tools
│ │ ├── pricing_tools.py # Pricing fetch
│ │ └── link_check_tools.py # URL validation
│ ├── prompts/
│ │ ├── docs_agent_prompt.py # Hub push / eval mirror of instructions.md
│ │ ├── guardrails_prompts.py
│ │ └── context_summary_prompt.py
│ └── middleware/
│ ├── guardrails_middleware.py
│ ├── ingress_guards_middleware.py
│ └── retry_middleware.py
├── frontend/ # Next.js public chat UI
└── pyproject.toml # Python project config
The agent uses a docs-first research strategy:
mda deploy .
What MDA owns in this deployment:
identity.py verifies Supabase access tokens (multi-region) and
issues/verifies guest tokens via POST /identity/guest.connectors/langsmith.py proxies feedback and
trace read/share so LANGSMITH_API_KEY never reaches the browser.connectors/mcp.py attaches the LangChain docs MCP tools.MIT
(top 30 of 40)
TypeScript
68.0%
Python
30.1%
CSS
1.5%
6,451
stars
365
commits
TypeScript
primary language
Sep 11, 2026
updated
A documentation assistant deployed as a Managed Deep Agent.
This is a documentation assistant agent that helps answer questions about LangChain, LangGraph, and LangSmith. It demonstrates how to build a production-ready agent using:
The repo also includes a Next.js frontend in frontend/ for the public chat UI.
# Clone the repository
git clone https://github.com/langchain-ai/chat-langchain.git
cd chat-langchain
# Install dependencies with uv
uv sync
# Or with pip
pip install -e .
# Copy environment template
cp .env.example .env
# Edit .env with your API keys
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY | Anthropic API key (or use another provider) |
PYLON_API_KEY | Pylon API key for support KB |
PYLON_KB_ID | Pylon knowledge base ID for support articles |
USE_LOCAL_PROMPTS | Optional. Set to true to use local prompt files instead of pulling Prompt Hub prompts |
# Build the Managed Deep Agent bundle
uv run mda dev .
# Or with pip
mda dev .
cd frontend
npm ci
npm run dev:local
Point the frontend at the local MDA deployment via NEXT_PUBLIC_LANGGRAPH_API_URL
(see frontend/.env.local.example). Auth, guest issuance, and LangSmith
operations go through the managed identity and connector surface.
├── agent.py # Managed Deep Agent entrypoint
├── identity.py # MDA identity contract (Supabase + guest)
├── instructions.md # Managed Deep Agent system prompt
├── connectors/
│ ├── langsmith.py # LangSmith feedback + trace connector
│ └── mcp.py # Managed MCP docs connector
├── src/
│ ├── agent/
│ │ └── config.py # Model configuration
│ ├── tools/
│ │ ├── pylon_tools.py # Support KB tools
│ │ ├── pricing_tools.py # Pricing fetch
│ │ └── link_check_tools.py # URL validation
│ ├── prompts/
│ │ ├── docs_agent_prompt.py # Hub push / eval mirror of instructions.md
│ │ ├── guardrails_prompts.py
│ │ └── context_summary_prompt.py
│ └── middleware/
│ ├── guardrails_middleware.py
│ ├── ingress_guards_middleware.py
│ └── retry_middleware.py
├── frontend/ # Next.js public chat UI
└── pyproject.toml # Python project config
The agent uses a docs-first research strategy:
mda deploy .
What MDA owns in this deployment:
identity.py verifies Supabase access tokens (multi-region) and
issues/verifies guest tokens via POST /identity/guest.connectors/langsmith.py proxies feedback and
trace read/share so LANGSMITH_API_KEY never reaches the browser.connectors/mcp.py attaches the LangChain docs MCP tools.MIT
(top 30 of 40)
TypeScript
68.0%
Python
30.1%
CSS
1.5%