Slides · Context, memory and multi-agent systems
Multi-agent systems: when to use them and what they cost
1 / 17
Multi-agent systems: when to use them and what they cost
How to choose between a workflow, a single agent and several agents, and why every extra step makes the whole chain less likely to succeed.
Concept
Every extra agent needs a reason
- Two agents each saw the same stuck refund, each wrote DONE, and the second one reversed a payment that was fine. Neither log mentioned the other.
- “Design an agent” questions test judgment about when not to build a multi-agent system.
- Anthropic’s guidance: find the simplest solution that meets the bar, and add complexity only when it demonstrably improves outcomes.
Two things you will be able to do:
- Choose between a workflow, a single agent and a multi-agent design, justifying the choice with cost, latency and error trade-offs.
- Estimate the end-to-end success of an n-step chain from its per-step success rate, and name the changes that raise it.
Compare
Workflow, agent, multi-agent
| Structure | Who decides the next step | Strength | Weakness |
|---|---|---|---|
| Workflow | Your code (predefined paths) | Predictable and cheap | Cannot handle steps you did not plan |
| Agent | The model, directing its own process and tool use | Flexible | Less predictable, costs more |
| Multi-agent | Several agents, each with its own prompt, tools and context, coordinating | Parallel work, separate contexts | Tokens, hand-offs, more ways to fail |
- The workflow and agent definitions are Anthropic’s (Building effective agents, 2024-12-19). “Multi-agent” is a common extension of them.
- Mental model: a workflow is an assembly line, an agent is one capable generalist, and multi-agent is a small team with a manager. A team works in parallel but spends time on meetings, and a misunderstanding between two members can ruin the result.
Diagram
A ladder of flexibility, cost and risk
Diagram
Three questions, in order
Sources[1] Building effective agents[2] How we built our multi-agent research system
Compare
Five workflow patterns
Anthropic names these patterns. Most real systems combine them.
| Pattern | Shape | Use when |
|---|---|---|
| Prompt chaining | Fixed sequence of calls, optional checks between | A task splits cleanly into steps; you accept more latency for accuracy |
| Routing | Classify the input, send it to a specialised handler | Categories need different prompts or models |
| Parallelization | Independent subtasks at once (sectioning), or the same task several times (voting) | Subtasks do not depend on each other, or you want diverse answers |
| Orchestrator-workers | A lead model decides the subtasks at run time, delegates and combines | You cannot list the subtasks in advance |
| Evaluator-optimizer | One call generates, another critiques, loop until good enough | You have clear criteria and revision helps |
A supervisor with hand-offs is a common variation of orchestrator-workers. Names differ between frameworks, so describe the shape instead of relying on a label.
Diagram
Orchestrator-workers with a verifier
Concept
When multi-agent helps
Anthropic’s write-up of its research system (2025-06-13) found multi-agent a strong fit for work that is:
- Broad and parallel, such as researching many sources at once.
- Larger than one context window.
- Tool-heavy, with different parts needing different tools.
Subagents work in parallel with their own windows and pass condensed findings to a lead. On Anthropic’s internal research eval, a Claude Opus 4 lead with Claude Sonnet 4 subagents outperformed a single Claude Opus 4 agent by 90.2%. That is one team’s result from 2025, on research tasks, not a law.
Poor fit, per the same write-up: domains where all agents must share one context or depend closely on each other. Most coding tasks have fewer parallelisable parts than research.
Worked example
What it costs: tokens
The same write-up reports that agents typically use about 4x the tokens of a chat interaction, and multi-agent systems about 15x.
Illustrative: a chat answer costs 1 unit.
| Structure | Typical tokens | Cost at 1 unit per chat |
|---|---|---|
| Chat | 1x | 1 |
| Single agent | about 4x | 4 |
| Multi-agent | about 15x | 15 |
- 15/4=3.75: a multi-agent run costs about 3.75 times a single-agent run, so the quality gain must be worth at least the extra 11 units (15−4).
- Anthropic also reports that on the BrowseComp evaluation, token usage alone explained 80% of the performance variance. So part of the gain from more agents is simply more tokens spent, and “more agents means a smarter system” is the wrong takeaway.
- Extra costs: coordination latency, duplicated work, harder debugging, errors that compound, a larger security surface.
Concept
Where it breaks: conflicting assumptions
Walden Yan (Cognition, 2025-06-12) argues that parallel subagents are fragile. Every action carries implicit decisions, and subagents without enough shared context make conflicting ones.
- His example: a Flappy Bird clone split into two subtasks. One subagent misread its brief and built a Super Mario style background, the other built a bird that looked out of place and moved differently, and a final agent had to merge two mismatched pieces.
- His two principles: share context (including full agent traces, not only messages), and remember that actions carry implicit decisions, so conflicting decisions give bad results. His default is a single-threaded linear agent. Treat this as one practitioner’s view that balances Anthropic’s.
This course’s mitigations, if you do go multi-agent (not from the post):
- Shared state: one place that records “refund for ticket 9: in progress, owner billing agent”.
- Task contracts: each agent knows what it owns and what to return.
- Termination and budget: a step limit, a token limit and a rule for when to stop.
Check yourself
Check: one repo, many dependent edits
A team wants to refactor one codebase. Every change depends on the previous one: renaming a type breaks six call sites that other edits must then match. Someone proposes four parallel agents, one per module. Which structure do you recommend, and why?
Answer
A single agent, possibly with a workflow around it (plan, edit, run tests). The edits depend closely on each other and need one shared view of the code, which is the kind of work Anthropic’s write-up calls a poor fit for multi-agent. Parallel agents would make conflicting assumptions about the renamed type, and the multi-agent token cost (about 15x a chat) buys little because few subtasks are independent. Revisit if a measured bottleneck appears, such as a context limit.
Math
Errors compound
If each step succeeds with probability p and the steps are independent, an n-step chain succeeds with probability p to the power n.
P(chain succeeds)=pn| Symbol | Meaning |
|---|---|
| p | Probability that one step succeeds (0 to 1) |
| n | Number of steps in the chain |
| P | Probability that every step succeeds |
- Real steps are not fully independent. Treat the result as a warning about direction, not a forecast.
- Adding agents adds steps and hand-offs, so it can lower end-to-end reliability.
Worked example
Worked example: a good step is not a good chain
Illustrative per-step success p=0.97.
| Steps (n) | Calculation | Chain success |
|---|---|---|
| 5 | 0.975 | 0.859 |
| 10 | 0.9710 | 0.737 |
| 15 | 0.9715 | 0.633 |
| 30 | 0.9730 | 0.401 |
- A step that works 97 times in 100 sounds reliable. Fifteen of them in a row fail more than a third of the time (1−0.633=0.367).
- Doubling the length from 15 to 30 steps does not halve the success rate. It squares it: 0.633×0.633=0.401.
Worked example
Worked example: raising a 15-step chain
Baseline: 15 free-form steps at p=0.97, so 0.9715=0.633.
| Design change | Calculation | Chain success |
|---|---|---|
| Checkpoints: 3 stages of 5 steps, each retried once if its check fails | stage = 0.975=0.859; with one retry 1−(1−0.859)2=0.980; three stages 0.9803 | 0.941 |
| Fixed code for 6 of the 15 steps (p=0.999 each) | 0.979×0.9996 | 0.756 |
- The numbers are illustrative and assume the check catches every failure and the retry is independent. Real checks miss errors, so the gain is smaller.
- Other levers: shorter chains, verification steps, checkpoints that let you resume instead of restart, and replacing free-form steps with a fixed workflow.
- Each lever costs something: a retry spends tokens, a check adds latency, and a fixed step loses flexibility.
Check yourself
Check: estimate a chain
A pipeline has 12 steps. Each succeeds with probability 0.97, independently. Estimate the end-to-end success and name two changes that raise it.
Answer
0.9712≈0.694. Two changes: add checkpoints with a retry, so two stages of 6 steps each retried once give 1−(1−0.976)2=0.972 per stage and about 0.945 overall under the same idealised assumptions. Or replace free-form steps with fixed code. Shortening the chain also helps.
Summary
Recap
- Choose the simplest structure that meets the bar: single call, workflow, agent, then multi-agent.
- Multi-agent buys parallelism and isolation at a large token and coordination cost (about 15x a chat in Anthropic’s report).
- Shared state, clear task contracts, termination rules and budgets stop agents redoing each other’s work.
- Errors compound as p to the power n. Shorter chains, checks, retries and fixed steps raise reliability, each at a price.
References
References & Sources
Building effective agents (opens in a new tab)
Erik S., Barry Zhang2024Article
https://www.anthropic.com/engineering/building-effective-agents
Used for Workflow and agent definitions, the five workflow patterns, and the advice to find the simplest solution and add complexity only when needed.
How we built our multi-agent research system (opens in a new tab)
Jeremy Hadfield, Barry Zhang, Kenneth Lien, Florian Scholz, et al.2025Article
https://www.anthropic.com/engineering/multi-agent-research-system
Used for Parallel subagents with their own context windows; token use of about 4x (agents) and about 15x (multi-agent) a chat; fit and poor fit for multi-agent; the 90.2% internal-eval result; token usage explaining 80% of BrowseComp variance.
Don't Build Multi-Agents (opens in a new tab)
Walden Yan2025Article
https://cognition.com/blog/dont-build-multi-agents
Used for The argument that parallel subagents make conflicting assumptions without shared context, and the two principles: share context, and actions carry implicit decisions.
Keys: ← → move, Home End first and last, F full screen.