Choosing a multi-agent pattern
Several agents can split a task and check each other. They also cost more, so the split has to pay for itself.
Splitting the work
In a multi-agent system, each agent has its own role, prompt and sometimes its own tools. Common layouts: a pipeline (planner, then worker, then reviewer) or a planner with workers that run in parallel and report back.
What it buys and costs
A reviewer can catch mistakes; specialised prompts can stay short and focused. But every message is extra tokens and extra latency, and agents can misread each other. Use the lab to run the same task three ways and compare quality with cost.
In LangGraph
The LangChain documentation describes five multi-agent patterns. Subagents: a main agent calls the others as tools and keeps control. Handoffs: the active agent changes, and agents talk to the user directly. Skills: one agent loads specialised prompts or knowledge on demand. Router: classify the request, send it to specialised agents, combine results. Custom workflow: your own LangGraph graph mixing fixed steps and agents.
# subagents: the supervisor stays in control
supervisor = create_agent(model=..., tools=[call_researcher, call_writer])
# handoffs: a node or tool moves control to another agent
return Command(goto="billing_agent", update={"active_agent": "billing"})A worked example
On the task “write is_even(n)”, a single agent writes n % 2 == 1 and stops after about 160 tokens: wrong. A writer with a reviewer gets the same bug caught and fixed, at about 650 tokens. A planner with two workers also succeeds, at about 940 tokens. The extra agents bought correctness here, at four to six times the cost.
In practice
Use several agents when the work splits cleanly (independent research threads, separate files) or when a second, differently prompted pass catches real errors. Give each agent a narrow role and a clear hand-off format, and measure whether the team beats a single well-prompted agent before keeping it.
Easy to confuse
- More agents do not mean more intelligence; they mean more calls, more tokens and more places for messages to be misread.
- Agents in a team usually share the same underlying model; what differs is their prompt, tools and context.
What is the main reason to add a reviewer agent to a coding agent?
A separate agent with a different prompt looks at the result fresh. It does not guarantee correctness, but it catches errors a single pass tends to miss.
Compared with one agent, a team of agents usually costs…
Every message is read by other agents and each agent has its own prompt and context, so total tokens and latency go up. The team has to earn that cost in quality.
When is a single agent the better choice?
Extra agents add cost and failure points such as miscommunication. Start with one agent and add more only when you can show it improves results.
Read more in the books
- LangChain and LangGraph documentation, LangChain: LangChain: Multi-agent (subagents, handoffs, skills, router, custom workflow).
- An Introduction to MultiAgent Systems (2nd ed.), Michael Wooldridge: Ch. 1, “Introduction” and the chapters on multiagent interactions.
- Artificial Intelligence: A Modern Approach (4th ed.), Russell, Norvig: Ch. 18, “Multiagent Decision Making”.