Slides · Context, memory and multi-agent systems

Multi-agent systems: when to use them and what they cost

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:

  1. Choose between a workflow, a single agent and a multi-agent design, justifying the choice with cost, latency and error trade-offs.
  2. Estimate the end-to-end success of an n-step chain from its per-step success rate, and name the changes that raise it.

Source1 Building effective agents

Compare

Workflow, agent, multi-agent

StructureWho decides the next stepStrengthWeakness
WorkflowYour code (predefined paths)Predictable and cheapCannot handle steps you did not plan
AgentThe model, directing its own process and tool useFlexibleLess predictable, costs more
Multi-agentSeveral agents, each with its own prompt, tools and context, coordinatingParallel work, separate contextsTokens, 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.

Source1 Building effective agents

Diagram

A ladder of flexibility, cost and risk

Diagram: The options form a ladder from a single call to a multi-agent system.

Single call plus retrieval

Workflow: fixed steps

Agent: model picks steps

Multi-agent: several agents

Diagram summary: The options form a ladder from a single call to a multi-agent system. Each step down adds flexibility, cost and risk. Start at the top and move down only when a measured limit forces it.

Source1 Building effective agents

Diagram

Three questions, in order

Diagram: If one call with retrieval is enough, stop.

yes

no

yes

no

no

yes

One call plus retrieval
meets the bar?

Stop: single call

Steps known
in advance?

Workflow

One agent's context,
tools or parallelism
is the bottleneck?

Single agent

Multi-agent
with budgets

Diagram summary: If one call with retrieval is enough, stop. If the steps are known, build a workflow. If not, use one agent, and add more agents only when one agent’s context, tools or parallelism is the measured bottleneck.

Sources1 Building effective agents2 How we built our multi-agent research system

Compare

Five workflow patterns

Anthropic names these patterns. Most real systems combine them.

PatternShapeUse when
Prompt chainingFixed sequence of calls, optional checks betweenA task splits cleanly into steps; you accept more latency for accuracy
RoutingClassify the input, send it to a specialised handlerCategories need different prompts or models
ParallelizationIndependent subtasks at once (sectioning), or the same task several times (voting)Subtasks do not depend on each other, or you want diverse answers
Orchestrator-workersA lead model decides the subtasks at run time, delegates and combinesYou cannot list the subtasks in advance
Evaluator-optimizerOne call generates, another critiques, loop until good enoughYou 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.

Source1 Building effective agents

Diagram

Orchestrator-workers with a verifier

Diagram: A lead agent splits the task across workers that each have their own context and tools, then combines their results.

no

yes

Task

Lead agent:
plan and split

Worker A

Worker B

Worker C

Lead combines

Verifier passes?

Result and trace

Diagram summary: A lead agent splits the task across workers that each have their own context and tools, then combines their results. A verifier either sends the work back to the lead or releases the result with a trace. Budgets for steps, tokens and time should cap the lead.

Source2 How we built our multi-agent research system

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.

Source2 How we built our multi-agent research system

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.

StructureTypical tokensCost at 1 unit per chat
Chat1x1
Single agentabout 4x4
Multi-agentabout 15x15
  • 15/4=3.7515 / 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−415 - 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.

Source2 How we built our multi-agent research system

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.

Source3 Don't Build Multi-Agents

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 pp and the steps are independent, an nn-step chain succeeds with probability pp to the power nn.

P(chain succeeds)=pnP(\text{chain succeeds}) = p^n
SymbolMeaning
ppProbability that one step succeeds (0 to 1)
nnNumber of steps in the chain
PPProbability 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.97p = 0.97.

Steps (nn)CalculationChain success
50.9750.97^50.859
100.97100.97^{10}0.737
150.97150.97^{15}0.633
300.97300.97^{30}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.3671 - 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.4010.633 \times 0.633 = 0.401.

Worked example

Worked example: raising a 15-step chain

Baseline: 15 free-form steps at p=0.97p = 0.97, so 0.9715=0.6330.97^{15} = 0.633.

Design changeCalculationChain success
Checkpoints: 3 stages of 5 steps, each retried once if its check failsstage = 0.975=0.8590.97^5 = 0.859; with one retry 1−(1−0.859)2=0.9801 - (1 - 0.859)^2 = 0.980; three stages 0.98030.980^30.941
Fixed code for 6 of the 15 steps (p=0.999p = 0.999 each)0.979×0.99960.97^9 \times 0.999^60.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.6940.97^{12} \approx 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.9721 - (1 - 0.97^6)^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

  1. Building effective agents (opens in a new tab)

    Erik S., Barry Zhang2024Article

    Used for Workflow and agent definitions, the five workflow patterns, and the advice to find the simplest solution and add complexity only when needed.

  2. How we built our multi-agent research system (opens in a new tab)

    Jeremy Hadfield, Barry Zhang, Kenneth Lien, Florian Scholz, et al.2025Article

    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.

  3. Don't Build Multi-Agents (opens in a new tab)

    Walden Yan2025Article

    Used for The argument that parallel subagents make conflicting assumptions without shared context, and the two principles: share context, and actions carry implicit decisions.