Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path →
More agents,
more problems.
A team of specialist agents sounds obviously better than one — a researcher, a coder, a critic, all working together. So teams reach for elaborate multi-agent architectures, and are surprised when the result is slower, pricier, and worse than a single good agent. The reason is a law you can't argue with: coordination cost grows quadratically with the number of agents, while the useful work only divides linearly. Beyond a point, every agent you add costs more to coordinate than it contributes. This handbook is where that curve turns, and how to stay on the right side of it.
The team fantasy
The appeal of multi-agent systems is intuitive: decompose a hard task, assign each part to a specialist agent, run them in parallel, combine the results. It mirrors how human teams tackle big problems, and it promises both parallelism (do things at once) and specialization (each agent focused on what it's good at). So a lot of ambitious AI systems are built as elaborate agent org-charts.
And often they underperform a single well-built agent. The failure isn't that the agents are bad — it's that coordinating them costs more than anyone budgeted. Agents have to share context, reconcile conflicting results, wait on each other, and recover when one goes off-track, and all of that is overhead that a single agent simply doesn't pay. The question isn't "would a team be nice?" but "does the parallel benefit exceed the coordination cost?" — and the coordination cost has a shape that makes the answer "no" more often than you'd think.
Coordination overhead grows quadratically with the number of agents while useful work divides only linearly, so past an optimal point more agents make the system slower — often a single agent wins.
Coordination isn't free
Here's the cost nobody prices in. When agents must coordinate, the work isn't just "N agents doing their bit" — it's the communication between them. Every pair of agents that needs to share context or reconcile a result is a coordination link, and the number of pairs in a group of N is N(N−1)/2 — it grows quadratically. Two agents: 1 link. Five agents: 10 links. Ten agents: 45 links. The overhead explodes far faster than the headcount.
Meanwhile the useful work only divides linearly: split a job across N agents and each does about 1/N of it. So you're trading a linear speedup against a quadratic overhead. For small N the speedup wins; as N grows, the quadratic term catches up and then overwhelms it. This is the same reason human teams hit diminishing returns — adding people adds meetings faster than it adds output. A single agent, by contrast, has zero coordination overhead, which is why it's such a strong baseline and so often the right default.
Where it turns
Put the two forces together and you get a U-shaped cost curve. Total cost falls at first as agents parallelize the work, hits a minimum at some optimal number, then rises as coordination overtakes the shrinking marginal speedup. There's a best N — and it's usually small.
Where the minimum sits depends on two things: how parallelizable the task is (more independent work → more agents pay off) and how expensive coordination is (cheaper coordination → more agents optimal). A tightly-coupled task where every step depends on the last has almost no parallelism, so its optimal N is 1 — a single agent. A task that fans out into many independent sub-tasks with light coordination can profitably use several. The math pins down exactly where.
The overhead math
Model total cost as parallelized work plus pairwise coordination. Work W divides across N agents; coordination costs c per pair, and there are N(N−1)/2 pairs:
First term (work) shrinks like 1/N; second (coordination) grows like N². Their sum is a U-curve with a minimum.
Two consequences fall out. Adding agents past the minimum makes it worse — the quadratic term wins — and the optimal N depends on the ratio of work to coordination cost:
Halve the coordination cost and more agents pay off; make it expensive and a single agent wins. The runnable version below computes the cost curve, shows more agents hurting past the optimum, and finds the best N.
Find the optimal team size
Multi-agent cost is a tug-of-war. Work divides linearly across N agents (the speedup), but coordination pairs grow as N(N−1)/2 (the overhead) — 1 pair at 2 agents, 45 at 10. Total cost is work/N plus coordination-cost times pairs, a U-curve: adding agents helps until coordination dominates, then more agents cost more, not less. A single agent has zero coordination overhead. And cheaper coordination shifts the optimal team size larger. Change the work, coordination cost, or agent count and find where the minimum sits.
Patterns that scale
The way to beat the quadratic wall is to constrain who coordinates with whom. The best patterns route coordination through a hub or a line instead of a full mesh:
| Pattern | How coordination flows |
|---|---|
| Orchestrator-workers | A coordinator splits the task, dispatches to workers, and synthesizes — coordination is hub-and-spoke (linear), not every-pair. |
| Sequential handoff | A pipeline: each agent does its stage and passes to the next — coordination is a chain, not a mesh. |
| Specialist routing | Route each request to the single best-suited agent — no ongoing coordination at all. |
| Free-for-all mesh | Every agent talks to every other — the quadratic trap; avoid at scale. |
Orchestrator-workers is the workhorse: because the coordinator is the only hub, communication grows with the number of workers, not with the number of pairs, keeping overhead near-linear even as you add specialists. It also composes with everything else — each worker is itself a bounded agent loop, and the orchestrator applies the same agent patterns at the team level. The design lesson is blunt: don't build a democracy of agents that all confer; build a clear hierarchy or pipeline where coordination is deliberately limited, and add agents only where you can point to real parallel work.
Pitfalls
The cardinal error is reaching for multi-agent by default — building an agent team for a task a single agent handles fine, and paying the coordination tax for nothing. Start with one agent; add more only when you can name the specific parallelism that will pay for the coordination. A close cousin is the full-mesh design where every agent talks to every other: it hits the quadratic wall fastest, and it's usually a hierarchy or pipeline in disguise that just hasn't been structured yet.
Two more. Error compounding: each agent hand-off is a chance to lose context or propagate a mistake, so a longer chain of agents is a longer chain of failure points — more agents can mean lower reliability, not just higher cost. And context duplication: agents that each carry the full context multiply your token bill, so coordination overhead is a cost line too, not only a latency one. The through-line: multi-agent is a real tool for genuinely parallel, specialized work — but it is not a free upgrade. Respect the quadratic, keep the team small and the coordination structured, and default to one agent until the task demands more.
"More agents" is not a capability upgrade — it's a coordination cost. Because overhead grows quadratically and each hand-off adds a failure point, a single well-built agent beats a sprawling team on most tasks. Add agents only for real, nameable parallelism, and route coordination through a hub or pipeline, never a full mesh.
Worked example: mesh vs hub, one agent at a time
Take the page’s runnable numbers: W = 100 units of work and c = 5 per coordination link. Price the same team two ways: a full mesh, where every pair talks (N(N−1)/2 links), and an orchestrator hub, where each worker talks only to the coordinator (N − 1 links in this simple model). Add one agent per row.
| N | Work W/N | Mesh links | Mesh cost | Hub links | Hub cost |
|---|---|---|---|---|---|
| 1 | 100 | 0 | 100 | 0 | 100 |
| 2 | 50 | 1 | 55 | 1 | 55 |
| 3 | 33.3 | 3 | 48.3 | 2 | 43.3 |
| 4 | 25 | 6 | 55 | 3 | 40 |
| 5 | 20 | 10 | 70 | 4 | 40 |
| 6 | 16.7 | 15 | 91.7 | 5 | 41.7 |
The mesh bottoms out at N = 3. By N = 6 it costs 91.7, almost as much as one agent doing everything, because 15 links eat what the split saved. The hub keeps falling until N = 4 or 5 and then barely rises, because its overhead grows by one link per worker, not by one per pair. That is the page’s “patterns that scale” argument in numbers: the structure, not the headcount, decides how far you can go. Two cautions. First, the hub cost assumes the coordinator itself is never the bottleneck. In practice it reads every worker’s output, so its context and latency grow with N too. Second, halve the mesh’s coordination cost to c = 2.5 and its best N moves only from 3 to 4 (cost 40.8 at 3, 40.0 at 4). Cheaper messages help, but a quadratic term stays quadratic.
Cost and trade-offs: the patterns side by side
Here Time is coordination links for N agents, and Space is what each agent has to hold in context. The last column is what you give up.
| Case | Time | Space | Why |
|---|---|---|---|
| Single agent | 0 links | The whole task in one context | No parallelism. Long tasks hit the context window and the agent loses track of early steps. |
| Orchestrator-workers | N − 1 links through the hub | Workers: their sub-task only. Coordinator: the plan plus every result | Wall clock ≈ plan + slowest worker + synthesis. The coordinator becomes the context bottleneck. |
| Sequential hand-off | N − 1 links in a chain | Each stage: its input plus what the last stage passed on | No parallelism at all: wall clock is the sum of stages. At 95% per hand-off, 5 stages succeed 0.95⁵ ≈ 77% of the time. |
| Specialist routing | 0 ongoing links; one routing call | One specialist’s context | Only works when a request fits one specialist. A wrong route gives a confident answer from the wrong expert. |
| Full mesh | N(N−1)/2: 45 at N = 10, against 9 for a hub | Every agent tends to carry everyone’s messages | Token cost grows with the links, and nobody owns the final answer. |
Notice that the patterns trade different things. The hub buys parallelism with one overloaded context. The pipeline buys simple, bounded contexts but adds up latency and compounds failure. Routing buys both, but only for tasks that never needed a team. Pick by the shape of the task: independent sub-tasks suit a hub, ordered stages suit a pipeline, and distinct request types suit a router. The bill follows the Space column. If five workers each re-read a shared 8,000-token brief, that is 40,000 input tokens before any of them starts, so hand each worker only its slice and a short summary of the goal.
Check yourself
With the page’s formula, W = 60 and c = 10. How many agents should you use?
Two. cost(1) = 60, cost(2) = 30 + 10 = 40, cost(3) = 20 + 30 = 50, cost(4) = 15 + 60 = 75. The third agent saves 10 units of work but adds 2 new links costing 20. When coordination is expensive relative to the work, the optimum sits at 1 or 2.
A research task splits into five questions that do not depend on each other. Which pattern fits, and why not a mesh?
Orchestrator-workers. The sub-tasks are independent, so workers never need to talk to each other. Only the coordinator needs to see all five answers. A mesh would add 10 links (5 × 4 ÷ 2) of chatter that carry no information the task needs. The coordinator’s synthesis step is where to spend your best model.
You add a review agent to the end of a 4-stage pipeline, and each hand-off succeeds 95% of the time. What happens to end-to-end reliability, and when is that still worth it?
It drops from 0.95⁴ ≈ 81% to 0.95⁵ ≈ 77% if the reviewer is just one more stage that can fail. It is worth it only if the reviewer catches more upstream errors than it introduces, by checking against tests or sources rather than re-reading the text. Measure both rates on real traces before you keep it.
A refactor touches one module, and every step depends on the last. A teammate proposes three agents “to go faster”. What do you predict?
It gets slower and more error-prone. The page’s U-curve has its minimum at N = 1 when there is almost no parallel work: W/N saves nothing if the steps must run in order anyway, while every link adds coordination and a hand-off that can lose context. Use one agent, and give it better tools or a plan instead of colleagues. If the context window is the real limit, a sequential hand-off with a written summary between stages beats parallel agents.
Keep W = 100 and c = 5 and scale to ten agents. What do the mesh and the hub cost?
Work drops to 100 / 10 = 10 in both. The mesh has 10 × 9 ÷ 2 = 45 links, so it costs 10 + 225 = 235, more than twice the cost of one agent working alone. The hub has 9 links and costs 10 + 45 = 55, worse than its best of 40 at four or five agents but still cheaper than one agent. So a hub fails gently as you add agents and a mesh fails fast. Past the minimum, though, every extra worker only adds cost, so stop adding them there.
Quick answers
What is multi-agent orchestration?
Coordinating several LLM agents on one task — e.g. an orchestrator splitting work among specialist workers — for parallelism and specialization.
Why can more agents be worse?
Coordination overhead grows quadratically (N(N−1)/2 pairs) while work divides only linearly, so past a point adding agents costs more than it saves.
When to use multiple agents?
When the task has real, independent parallelism large enough that the speedup beats the coordination cost — otherwise prefer a single agent.
What patterns scale?
Orchestrator-workers (hub-and-spoke), sequential handoff (pipeline), and specialist routing — anything but a full every-pair mesh.
This idea in other formats
Explore the topic
See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.
More Handbooks
- The Agentic AI Interview HandbookTwenty topics every senior AI engineer should be able to reason about live — from eval pipelines to reliability patterns for generative systems.Read →
- The Agent Evaluations HandbookA self-contained handbook on evaluating AI agents — theory, interactive widgets, and practical guidance. Trajectory evals, tool-use scoring, LLM-as-judge, observability, and reliability for PMs, engineers, and founders.Read →
- The Agent Patterns HandbookThe design patterns behind every LLM agent — the ReAct Thought–Action–Observation loop, tool/function calling, plan-and-execute, reflection, memory, multi-agent orchestration, and the failure modes (loops, hallucinated tools, recovery, human-in-the-loop) that break agents in production.Read →
- The Model Context Protocol (MCP) HandbookThe open standard connecting AI agents to the outside world — why M×N bespoke integrations collapse to M+N, the host/client/server roles over JSON-RPC, the three primitives (tools, resources, prompts), the connect→discover→call session lifecycle, when MCP earns its keep, and the security sharp edges (a server's output is untrusted input).Read →
- The Loop Engineering HandbookStop prompting your agents — design the system that prompts them for you. The inner vs outer loop, the four loop types (heartbeat, cron, hook, goal), the six building blocks (automations, worktrees, skills, MCP connectors, subagents, external memory), stopping conditions and the verification split, state across runs, cost engineering, and the six failure modes that burn tokens at 3am.Read →
- The Context Engineering HandbookThe discipline that replaced prompt-tweaking: curating everything the model sees under a finite attention budget. The anatomy of a production context window, the three taxes on an overstuffed one (context rot, cost, behavioral drift), the four operations (write, select, compress, isolate), agent-specific patterns like compaction and just-in-time retrieval, six production habits, and where it sits in the prompt → context → loop → harness stack.Read →