Topologies, Specialist Teams and Debate

The shape of a team decides who talks to whom, what it costs and how it fails.

BeginnerIntermediateExpert · 13 min read · Last updated:

In short

A topology describes how agents connect and who decides the next step. Pipelines suit fixed stages, a supervisor suits delegated subtasks, hierarchies suit larger teams, and peer networks or swarms trade control for flexibility. Debate and voting help only when agents make different mistakes and a sound rule picks the answer. Start with the most constrained shape that does the job.

What you will learn: the main topologies, how channels, messages and waiting grow, specialist roles, hierarchical and peer designs, swarms, debate and consensus, and how to choose.
Prerequisites: Single-Agent vs Multi-Agent Systems and Supervisor and Orchestrator-Worker Patterns.

Beginner The shapes

Five common topologies

TopologyWho decides the next stepFitsTypical failure
PipelineFixed order in codeStages with clear outputsAn early error flows onward
SupervisorOne coordinatorSeparable subtasksCoordinator bottleneck or poor briefs
HierarchyCoordinators at several levelsLarge work with natural groupsMeaning lost between levels
Peer networkAny agent may address othersOpen collaboration, researchChatter, loops, unclear ownership
SwarmLocal rules; control passes freelyMany similar agents, explorationHard to predict, test and stop

The words are used differently by different tools. "Swarm" in particular may mean simple handoffs in one library and large emergent systems elsewhere. Describe who holds control, what information moves and when the work ends.

Researcher
Planner
Executor
Reviewer
A pipeline: easy to follow, and as slow as the sum of its stages.
Leadowns the goal
Research leadtwo or three workers
Build leadtwo or three workers
Assurance leadcheckers
A hierarchy narrows each coordinator's attention and adds layers of summarizing.

What shape does to cost and waiting

This model counts channels, messages and elapsed turns for six agents. It is arithmetic about structure, not a benchmark of any product.

"""Count channels, messages and waiting for four ways to arrange agents."""

WORKERS, SECONDS = 6, 10                  # time for one model turn

def pipeline(n):
    return {"channels": n - 1, "messages": n - 1, "seconds": n * SECONDS}

def supervisor(n):
    # brief and result per worker, workers run together, then one summary
    return {"channels": n, "messages": 2 * n, "seconds": 3 * SECONDS}

