AI engineering / Beginner / 01.26
Multi-agent Context Sharing
When several AI helpers work on one job, what should they pass to each other? A short brief, clear notes and a shared board.
13 min readFree
Passing notes between helpers
The last lesson, Context Isolation, ended with a promise: next, multi-agent context sharing, passing the right notes between helpers. Here it is.
Picture a group project at school. Four people each write one part of a report. If they never talk, you get four reports that do not fit together. If everyone reads everyone else's whole chat history, nobody has time left to write. The sweet spot is a short plan, a few clear notes and one shared folder.
AI products face the same problem. When one job is split between several model-driven helpers, each helper has its own small window of text to work in. What goes into each window decides whether the team works or falls apart. This lesson is only about that: what the helpers share, and how.
The helpers have a name. Wikipedia calls a multi-agent system "a computational system composed of multiple interacting intelligent agents". The AutoGen paper describes building apps with "multiple agents that can converse with each other". The next lessons teach agents themselves. Here we stay on the notes they pass.
Key words
- Agent
- A model-driven helper that works on a task, often by using tools in a loop. Anthropic's post defines agents as "LLMs autonomously using tools in a loop".
- Orchestrator
- The helper that splits a job into parts and hands them out. Anthropic calls it the lead agent.
- Worker
- A helper that takes one part of the job. Anthropic calls these subagents.
- Brief
- A short note that tells every worker the goal, the limits and the shape of the answer.
- Handoff
- The moment one helper passes work to another, together with a note about it.
- Shared board
- One place, such as a file, where every helper writes its result and the orchestrator reads them.
- Structured result
- An answer in a fixed shape, like a form with named boxes, instead of free-flowing text.
By the end you will know what to share, what to leave out, what a good handoff note holds, and you will run a small team of stand-in workers that fills a shared board and catches a clash.
Why sharing is hard
Each helper only sees what is in its own window. It cannot peek at the others. Anything it needs to know has to be put in front of it. The Context Window lesson covered how much fits. Here the question is who gets what.
There are two ways to get it wrong, and they pull in opposite directions.
Sharing too much
The easy move is to hand every helper everything. It feels safe. It is not free. Each token a helper reads costs time and money. The Tokenization lesson in Machine Learning Foundations explains tokens, the small pieces text is cut into.
Anthropic measured how fast this adds up in its research system. In its words, "agents typically use about 4× more tokens than chat interactions, and multi-agent systems use about 15× more tokens than chats." Handing everything to everyone makes that bill bigger still.
There is a second cost. If one helper writes a wrong guess early, and everyone reads it, the wrong guess spreads. Four helpers now build on it. The Context Isolation lesson was about keeping such mistakes in one place.
Anthropic also notes that subagents help by working "in parallel with their own context windows", then condensing "the most important tokens" for the lead agent. The helpers do not carry the full story. They carry the useful part.
Sharing too little
The opposite mistake is a one-line order. Anthropic tried it. Its lead agent gave short instructions like "research the semiconductor shortage›. Those turned out vague enough that helpers misunderstood the task or ran the same searches as each other. In one case, "one subagent explored the 2021 automotive chip crisis while 2 others duplicated work investigating current 2025 supply chains".
Cognition tells a similar story with a toy job: build a Flappy Bird clone. One helper builds the background and one builds the bird. Helper one gets confused and makes a background that looks like a different game. Helper two builds a bird that moves nothing like the real one. In Cognition's words, the final agent is then "left with the undesirable task of combining these two miscommunications›.
Copying the original job text into every helper does not fix it, says Cognition. Real chats run many turns, and the helper that split the work may have used tools to decide how. Small details from that path change what the job means.
Cognition names two principles from this. The first: "Share context, and share full agent traces, not just individual messages›. The second: "Actions carry implicit decisions, and conflicting decisions carry bad results›. An implicit decision is a choice a helper made without writing it down, like the art style of the bird.
So the two posts pull in different directions. Cognition argues for sharing full traces, and recommends against splitting work this way. Anthropic's helpers keep their own windows and pass back short results, and it says some jobs are a poor fit: "some domains that require all agents to share the same context or involve many dependencies between agents are not a good fit for multi-agent systems today". Neither is the only right answer. The job decides. Many tasks that touch the same thing at once need shared detail. Wide look-ups that split cleanly can pass short notes.
Share a lot
Helpers see the full trail. Fewer clashes, but more tokens and spread-out mistakes.
Share a little
Helpers see a brief and one slice. Cheap and tidy, but they may repeat each other or clash.
Share on a board
Helpers keep their own windows but write short, shaped results to one shared place. This lesson's middle path.
Tip
A rule of thumb: the more two helpers touch the same thing, the more they must share. The more they work on separate slices, the less.
What to share, and how
Think of three tools. Each carries a different kind of context.
- 1
The brief
One short note every helper reads first. It says what the whole job is, what the limits are and what shape the answer takes. Because every helper reads the same brief, they start from the same idea of the job.
- 2
The handoff note
A note for the next helper when work moves from one to another. It says what is done and what is left, so nobody starts over.
- 3
The shared board
A shared file or table where every helper writes its answer in the same shape. The orchestrator reads the board instead of reading every helper's chat.
Anthropic describes the board idea. It suggests "artifact systems›: subagents "call tools to store their work in external systems, then pass lightweight references back to the coordinator›. A lightweight reference is just a name or a path that says where the work is saved. Anthropic says this "prevents information loss during multi-stage processing and reduces token overhead from copying large outputs through conversation history›.
The same post calls the problem a "game of telephone›. You know the game: a message passes through many mouths and arrives changed. A structured result written once to a board cannot be retold wrongly. The reader gets the original.
Structured results also help the reader. A form with named boxes is easy to check, easy to merge and easy to compare. A paragraph of free text is not. Anthropic notes the pattern works well for outputs like code, reports and data visualizations, where a helper's specialized prompt gives better results than filtering through a general coordinator.
One more habit from the same post. When a long job nears the end of a helper's window, Anthropic says agents "can spawn fresh subagents with clean contexts while maintaining continuity through careful handoffs›. The handoff is what keeps the thread.
What a good handoff holds
A handoff note is short on purpose. Five things go in it.
- 1
Goal
One sentence on what the job is for. It stops a helper from solving the wrong thing.
- 2
What is done
What has been finished and what was found, so work is not repeated.
- 3
What is left
The parts still open. This is also how you split work so helpers do not overlap.
- 4
Constraints
The limits: what to use, what to avoid, what must stay the same.
- 5
Result format
The exact shape of the answer, such as a list of named fields.
Anthropic found the same list matters when the lead agent hands out work. In its words, "each subagent needs an objective, an output format, guidance on the tools and sources to use, and clear task boundaries". Without that, it says, agents "duplicate work, leave gaps, or fail to find necessary information".
Here is a plain-text handoff note for the delivery job you will see in a moment.
GOAL: Fill in the delivery times for the help page.
DONE: Read the shipping page. Found standard 5 days, express 2 days.
LEFT: Check the FAQ page. Check the returns page.
CONSTRAINTS: Use only the pages in your slice. Whole days only.
RESULT FORMAT: One entry: worker, found, done, left.
OPEN QUESTION: Do not guess a number you cannot see.Read it like a form. Each line has one job. The last line, the open question, tells the helper not to invent a number it cannot see. That one line saves a lot of wrong answers.
A tiny team you can run
Now a worked example in plain Python. An orchestrator writes a brief. Two workers each read only that brief plus their own slice of text. Each writes a structured result to a shared board, which is a dictionary. The orchestrator then merges the board and looks for a clash.
The two workers here are stand-ins. They are a few lines of fixed rules, not AI models. They pull delivery times out of a page with a pattern, the same way every run. That keeps the code free to run and the output the same each time. A real model-driven worker would be slower, would cost money for every token it reads and writes, could give a different answer each run, and could fail or refuse. The stand-ins show how the notes move. They do not show how a real model behaves.
import re
# Stand-ins: the two workers follow a fixed rule. No model is called.
brief = {
"goal": "Fill in the delivery times for the shop's help page",
"constraints": ["use only your own slice", "answer in whole days"],
"result_format": ["worker", "found", "done", "left"],
}
slices = {
"shipping_page": "Standard delivery: 5 days. Express delivery: 2 days.",
"faq_page": "Standard delivery: 3 days. Returns are free.",
}
board = {} # the shared board: one entry per worker
def worker(name, brief, text):
# Reads the brief plus its own slice. Nothing else.
found = {}
for kind, days in re.findall(r"(\w+) delivery: (\d+) days", text):
found[kind.lower()] = int(days)
return {
"worker": name,
"found": found,
"done": "read the " + name,
"left": "nothing" if found else "no delivery times here",
}
for name, text in slices.items():
board[name] = worker(name, brief, text)
print("BOARD")
for name, entry in board.items():
print(name, "->", entry)
def merge(board):
seen, flags = {}, []
for entry in board.values():
for kind, days in entry["found"].items():
seen.setdefault(kind, []).append((entry["worker"], days))
merged = {}
for kind, claims in seen.items():
if len({days for _, days in claims}) > 1:
flags.append(f"CONFLICT on {kind}: {claims}")
else:
merged[kind] = claims[0][1]
return merged, flags
merged, flags = merge(board)
print("MERGED", merged)
print("FLAGS", flags if flags else "none")Output
BOARD
shipping_page -> {'worker': 'shipping_page', 'found': {'standard': 5, 'express': 2}, 'done': 'read the shipping_page', 'left': 'nothing'}
faq_page -> {'worker': 'faq_page', 'found': {'standard': 3}, 'done': 'read the faq_page', 'left': 'nothing'}
MERGED {'express': 2}
FLAGS ["CONFLICT on standard: [('shipping_page', 5), ('faq_page', 3)]"]Walk through the output.
- 1
The brief
It holds the goal, two constraints and the result format. Both workers read it. Neither saw the other's page.
- 2
The board
The shipping page worker wrote standard 5 days and express 2 days. The FAQ page worker wrote standard 3 days. Each entry has the same four named fields: worker, found, done and left.
- 3
The merge
The orchestrator groups every claim by kind. Express has one claim, so it goes through as 2 days.
- 4
The flag
Standard has two claims, 5 and 3. The orchestrator does not pick one. It flags the clash and names which worker said what.
That last step is the point. Because both results had the same shape, a clash was easy to spot with a few lines. If the workers had written long free-text answers, the orchestrator would have needed a model to read and compare them. The structured board did that work for free.
What happens next is up to you. A person can check the pages, or a third worker can look. The flag keeps a wrong number off the help page.
What it saves
Why not share the whole chat anyway? Here is a small sum. All the numbers are made up, only to show the shape. Say the chat so far is 6,000 tokens, the brief plus notes is 300, and four workers each read one of them.
# All numbers are made up, only to show the shape of the sum.
transcript_tokens = 6000 # the whole chat so far
brief_tokens = 300 # a short brief plus handoff notes
workers = 4
share_everything = workers * transcript_tokens
share_notes = workers * brief_tokens
print("share everything:", share_everything, "tokens read")
print("share the brief:", share_notes, "tokens read")
print("times smaller:", share_everything // share_notes)Output
share everything: 24000 tokens read share the brief: 1200 tokens read times smaller: 20
Sharing the full chat means 24,000 tokens read. Sharing the brief means 1,200, which is 20 times smaller. The real ratio will differ, because real chats and notes differ. The direction holds. Every extra token each helper reads is paid for again by every helper.
Tip
Read your brief as if you were a helper who has never seen the job. If you would have to guess, add a line.
Quick check
Quick check
Two workers each found a different number for the same fact. What should the orchestrator do?
Quick check
Why have workers write results to a shared board in a fixed shape?
Quick check
Which line belongs in a handoff note?
The two posts you read about do not agree on how much to share. Your job decides.
Habits to keep
- 1
Write the brief first
Goal, limits and result format, in a few lines every helper reads.
- 2
Give each helper a slice
Its own part of the job, so work does not overlap.
- 3
Ask for a shape
Results as named fields, not paragraphs.
- 4
Use a board
Let helpers write results where the orchestrator reads them, not retell them.
- 5
Check for clashes
Merge in code where you can, and flag a mismatch instead of picking a side.
Passing the right notes is half of the work. The other half is what happens inside a helper's own window when it fills up or gets messy. That is next.
Next: context failure modes, how a full or messy window goes wrong.
Sources
Last updated on 16 November 2026
Learn with me
Every lesson is free. I add new ones as I learn. Have a question, or want help with your own work? Book a short call.