← Table of Contents · Page 442 of 868
WHY USE MORE THAN ONE AGENT
Part 3 of 9
CONTEXT ISOLATION AS A BENEFIT OF SPLITTING WORK
Now we come to what many engineers consider the single strongest reason to use multiple agents.
Recall from Part Five that the context window is the agent's working memory, and that it is a scarce resource.
You also learned about context rot and context bloat in Chapter 19: when the window fills with too much stuff, the model pays less attention to the important parts and makes more mistakes.
Context isolation means giving each agent its own separate context window, so that the messy details of one subtask never pollute the thinking space of another.
Think about a detective investigating a case.
The detective spends days reading hundreds of pages of witness statements, receipts, and phone logs.
When it is time to brief the jury, the detective does not read all those pages aloud.
The detective gives a clean, short summary of what matters.
The jury never has to wade through the clutter.
In the same way, a researcher agent might perform thirty web searches and read dozens of long pages.
Its context window fills up with raw, noisy material.
The writer agent never sees any of that.
The writer receives only a tidy, structured summary of the findings, perhaps a list of key claims, each with its source.
As a result, the writer's context stays small and focused, and it can concentrate on producing excellent prose.
Context isolation gives you three practical advantages.
First, quality: a small, relevant context leads to better attention and fewer mistakes.
Second, cost: smaller contexts mean fewer tokens read, which often means lower bills.
Third, safety: if the researcher reads a web page containing a hidden malicious instruction (the prompt injection attack from Chapter 38), the damage is more likely to stay inside the researcher, rather than infecting the agent that has powerful tools like sending messages.
Note the word "likely." Isolation reduces risk, but it does not eliminate it, because the summary that crosses between agents can itself carry bad content if you are not careful.
This is why handoffs between agents should be treated as untrusted input that is checked, a point we return to in Chapter 44.
Advertisement
Read Aloud:
0:00 / 0:00