Agentic AI · Module 16 of 41 · 10 concepts · about 16 min

Single-Agent and Multi-Agent Systems

What one agent does well and where it runs out, the roles agents take in a team, and how a team delegates, coordinates, shares memory, allocates tasks and settles disagreements.

At work: The decision that most often separates a system that works from one that is impressive in a demo and unmanageable in production: whether a second agent is solving a real problem or creating one.

The single agent

What it is

A single-agent system is one model in one loop with one set of tools and one context. It is the default, and for most tasks the right design.

  • Advantages: simple to build, test and debug; one context holds the whole picture; nothing is lost between agents; cheapest in total tokens for small tasks.
  • Disadvantages: the context grows with every step; too many tools blur selection; one prompt must cover every role; steps run one after another.
  • Use it when: the task fits in a manageable context, needs up to a couple of dozen tools, and its steps depend closely on each other.

Why it matters

Every step in a single agent can see everything before it.

  • That shared view is exactly what multi-agent systems struggle to recreate.
  • Most 'we need more agents' problems are really 'the context is too long' or 'there are too many tools', which have simpler fixes (modules 3 and 12).
  • Exhaust the single agent first.

In the real world: A team's five-agent support system was replaced by one agent with better tools and context trimming; success rose and cost per ticket halved.

Splitting into several agents because the diagram looks more capable. Each split adds a hand-off where information is lost and a new place for things to go wrong.

Multi-agent systems and when they help

What it is

A multi-agent system uses several agents, each with its own prompt, tools and context, working on parts of one task. It helps in four situations:

  • Independent strands: research on five companies that do not depend on each other can run in parallel.
  • Context isolation: a side-task that reads fifty pages can be done by a sub-agent that returns one paragraph, keeping the main context clean.
  • Specialisation: clearly different jobs needing different tools, instructions or models.
  • Separation of duties: one agent proposes and another, with different access, checks or approves.

Why it matters

These are the only good reasons, and each can be tested.

  • If the strands depend on each other, splitting them loses the shared view.
  • If the context is not actually too long, isolation buys nothing.
  • If one prompt can do the job, specialisation is ceremony.
  • A second agent should earn its place by parallel speed, a cleaner context, or an independent check.

In the real world: A research product runs one sub-agent per source in parallel, each returning a short brief; the lead agent's context holds eight briefs, not eight websites.

Visual example

Decision

Stay in the left column until something in the right column is clearly true.

One agent or several
stay with one agentconsider several
StepsDepend on each otherSeparate into independent strands
ContextFits comfortablyA side-task would flood it
ToolsA couple of dozenDistinct sets for distinct jobs
SpeedSequential is acceptableParallel work would cut the wait
CheckingCode can verify the resultAn independent reviewer is needed
DebuggingOne traceSeveral traces and their hand-offs

Modelling agents on a human org chart: a 'CEO agent', a 'manager agent', an 'intern agent'. People split work because one person cannot hold it all. A model's limits are different, and the split should follow context and tools, not job titles.

Practise it: Design a Multi-Agent Data Analyst

Agent roles

What it is

In a team, each agent has a role: a defined job with its own prompt and tools. The common ones:

  • Supervisor (orchestrator, manager): receives the task, breaks it up, assigns the parts, combines the results.
  • Worker (sub-agent): does one assigned piece and reports back.
  • Router: decides which agent should handle a request, and does nothing else.
  • Planner: writes the plan; does not execute.
  • Executor: carries out one plan step with tools.
  • Researcher: gathers and summarises information; read-only tools.
  • Critic (reviewer, evaluator): checks another agent's output against criteria.
  • Specialised agent: any agent narrowed to one domain, such as billing or SQL.

Why it matters

A role is useful only if it changes what the agent can see or do.

  • A researcher with read-only tools cannot cause damage, whatever it reads.
  • A critic that did not write the draft, and has the evidence, reviews better than the writer.
  • A router with no tools is cheap and easy to evaluate.
  • Roles that differ only in name ('senior analyst', 'junior analyst') add cost and nothing else.