def hierarchy(n, size=3):
    teams = -(-n // size)
    # plan, team plan, work, team summary, final summary
    return {"channels": n + teams, "messages": 2 * (n + teams),
            "seconds": 5 * SECONDS}

def network(n, rounds=3):
    # every agent sends to every other agent in each round
    return {"channels": n * (n - 1) // 2, "messages": rounds * n * (n - 1),
            "seconds": rounds * SECONDS}

print(f"{WORKERS} agents  channels  messages  seconds")
for shape in (pipeline, supervisor, hierarchy, network):
    r = shape(WORKERS)
    print(f"{shape.__name__:<10}{r['channels']:>8}{r['messages']:>10}"
          f"{r['seconds']:>9}")
print("network messages with 3, 6, 12 agents:",
      [network(n)["messages"] for n in (3, 6, 12)])

Output:

6 agents  channels  messages  seconds
pipeline         5         5       60
supervisor       6        12       30
hierarchy        8        16       50
network         15        90       30
network messages with 3, 6, 12 agents: [18, 90, 396]

With the same workers, the network sends 90 messages against 12 for the supervisor, and its message count climbs from 18 to 396 as the team grows from three to twelve. The pipeline sends little but waits longest, because nothing runs together. Real numbers depend on how large each message is and how much context each turn repeats. Anthropic reported that in its own data, multi-agent systems used around fifteen times the tokens of chat interactions, compared with about four times for single agents, so measure your own before assuming a team is affordable.

Reading the shape of a task

Before choosing a diagram, write the work down as steps and ask four questions about each pair of steps. Does one need the other's output? Do they need the same information? Do they change the same record? Would you want different people allowed to do them? Steps that depend on each other belong in sequence. Steps that share nothing can run in parallel. Steps that change one record need one owner. Different rights are a reason to separate agents even when the work is small.

What you observeWhat it suggests
Output of one step feeds the nextPipeline or a single agent with stages
Many similar items, no shared dataParallel workers behind a queue
Subtasks are known only after lookingSupervisor that plans and delegates
Conversation moves between expert areasLimited handoffs between peers
Everyone needs the same full contextOne agent is probably better

The last row matters. Anthropic's write-up of its research system notes that tasks where all agents need the same context, or where there are many dependencies between them, were a poor fit for splitting. Separate agents pay to share information that one agent would simply have.

Intermediate Teams and roles

Specialist teams: researcher, planner, executor, reviewer

A popular design gives each agent a job title. It helps when the titles correspond to real differences in tools, permissions, context or tests.

RoleOutputTools and rightsHow to test it
ResearcherFindings with sourcesSearch and read onlyCoverage and citation accuracy
PlannerOrdered steps with done conditionsNone, or read onlyPlans complete the task and respect rules
ExecutorActions and their resultsGated write toolsCorrect state change, no forbidden action
ReviewerPass or specific defectsRead, run testsCatches seeded faults, few false alarms
  • Give the reviewer something to check against, such as tests, source documents or rules. A second opinion with the same evidence and model often agrees with the first.
  • Keep the writer and the checker separate in permissions, so the reviewer cannot quietly fix and approve its own change.
  • Remove roles that never change an outcome. Log how often each one alters the result.

Hierarchies

Use a second level when one coordinator would otherwise juggle too many workers or unrelated kinds of work. Each level should receive a complete brief and return checkable results with sources, not a confident paragraph. Pass the user's identity and limits down unchanged, divide the budget explicitly and cap depth. Errors introduced by summarizing are hard to see from the top, so let higher levels fetch the underlying evidence. In most business systems, two levels are plenty to reason about.

Peer-to-peer collaboration

Peers can hand work to each other directly, for example a billing agent transferring a conversation to a technical agent. This removes a coordinator, and with it the one place that knew the whole picture. Compensate with rules in code:

  • Exactly one agent owns the task at any moment.
  • Each agent has an allowed list of peers it may hand to.
  • A task carries its history and a handoff limit.
  • A named fallback, often a person, receives anything unresolved.
  • Stop conditions are checked by the runtime, not agreed between agents.

The details of safe transfer are in Handoffs, Routing, Shared State and Communication.

Swarms and dynamic teams

Swarm-like designs let many agents pick up work from a shared space or pass control according to local rules. They can explore widely and tolerate the loss of one member. They are also harder to predict, to attribute and to halt. If you try one, bound the number of agents, total spend and duration centrally; make every contribution attributable; and keep consequential actions behind a single gate that the swarm cannot bypass. Treat results as proposals until verified. For many tasks a simple queue with independent workers gives the same parallelism with far less mystery.

Expert Debate and consensus

Debate-based systems

In a debate design, several agents answer, read one another's reasoning, revise and then a vote or judge selects the result. Research results are mixed. Some studies report gains on reasoning tasks, while others find that majority voting without any discussion accounts for most of the improvement, and that debate can sometimes make answers worse when agents are persuaded by confident but wrong arguments. Treat debate as a hypothesis to test on your tasks against two cheaper baselines: one agent, and independent answers with a vote.

Why independence matters

"""When does majority voting help? It depends on shared mistakes."""
from math import comb

def majority(n, p):
    """Chance that most of n independent voters are right."""
    return sum(comb(n, k) * p**k * (1 - p)**(n - k)
               for k in range(n // 2 + 1, n + 1))

def with_shared_failure(n, p, shared):
    """With probability `shared`, all voters copy one answer."""
    return shared * p + (1 - shared) * majority(n, p)

print("accuracy of one agent: 70%")
print("voters  independent  half shared  all shared")
for n in (1, 3, 5, 9):
    row = [with_shared_failure(n, 0.7, s) for s in (0.0, 0.5, 1.0)]
    print(f"{n:>6}" + "".join(f"{v:>13.1%}" for v in row))
print("weak agents (40% right), 5 independent voters:",
      f"{majority(5, 0.4):.1%}")

Output:

accuracy of one agent: 70%
voters  independent  half shared  all shared
     1        70.0%        70.0%        70.0%
     3        78.4%        74.2%        70.0%
     5        83.7%        76.8%        70.0%
     9        90.1%        80.1%        70.0%
weak agents (40% right), 5 independent voters: 31.7%

If errors were independent, nine voters at 70 percent would reach about 90 percent. When all share the same mistake, adding voters does nothing, and when each voter is right less than half the time, voting makes things worse. Agents built on one model with one context are likely to share errors, so real gains usually sit well below the independent column. The model also assumes a right-or-wrong answer and identical accuracy. Estimate your own correlation by counting how often agents are wrong on the same cases.

Choosing a decision rule

RuleGood forBeware
Verification by codeTests, calculations, schema checksOnly checks what you encoded
Source authorityFacts held in systems of recordStale records
Majority voteShort categorical answersShared errors
Judge agentOpen-ended qualityJudge bias toward style or length
UnanimityCautious screeningFrequent deadlock
Human decisionHigh stakes or policy gapsCapacity and delay

Prefer evidence over agreement: if a test can settle the question, run it. Fix the number of rounds in advance, keep the first independent answers so that you can compare, and report disagreement to the user when it remains. Parallelism, Deadlocks and Conflict Resolution shows rules for contradictions.

How to choose

  1. Can one agent with good tools pass the tests? Stop there.
  2. Are the stages fixed? Use a pipeline, possibly without separate agents.
  3. Are there separable subtasks or permissions? Use a supervisor.
  4. Is the supervisor overloaded with distinct groups? Add one level.
  5. Must control move between domains during a conversation? Allow limited peer handoffs.
  6. Only then experiment with open networks, swarms or debate, with strict budgets.
Illustrative example: a due-diligence team

A team starts with six agents that all talk to each other and finds long, repetitive threads. It changes to a lead that sends independent research briefs to three readers, then a checker that compares every claim with its cited page. Messages fall, ownership is clear and failures can be traced to one brief or one source.

Document the design

One page is enough: a diagram with every allowed edge, a table of agents with owners and rights, the limits, the decision rule, what happens when each agent fails and the baseline result that justified the team. Keep it next to the code and update it in the same change. When something goes wrong, this page tells the person on call what should have happened.

Measure the topology itself

  • Task success against a single-agent baseline.
  • Messages, tokens, cost and elapsed time per successful task.
  • Share of work duplicated or never assigned.
  • Handoffs per task and tasks that hit limits.
  • How often each role changes the final outcome.
  • Effect of removing one agent.

The last test is revealing. If results hold up without a role, remove it and keep the saving.

When a member fails

Decide this for each shape before launch. In a pipeline, a failed stage stops the line, so save the outputs of earlier stages and retry only the broken one. Under a supervisor, a failed worker can be retried, replaced or reported as a gap in the result, and the supervisor must not fill the gap with a guess. In a hierarchy, a failed middle coordinator strands its workers, so cancel them and keep their partial results. In a network or swarm, silence can go unnoticed, which is why a central record of who holds what, with deadlines, is needed. Finally, plan for the coordinator itself failing: its task record should let a fresh instance continue without asking every worker to start again.

Changing shape as you learn

Topology is not a permanent choice. A practical path is to build the single agent first and keep its evaluation set. When traces show a recurring weakness, add exactly one role aimed at it, such as a checker for unsupported claims, and run the same cases again. Keep the role only if the result improves by more than the normal variation between runs and the added cost is acceptable. Record the reason, so a later maintainer knows what would justify removing it.

Make the shape configurable where it is cheap to do so: the list of agents, allowed edges, limits and decision rule as data, with validation in code that rejects unreachable agents, edges to unknown agents and loops with no exit condition. You can then compare variants without rewriting prompts, and a review can see the whole design in one place. Tools named for graphs or workflows help with this, as described in Graphs, State Machines, Parallelism and Sagas.

Mixing shapes

Real systems combine shapes: a pipeline whose research stage is a small supervisor team, or a router that chooses between a single agent and a team. Keep each part testable alone, give every boundary a structured input and output and draw the whole thing before building it. See Agent Pattern Catalog and Diagram Gallery.

Models and instructions per role

Roles may share one model or use different ones. A smaller, cheaper model may be enough for classification or extraction, while planning or synthesis may justify a stronger one. Each additional model adds evaluation, version tracking and failure behavior, so require measured benefit. Keep instructions short and specific to the role: what it owns, what it must return, what it must never do and when to give up. Overlapping instructions cause two agents to do the same work or each to assume the other will. Review the set together, because a change to one role often shifts the work that arrives at its neighbors.

Common mistakes

  • Copying a human organization chart.
  • Letting everyone talk to everyone.
  • Adding a reviewer with nothing to check against.
  • Assuming debate improves accuracy without a baseline.
  • Unlimited rounds or depth.
  • No single owner of the final answer.
  • Measuring quality but not cost and time.

Checklist

  • Each agent has a reason, an output and a test.
  • Control and ownership are explicit at every step.
  • Allowed communication paths are enforced.
  • Rounds, depth, agents and spend are capped.
  • The decision rule is defined before running.
  • Failure of each member has a response.
  • The team beats a simpler baseline on measured cases.

Frequently asked questions

Which topology is best?

None in general. The best one is the most constrained shape that meets your quality target at an acceptable cost.

How many agents are too many?

When added agents no longer improve measured results, or you can no longer explain which one caused an outcome.

Does debate reduce hallucinations?

It can on some tasks and not others. Checking claims against sources is usually a more direct control.

Can agents choose their own team?

They can propose it from an approved registry. Code should enforce which agents, permissions and budgets are allowed.

References and further reading

Next steps