A research assistant built with LangGraph that fans out to three parallel sub-agents (Knowledge Base, Web Search, Policy), aggregates results using state reducers, and synthesizes a single customer-facing response. Includes a conditional routing variant and LangSmith evaluations.
- Python 3.11+
- Anthropic API key
- LangSmith API key (for evals)
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY |
Yes | Anthropic API key for Claude |
LANGSMITH_API_KEY |
For evals | LangSmith API key for tracing and evals |
LANGSMITH_TRACING |
No | Set to true to enable tracing |
Run the basic parallel agent (static fan-out to all three agents):
python parallel_agents.pyRun the conditional routing variant (classifies query, dispatches only relevant agents):
python conditional_routing.pyRun evaluations:
python evals.py| File | Description |
|---|---|
parallel_agents.py |
Static fan-out to KB, Web, and Policy agents with operator.add reducer and synthesis |
conditional_routing.py |
Structured-output classifier that selectively dispatches agents based on query type |
evals.py |
LangSmith evaluation suite: coverage, source diversity, and LLM-as-judge quality |
Your Customer Service Bot Is Slow Because It's Single-Threaded