In the real world: A due-diligence system's researcher can read anything but write nothing, and its writer can write the report but fetch nothing; a poisoned web page can mislead the first but cannot make the second act.

Visual example

Roles

A role is defined by its tools and its output, not its title.

Common agent roles and what each is given
rolejobtoolsreturns
SupervisorSplit, assign, combineDelegation onlyThe final result
RouterPick the right agentNoneA route
PlannerWrite the planNone or read-onlyA typed plan
ResearcherFind and summariseSearch, fetch (read-only)A brief with sources
ExecutorCarry out one stepThe tools for that stepThe step's result
CriticCheck against criteriaRead-only, evidenceFailures or PASS

Giving every role every tool. The point of a role is a narrower set of abilities. A critic that can also edit will rewrite instead of reviewing.

Delegation

What it is

Delegation is one agent giving a sub-task to another. The sub-agent starts with an empty context, so the brief it receives is everything it knows. A good brief states:

  • the objective, and the larger goal it serves;
  • the context it needs: facts already found, constraints, what to avoid;
  • the output format wanted, and its length;
  • the tools and limits it has;
  • what done means.

Why it matters

A sub-agent cannot see the conversation that led to its task.

  • 'Research the competitor' produces a generic essay.
  • 'Find Acme's 2025 revenue and headcount from primary sources, for a pricing comparison; return five bullet points with links; stop after six searches' produces what was needed.
  • Most multi-agent failures are briefing failures: the worker did a slightly different job from the one intended.

In the real world: Two sub-agents given 'research pricing' and 'research competitors' both researched competitor pricing; briefs with explicit scope and 'do not cover' lines ended the overlap.

from pydantic import BaseModel

class Brief(BaseModel):
    objective: str            # what to do
    purpose: str              # why: lets the worker make sensible judgement calls
    context: str              # facts already known; things ruled out
    output_format: str        # e.g. "five bullets, each with a source link"
    max_steps: int = 6

class Report(BaseModel):
    findings: list[str]
    sources: list[str]
    confidence: str           # "high" | "medium" | "low"
    gaps: str                 # what could not be found

def delegate(brief: Brief, tools: list) -> Report:
    """Run a worker in a FRESH context. Only the Report comes back."""
    return run_agent(system=WORKER_PROMPT, task=brief.model_dump_json(),
                     tools=tools, max_steps=brief.max_steps, output=Report)

A one-line brief, on the assumption the worker 'knows' what the supervisor knows. It knows nothing but the brief. Write it as you would for a capable contractor who has never seen the project.

Coordination and task allocation

What it is

Coordination is how agents avoid getting in each other's way. Task allocation is deciding who does what. Three approaches:

  • Central: a supervisor assigns every task and sees every result. Simple and traceable.
  • Rule-based: code routes by type: billing questions to the billing agent.
  • Market or claim-based: agents pick tasks from a shared list, each claiming one so no two take the same.

Allocation can be static (fixed in advance) or dynamic (decided as the work unfolds).

Why it matters

Without coordination, agents duplicate work, leave gaps and overwrite each other.

  • Central assignment is the easiest to reason about and debug, and is the right starting point.
  • Claim-based allocation scales to many workers but needs locking, so a task is claimed once.
  • Whatever the scheme, each task should have exactly one owner at a time.

In the real world: A code-migration system puts four hundred files on a task list; twenty workers claim one each. Before atomic claiming, the same file was migrated by two workers about one time in thirty.

def claim_next(worker_id: str) -> dict | None:
    """Atomically claim one unassigned task, so two workers never take the same one."""
    return db.query_one(
        """UPDATE tasks SET status = 'claimed', owner = %s, claimed_at = now()
           WHERE id = (SELECT id FROM tasks WHERE status = 'open'
                       ORDER BY priority DESC LIMIT 1 FOR UPDATE SKIP LOCKED)
           RETURNING *""",
        [worker_id],
    )

