Agent Runtime
LangGraph Supervisor Research Desk
A central supervisor agent coordinates specialized worker agents (a web researcher and a math/analysis agent), deciding which to invoke next and when the task is done, using langgraph-supervisor.
What This Builds
This recipe implements the supervisor multi-agent architecture: a central supervisor agent coordinates several specialized worker agents. The supervisor controls communication flow and delegation, deciding which agent to call next based on the conversation and routing control back to itself after each worker finishes.
The concrete use case is a small research desk. A supervisor routes a user question to:
- a research agent that searches the web and records notes, and
- an analysis agent that does calculations or structured reasoning over the gathered facts.
The supervisor keeps delegating until it has enough to answer, then returns the final response. Optionally, a vector store gives the research agent retrieval over a private corpus.
The Stack
- LangGraph +
langgraph-supervisor— a prebuilt library for hierarchical multi-agent systems. You create worker agents withcreate_react_agent, then wire them under acreate_supervisor(...)graph that handles routing and handoffs. - LangChain model bindings — Claude (via the Anthropic Startup Program) or any chat model through OpenRouter for the supervisor and workers; smaller/cheaper models for workers, a stronger model for the supervisor.
- Qdrant (Cloud free tier) — optional vector store backing the research agent’s retrieval tool so it can ground answers in your own documents alongside web search.
- LangSmith — optional tracing to watch routing decisions and worker handoffs step by step.
Step-by-Step Outline
- Build worker agents. Define
research_agent(with a web-search tool and, optionally, a Qdrant-backed retriever) andanalysis_agent(with a calculator/structured-reasoning tool), each viacreate_react_agentwith a clear name and instructions. - Create the supervisor. Pass the workers into
create_supervisor([...], model=..., prompt=...)describing when to use each agent and the stopping condition. - Compile and run. Compile the supervisor graph and invoke it with the user’s question; the supervisor decides the order of worker calls.
- Inspect routing. Use LangSmith (or stream graph events) to confirm the supervisor isn’t over-delegating or looping.
- Extend. Add more specialists (a writer, a critic) or nest supervisors so a top-level planner delegates to mid-level supervisors that each control a group of domain agents.
Why This Shape Works
Routing through a single supervisor gives you separation of concerns — each worker has a focused prompt and toolset — while keeping one place responsible for “what next?” and “are we done?”. This is the same hierarchical structure that scales to networks of agents, and langgraph-supervisor removes the boilerplate of wiring handoffs and shared state by hand.
Source
LangChain, LangGraph Multi-Agent Supervisor reference and tutorial (langgraph-supervisor): https://reference.langchain.com/python/langgraph-supervisor
LangChain docs, Build a personal assistant with subagents (supervisor pattern overview): https://docs.langchain.com/oss/python/langchain/multi-agent/subagents-personal-assistant