8.1 KiB
theme, title, info, author, transition, mdc, lineNumbers, monaco, aspectRatio, canvasWidth, layout, class
| theme | title | info | author | transition | mdc | lineNumbers | monaco | aspectRatio | canvasWidth | layout | class |
|---|---|---|---|---|---|---|---|---|---|---|---|
| seriph | Lesson 39 — When Should Agents Share the Same Context? | English video course for AI Agents in Depth | Bojie Li | slide-left | true | false | false | 16/9 | 980 | cover | cover |
When Should Agents Share the Same Context?
Shared trajectories, isolated contexts, role switching, and handoffs
Problems this chapter will solve
Lesson 39
When Should Agents Share the Same Context?
Lesson 40
Who Should Coordinate Independent Agents?
Lesson 41
When Is Multi-Agent Actually Better Than One Agent?
Lesson 42
How Do Agent Teams Fail—and What Should We Build Next?
Why this problem matters
Continuity
Shared history preserves details and user decisions.
Isolation
Separate contexts reduce interference and permission leakage.
Scale
Independent contexts enable parallel work beyond one window.
Three ideas to keep in view
Shared context
New prompt/tools, same complete trajectory
Non-shared context
Independent trajectory + explicit communication
IPC analogy
Files as shared memory; calls/messages as message passing
The book's visual model
Shared context vs. Non-shared context
Shared context
- Near-zero handoff loss
- Mostly serial roles
- History grows and biases
Non-shared context
- Modular and parallel
- Selective disclosure
- Handoff can omit evidence
A role is prompt + tools + visible state
stage = router.choose(task_state)
agent = Agent(prompt=stage.prompt, tools=stage.tools)
if stage.shared:
agent.resume(full_trajectory)
else: agent.start(handoff_package)
Test the claim
Inspect staged prompts, tools, and fallback gates
Observe: Requirements, implementation, review, and revision boundaries
Inspect role-specific handoff capabilities
Observe: Distinct prompts, tools, transfer edges, and shared session state
class: course-terminal
Switching to the terminal
$ cd chapter10/staged-system-prompt && python demo.py --list-stages
$ cd chapter10/multi-role-transfer && python demo.py --list-roles
What the evidence supports
Finding 1
Changing prompt and tools can create a specialist while preserving one trajectory.
Finding 2
Shared context removes handoff compression but can carry framing bias across roles.
Finding 3
Independent Agents require an explicit data plane and control plane.