Letting agents negotiate assignments in free conversation. It costs many turns and often ends with two agents each believing the other took the task. Assign in code.

Practise it: Design a Multi-Agent Incident Response System

Shared memory

What it is

Agents in a team need some common knowledge. Three designs, from least to most shared:

  • Nothing shared: each agent has its own context; information moves only in briefs and reports.
  • Shared state: a structured record all agents read and write: the plan, task statuses, established facts.
  • Shared memory store: a searchable store of findings any agent can query.

Why it matters

Sharing more helps agents build on each other and costs isolation.

  • With nothing shared, contexts stay small and mistakes stay contained, but work is repeated.
  • With shared state, everyone sees progress, but a wrong entry misleads everyone.
  • Rules that keep shared state healthy: each field has one owner; entries record who wrote them and from what source; agents append findings, they do not overwrite others'.

In the real world: A research team of agents shares a findings table with source links; when one agent's unsupported claim was repeated by three others, the rule became 'no source, no entry'.

Visual example

Sharing

More sharing means less repeated work and less isolation.

How much agents share
designagents seestrengthrisk
Nothing sharedOnly their briefSmall contexts; errors containedRepeated work
Shared statePlan, statuses, factsCoordination; visible progressOne bad entry misleads all
Shared memory storeAny finding, by searchBuilds on others' workStale or conflicting entries
Full shared historyEverythingNothing is lostContext explosion

Sharing full conversation histories between agents 'so they have context'. Every agent's context then contains everyone's noise, which removes the main benefit of having several agents.

Conflict resolution and consensus

What it is

When agents disagree, something must decide. The options:

  • Authority: a designated agent, usually the supervisor, decides.
  • Evidence: the claim with a verifiable source wins; unsupported claims are dropped.
  • Voting (consensus): several agents answer independently and the majority is taken.
  • A judge: a separate agent or model weighs the positions against criteria.
  • A person: if the disagreement matters and cannot be settled, escalate.

Why it matters

Disagreement is information: it marks the cases most likely to be wrong.

  • Evidence beats opinion; settle by checking wherever something can be checked.
  • Voting helps only when answers are independent. Agents shown each other's answers tend to converge on the first, right or not.
  • An unresolved conflict silently averaged into the final answer produces a confident statement that nobody verified.

In the real world: Three extraction agents read each invoice independently; when all agree the value is accepted, and when they differ the invoice goes to a clerk. Disagreement turned out to predict errors better than any confidence score.

Letting agents debate until they agree. They agree quickly, and not because the answer improved: models tend to defer. Agreement reached by conversation is weak evidence.

What multi-agent systems cost

What it is

Several agents cost more than one in three ways:

  • Tokens: every agent has its own system prompt and tools, and briefs and reports are extra text. On a short task this overhead multiplies the total.
  • Latency: sequential hand-offs add waiting; parallel workers reduce it.
  • Complexity: more prompts to maintain, more traces to read, more ways to fail.

They can still be cheaper for long tasks, because each worker's context stays short and workers can use a smaller model.

Why it matters

The arithmetic depends on length.

  • A single agent's context grows every step, so a long task becomes expensive quickly.
  • Splitting the same work across fresh, short contexts avoids resending a long history.
  • For short tasks the fixed overhead of extra agents dominates, and one agent wins.
  • Measure for your task; do not assume either way.

In the real world: A report generator moved from one agent to a supervisor with small-model workers; the bill fell by more than half, and the report arrived in a third of the time.

Visual example

Cost

Each context starts at 2,500 tokens and grows by 800 per step. Example prices.

One agent for 16 steps, or a supervisor with 4 workers of 4 steps each
designtotal input tokenscost per taskruns in parallel
One agent, medium model136,000₹38No
Supervisor and workers, all medium70,300₹23.08Yes
Supervisor medium, workers small70,300₹6.15Yes

