Skip to content
AI Engineer Guide.

concept · concepts · intermediate · concept 26 of 37

Multi-agent patterns

0 of 37 complete

Why it matters

Once a task is split across agents, the coordination shape determines most of the behaviour: who sees what, who can act, how disagreements resolve. Choosing a pattern casually produces systems where every agent talks to every other, context is duplicated, and no one can say which agent decided. Naming the pattern makes the trade-offs explicit and gives you a place to put limits.

Mental model

Patterns are organisational charts for software: a supervisor with reports, an assembly line, a panel. The metaphor breaks because human org charts carry authority and shared culture, while agent topologies carry only message routes, so a missing edge is a silent dead end rather than an escalation.

How it works

Supervisor star, with one orphanInteractive
11 nodes · 5 branches
workerfilesupervisorexcludedcombinerruled out or rejected

Step 1 of 7

Decompose first

The decomposition is written before the topology: three producing subtasks and one check. The judge is not a fourth producer; it is a gate on the draft.

supervisor · current

Supervisor · one per task

Decomposes the task, dispatches one subtask per worker, enforces the caps and owns the combine step. It is the only node that sees every subtask, and therefore the bottleneck.

Root of the hierarchy

Also in focus

  • Research worker
  • Retrieval worker
  • Writer worker
Step 1/7 · Decompose first

Figure. One supervisor with three producers, one judge and one combiner: the star topology with a contract on every edge, plus the orphan artifact that no consumer reads. The supervisor is also the bottleneck, since every message crosses it.

What to notice. The topology is the design decision, not the framework: the same five edges can be built in any runtime. Fan-out buys parallelism and costs a single point of failure, which is why the caps live at the supervisor rather than in a worker's prompt. Message budgets are illustrative; the contracts, the depth and fan-out caps, and the orphan check are the page's rules.

Text version

A supervisor topology drawn as a tree. The root is a supervisor, one per task, with a depth cap of two and fan-out of five. Five children hang from it with a contract on each edge. A research worker returns sources.json, a retrieval worker returns spans.json, a writer worker returns draft.md, a judge takes the draft and a rubric and returns a verdict, and a synthesis step reads the draft, sources and verdict and emits one output. A sixth node, notes.md, hangs under the writer and is marked excluded because no downstream node reads it, illustrating an orphaned subtask. Later steps cover the caps, the combine rule and edge instrumentation.

  1. Write the decomposition first: which subtasks exist and what each produces for the next.
  2. Pick the simplest topology that fits: one agent, then a pipeline, then a supervisor.
  3. Define the message contract at each edge, including what a failure looks like.
  4. Assign one owner per subtask and cap the depth of delegation.
  5. Decide how results combine: concatenation, voting, a judge or a synthesis step.
  6. Instrument the edges, not only the agents, so time and context spend are visible.

Trade-offs

ChoiceGood forCostFails when
SupervisorClear ownership, central limitsBottleneck and single point of failureSubtasks are long-running and parallel
PipelinePredictable stages, easy debuggingRigid to out-of-order workThe task needs backtracking
DebateSurfaces disagreement on judgement callsCost multiplies and convergence is unclearThere is no verifiable criterion
BlackboardFlexible, incremental contributionHard to bound and to auditLatency or cost must be predictable
Trade-off mapInteractive

Good for

Clear ownership, central limits

Cost

Bottleneck and single point of failure

Fails when

Subtasks are long-running and parallel

  1. Subtasks are long-running and parallel
  2. The task needs backtracking
  3. There is no verifiable criterion
  4. Latency or cost must be predictable

Figure. Each choice with what it buys, what it costs, and the case where it loses.

What to notice. The fourth column is the decision: if the losing case describes your situation, the choice is wrong.

Text version

Four trade-offs: Supervisor is good for Clear ownership, central limits, costs Bottleneck and single point of failure, and fails when Subtasks are long-running and parallel. Pipeline is good for Predictable stages, easy debugging, costs Rigid to out-of-order work, and fails when The task needs backtracking. Debate is good for Surfaces disagreement on judgement calls, costs Cost multiplies and convergence is unclear, and fails when There is no verifiable criterion. Blackboard is good for Flexible, incremental contribution, costs Hard to bound and to audit, and fails when Latency or cost must be predictable

Failure modes

  • Broadcast storm. Agents message everyone and context explodes. Debug: count messages per task and per edge, and compare with the number of subtasks.
  • Consensus without criteria. Debate converges on confident agreement that is wrong. Debug: score debates against a ground-truth check, not against agreement between agents.
  • Orphaned subtask. A worker finishes and no combiner consumes its output. Debug: assert every produced artifact is read by a downstream node in the trace.

In production

Track messages per task, tokens per edge and the share of subtasks that end in failure. Cap depth and fan-out, and alert when a run's edge count exceeds the design.

Common misconceptions

People think: Debate improves accuracy because agents check each other.

Actually: Agents sharing a model and context tend to share its errors; gains appear mainly where an external check exists.

People think: A pattern is a framework choice.

Actually: The topology is a design decision you can implement in any runtime; the framework supplies primitives.

Interview angle

Strong answers start from the decomposition, choose the simplest topology, and name the contract at each edge plus the limit that keeps it bounded. Weak answers list pattern names from a paper without saying which failure each one prevents.

Sources