12.1 · When you actually need multiple agents
Most problems don't. A single agent with a good prompt and a clean tool set beats a "team" on cost, latency, and predictability. Add agents when one or more of these are true:
- The task parallelizes (e.g. summarise 50 docs).
- The task needs independent perspectives (writer + critic, dev + reviewer).
- One agent's context window can't hold the whole problem.
- Different sub-tasks need different models (a small cheap one for triage, a frontier one for synthesis).
- Safety requires an isolated validator that cannot be talked out of its rules.
12.2 · Six classic topologies — definition + example
1 agent → 1-of-N specialists
Definition. A classifier picks exactly one downstream specialist (or "answer directly") per request.
Example. A help-desk router sends billing questions to the refund agent and technical questions to the troubleshooting agent.
One agent orchestrates a team
Definition. A supervisor LLM decomposes the goal into sub-tasks and dispatches each to a specialist, then composes the final answer.
Example. "Write a report on EV adoption" → supervisor delegates research, data analysis, writing, and review to four specialists.
Supervisors of supervisors
Definition. A top-level supervisor delegates to sub-supervisors, each managing a team of specialists.
Example. Claude Code: a primary agent spawns Explore / Plan / Review sub-agents, each with their own scope and tools.
A → B → C (linear handoffs)
Definition. Output of agent A is the input of B, and B → C. No back-and-forth.
Example. Document processing: Extract → Normalize → Summarise → Translate.
N agents argue, a judge decides
Definition. Multiple agents (with different roles or prompts) defend competing positions; a judge agent reads the transcript and chooses.
Example. A "bull vs bear" pair argues for/against a stock recommendation; the judge synthesises a balanced report.
Peers with handoffs
Definition. A flat team of agents pass control to each other via handoffs — no permanent boss.
Example. OpenAI's Swarm pattern for travel: a triage agent hands off to the flights agent, which hands back to triage, which hands off to hotels.
12.3 · Supervisor / router
One LLM (the supervisor) reads the user request, picks a specialist (or sequence), and dispatches the task. The supervisor receives results and decides next steps.
system: "You are the supervisor. Choose ONE of:
- researcher: needs to look things up
- coder: needs to write or debug code
- writer: needs to produce prose
- none: answer directly
Respond with JSON: {agent: ..., task: ...}"
Cheap, fast, debuggable. Use it as your default before reaching for fancier topologies.
12.4 · Hierarchical teams
A top-level supervisor delegates to sub-supervisors, each managing their own specialists. This is how Claude Code organises sub-agents: a primary agent spawns scoped sub-agents (Explore, Plan, Review) that report back.
12.5 · Debate & critique
Two or more agents argue different positions; a judge agent (often the same model with a different prompt) picks the best answer. Effective for:
- Hard reasoning where a single chain-of-thought commits early.
- Fact-checking — one agent argues "for", another "against".
- Reducing hallucination in safety-critical outputs.
12.6 · Swarms
Peer agents pass control to each other via handoffs. No single boss. OpenAI's Swarm pattern and the Agents SDK formalised this. Best for open-ended exploration ("here's a topic, brainstorm").
12.7 · A2A — the Agent-to-Agent protocol
A2A (Google + partners, 2025) is to agents what MCP is to tools: a standard protocol so two agents from different organisations or vendors can collaborate.
Agent cards
A JSON file describing an agent's skills, endpoints, auth, and pricing. Discoverable like robots.txt.
Tasks & messages
Long-running tasks with structured status updates and artefacts (files, links).
Streaming + push
SSE / webhooks so agents can collaborate over minutes or days, not just one request.
Auth & identity
OAuth-style flows so agents act on behalf of users with revocable scopes.
12.8 · Multi-agent failure modes
- Cost explosion — three agents = three times the tokens, easily ten.
- Loop of agreement — peers nod at each other; debate collapses. Force diverse roles.
- Lost-in-translation — the supervisor garbles the task before passing it down.
- Untraceable bugs — output is wrong but you can't tell which agent drifted.
- Cascading hallucination — agent A invents a fact, agent B accepts and uses it.
12.9 · A case study — the research team
A common shape that ships:
- Planner: turn the user's question into 5 sub-questions.
- Researcher × N (parallel): for each sub-question, web_search + RAG + summarise.
- Synthesizer: merge the summaries into a coherent draft with citations.
- Critic: check claims against retrieved passages; flag unsupported lines.
- Writer: produce the final styled output.
This pattern (planner → parallel researchers → synthesizer → critic → writer) is how most production "deep research" agents are built.