Multi-agent · Free preview

Handing Off

Triage routes to a specialist

A handoff is when one agent recognizes a request belongs to another's expertise and transfers control — passing the original request along so the specialist can take over mid-conversation.

Triage routes to a specialist

One agent rarely does everything well. A common multi-agent shape is a triage agent at the front door: it reads the request, decides whose job it is, and hands off — transferring control and the original request to the right specialist instead of answering badly itself. The handoff isn't a summary or a new conversation; the specialist inherits the exact text the user sent and continues from there.

The decision triage makes is intent routing: a cheap classification step that maps a request to the domain that owns it — billing, tech, sales — by what the request is actually about. Get routing right and each specialist only ever sees work it's good at. Get it wrong and you either drop requests on the floor or pile everything onto one overloaded agent.

Watch the triage agent recognize a refund request, transfer it to the billing specialist, and let that specialist carry the conversation forward.

Now build the mechanism yourself. Three tasks come in. Implement route(task) so it inspects the keywords in each task and returns the right specialist — refund/invoice to billing, crash/app to tech, upgrade/plan to sales — then watch the handoff chain print one line per task and a final count of how many distinct specialists the work fanned out to. The starter hands everything to billing on purpose; that's the routing you have to replace.

The failure that bites in production is the request that matches nothing — "how do I export my data?" hits no keyword. A naive classifier still has to return something, so it forces a guess and quietly hands a tech question to billing. A good triage agent treats no-match as a real outcome: it keeps the task itself (the fallback specialist is triage) rather than confidently misrouting. The same rule covers overlap — when a task could fit two domains, decide the priority order up front instead of letting whichever keyword you happened to check first silently win.

A handoff is only as good as the routing behind it. Classify the intent first, thread the original request through, and each specialist gets exactly the work it owns.

In the full academy, you watch a real agent run this — live:

🔒 Live code execution, real agent runs, mastery tracking and verifiable credentials unlock with the full academy.

This is 1 of 50 lessons.

The full academy: write real code, watch real agents run, and earn verifiable credentials — across 8 tracks, in a 3D campus.

Unlock the full academy — $100 →

14-day refund · 🔒 Stripe-secured checkout · lifetime access

More free lessons: An LLM Is a Function  ·  The Agent Loop  ·  Define a Tool  ·  Give an Agent a Tool  ·  Durable State

← The Agent Marketplace