The single agent pays for one long, growing context. The workers each pay for a short one, and can use a cheaper model.

Quoting 'multi-agent uses more tokens' or 'multi-agent is cheaper' as a rule. Both are true for different task lengths. Work it out, as the table does.

Practise it: Design a Multi-Agent Data Analyst

Interview questions: single-agent and multi-agent systems

What it is

The questions interviewers ask about single-agent and multi-agent systems, from the first screening call to the senior round. Cover the answer, say yours aloud, then compare.

Why it matters

Reading an idea and explaining it are different skills.

  • Each answer below is the two or three sentences an interviewer is listening for.
  • The reasoning behind each one is in the cards above. If an answer surprises you, go back to that card.

In the real world: A design interview proposes 'a team of eight agents'; the interviewer asks which two could be merged without loss, and the candidate who merges five is the one who gets the offer.

Q: When would you use multiple agents?

When work splits into independent strands that can run in parallel, when a side-task would flood the main context, when jobs need genuinely different tools or models, or when an independent check is needed. Not when steps depend closely on each other.

Q: What are the downsides of multi-agent systems?

Information is lost at hand-offs, total tokens and prompts multiply, debugging spans several traces, agents duplicate or contradict each other, and errors cascade. They are harder to evaluate.

Q: What does a supervisor agent do?

Decomposes the task, writes a brief for each worker, collects structured reports, resolves gaps or conflicts, and synthesises the result. It usually has no domain tools, only delegation.

Q: What makes a good delegation brief?

The objective and its purpose, the context already known and what to avoid, the output format, the tools and step limit, and what done means. The worker sees nothing else.

Q: How do agents share information?

By briefs and reports only, by a structured shared state with one owner per field, or by a searchable shared memory. Sharing full histories defeats the purpose of separate contexts.

Q: How do you resolve conflicting agents?

Prefer evidence over opinion, use a designated authority or independent judge, vote only over independent answers, and escalate to a person when it matters. Do not let them talk until they agree.

Q: Is multi-agent more expensive?

On short tasks yes: every agent repeats a system prompt and tool list, and briefs and reports are extra text. On long tasks, short worker contexts and cheaper worker models can beat one long, growing context. Work it out for the task.

Q: How do you allocate tasks among many workers?

Assign centrally, or let workers atomically claim tasks from a shared list so each task has one owner. Never by negotiation between agents.

Proposing multiple agents because it mirrors a human team.

Practise it: Design a Multi-Agent Data Analyst

Exercise: decide one agent or several, with numbers

What it is

A short build that uses this module's ideas. Write it yourself before looking anything up; the checks at the end tell you whether it works.

Why it matters

An idea you have only read fades in a week.

  • Building it once, even in fifty lines, is what makes it yours.
  • Interviewers can tell the difference between someone who has read about a loop and someone who has debugged one.

In the real world: A consultancy runs this comparison for every proposed multi-agent design; about half the time the single agent wins and the proposal is withdrawn.

Your task. Solve one task twice, as a single agent and as a supervisor with workers, and compare cost, time and quality.

Steps

  1. Choose a task with independent strands: 'compare three grocery apps on delivery fee, delivery time and membership price'. Use fake search and fetch tools over canned data.
  2. Build the single agent and record tokens, wall-clock time and whether all nine facts are correct.
  3. Build a supervisor that writes a Brief per app and runs three workers in parallel, each returning a typed Report.
  4. Record the same three measures.
  5. Now deliberately write a vague brief ('research this app') and observe what changes.
  6. Switch the workers to a smaller model and record the cost again.

You are done when

  • You have a table of tokens, time and correctness for the three variants.
  • You can say which design you would ship for this task and why.
  • You have seen a concrete failure caused by a poor brief.

Stretch. Add a critic that checks each worker's report against its sources and measure whether quality rises enough to justify the cost.