scalable/ai/agentic patterns/lesson 05 cph / /
lesson 05 / 07 · 14 min · updated ·

handoffs — multi-agent composition

how one agent passes control to another with just enough context. most 'the agent got confused' bugs live here.

the most undervalued primitive

a handoff is how one agent passes control to another. it's the pattern that makes multi-agent systems possible and, if done badly, the pattern that makes them unreliable. most "the agent got confused" bugs in production are bad handoffs in disguise — too much context leaking through, not enough context handed over, or transfers that happen silently without the next agent understanding why.

the rule, always: a handoff is explicit and typed. no shared blackboards. no "just read the history." if the receiving agent needs to know something, the handing-off agent puts it in the payload.

triage hands off — runnable

triage classifies and returns a handoff — inspect the payload
ready

four things this gets right on purpose:

payloads: the contract between agents

three payload designs, from worst to best
ready

the payload is everything. too much and the receiving agent gets distracted by irrelevant history and repeats work. too little and it asks the user questions triage already asked. the right amount is surprisingly small: ids, the intent, and a 1–2 sentence summary of anything that matters. treat the payload like an api contract, because that's what it is.

a heuristic for payload design. imagine the target agent is a new hire on their first day. what's the minimum they need to start doing the job? that's the payload. what would you not dump in their lap on day one? that's what you leave out. every ambiguous handoff bug i've debugged in production resolved to "we sent too much or too little, never the right amount."

when it breaks

next: loops — the control flow inside a single agent turn. when to iterate, when to stop, and how to avoid the runaway budget.

scalable labs·cvr 30091604·github·linkedin·hello@scalable.dk