A simple documentation assistant built with LangGraph.
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 . "langgraph-cli[inmem]"
# 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) |
MINTLIFY_API_URL |
Mintlify API base URL for docs search (e.g. https://api-dsc.mintlify.com/v1/search/docs.langchain.com) |
MINTLIFY_API_KEY |
Mintlify API key for docs search |
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 |
# Start LangGraph development server
uv run langgraph dev
# Or with pip
langgraph dev
Open LangGraph Studio: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024
cd frontend
npm ci
npm run dev:local
The frontend expects the LangGraph server at http://127.0.0.1:2024 by default. If you want trace sharing from the UI, set LANGSMITH_API_KEY in frontend/.env.local.
├── src/
│ ├── agent/
│ │ ├── docs_graph.py # Main docs agent
│ │ └── config.py # Model configuration
│ ├── tools/
│ │ ├── docs_tools.py # Documentation search
│ │ ├── pylon_tools.py # Support KB tools
│ │ └── link_check_tools.py # URL validation
│ ├── prompts/
│ │ └── docs_agent_prompt.py
│ └── middleware/
│ ├── guardrails_middleware.py
│ └── retry_middleware.py
├── frontend/ # Next.js public chat UI
├── langgraph.json # LangGraph configuration
└── pyproject.toml # Python project config
The agent uses a docs-first research strategy:
MIT
$ claude mcp add chat-langchain \
-- python -m otcore.mcp_server <graph>