Velamuvi AIAcademy

Lesson 1 of 6 · Concepts

Why Multiple Agents?

What a multi-agent system is and real reasons to use one: focused contexts, fewer tools per agent, parallel work and separate permissions, plus the costs.

  • 7 min read
  • Advanced
  • Reviewed
In this lesson you will learn
  • Define a multi-agent system and the roles agents play in it
  • Explain the benefits: focused context, fewer tools, parallelism, different models, separated permissions
  • Explain the costs: tokens, coordination, lost information and harder debugging
  • Decide when one agent is enough

One agent, or a team?

So far, most agents in these courses have been one model in a loop with a set of tools. A multi-agent system uses several, each with its own job.

The agents usually run on the same kind of model. What makes them different agents is what each one is given: a role, a prompt, a set of tools and its own conversation history. A “billing agent” is a model call with billing instructions and billing tools, nothing more mysterious.

Why split the work?

There are five good reasons, and they're worth knowing precisely, because “it feels more organised” isn't one of them.

  1. Focused context. Each agent's context holds only what its part of the job needs. A worker that read ten web pages hands back a short summary; the lead never has to carry all ten pages.
  2. Fewer tools per agent. Choosing between 8 tools is easier than choosing between 40. Tool choice gets less reliable as the list grows and descriptions start to overlap.
  3. Parallel work. Independent sub-tasks can run at the same time, so the whole job finishes sooner.
  4. Different models for different jobs. A strong model can lead and plan while smaller, cheaper models do routine searching or extraction.
  5. Separated permissions. The agent that reads untrusted web pages can have no tools that send emails or spend money. If a page contains malicious instructions, there's little it can do.

The first two are easy to measure. Here's the context each model call has to read in a travel-booking agent, built as one agent and as a lead with three specialists:

Try it yourselfPython
# One agent doing everything vs. a lead agent with three specialists.
# What does each model call have to read, and how many tools must it choose between?
TOOL_DEF = 120          # tokens per tool definition
RESULT = 1_500          # tokens per tool result (a web page excerpt, a query result...)

def calls(system, n_tools, n_calls, extra_per_call=RESULT):
    """Input tokens of each call: system prompt + tool definitions + everything gathered so far."""
    fixed = system + n_tools * TOOL_DEF
    return [fixed + k * extra_per_call for k in range(n_calls)]

# Single agent: 24 tools (flights, hotels, visas...), 12 tool calls in one growing context
single = calls(system=800, n_tools=24, n_calls=12)

# Multi-agent: each specialist has 8 tools and makes 4 calls in its OWN fresh context,
# then hands back a 400-token summary. The lead only ever sees the three summaries.
worker = calls(system=400, n_tools=8, n_calls=4)
lead = calls(system=600, n_tools=3, n_calls=4, extra_per_call=400)

print(f"Single agent:  chooses from 24 tools, largest context {max(single):,} tokens")
print(f"Each worker:   chooses from  8 tools, largest context {max(worker):,} tokens")
print(f"Lead agent:    chooses from  3 workers, largest context {max(lead):,} tokens")
print()
print(f"The single agent's last call re-reads {11 * RESULT:,} tokens of old tool results.")

The single agent's context keeps growing because every tool result stays in it, and every call must choose among all 24 tools. Each specialist starts fresh, sees only its 8 tools, and never sees the other specialists' tool results.

What it costs

The other costs:

  • Coordination overhead: briefs, results, checks and synthesis are all extra model calls and extra code.
  • Lost information: every summary passed between agents drops details, like a game of telephone.
  • Inconsistent decisions: two agents working without each other's context can make choices that clash, such as two sub-agents writing code in different styles.
  • Harder debugging: when the answer is wrong, you have to trace which agent, which message and which tool result caused it.

When one agent is enough

Start with one agent, and split only when you can name the reason from the list above. Signs you might need more than one:

  • The work divides into independent parts (research on separate topics, checks on separate documents).
  • One agent's context fills up with tool results it no longer needs.
  • The tool list is long and the agent keeps choosing the wrong one.
  • Some parts need different permissions or a different model.

Signs you don't: the steps depend tightly on each other, every part needs the full context, or one agent with a good prompt already works.

Common mistakes

Practice exercise

Work out how many input tokens one worker agent uses, because every call re-sends everything gathered so far.

Your solutionPython
fixed = 1_360        # system prompt + tool definitions, sent on every call
result = 1_500       # tokens each tool result adds to the context
n_calls = 4

# Call 1 reads just the fixed part; every later call also re-reads all earlier results.
# Add up the input tokens of all the calls and print:  Total input tokens: <number>
Knowledge check

Which is the strongest reason to give web-browsing to a separate agent with no other tools?

Summary

  • A multi-agent system splits a task across agents, each with its own instructions, tools and context.
  • Good reasons: focused context, fewer tools per agent, parallel work, different models and separated permissions.
  • Costs: more tokens overall, coordination, lost information, inconsistent decisions and harder debugging.
  • Start with one agent; split along independent parts when you can name the reason.

Next: orchestrator and workers, the most common multi-agent design.

Finished reading? Tick it off to track your progress.