Right agent for the job
You give one agent a giant system prompt: handle refunds, debug installs, reset passwords, answer shipping questions. It works for the easy cases, then a user asks about a failed charge and a login bug in the same breath and the agent gives a confident, half-wrong answer to both. A single generalist holds too many domains in its head at once, so each gets shallow attention and the instructions blur together.
The fix is a roster of specialists plus a router in front of them. Each
specialist owns a narrow domain — billing, support, engineering — and carries only
the prompt and tools that domain needs. The router's whole job is to read an
incoming task and hand it off to exactly one specialist. Describe each
specialist's domain with a few keywords, and routing becomes a match: does this task
touch billing words (charge, refund), support words (password, login), or
engineering words (install, sdk)?
Walk a case. "charge looks wrong on my card" lowercases, then you scan the roster
in order: billing's keyword charge is present, so you stop and route to
billing — the others never get checked. But "do you ship to Canada" touches no
one's keywords. The honest move isn't to force it onto the nearest agent; it's to
fall back to a triage agent that means "I don't know who owns this — figure it
out." Skipping that fallback is the classic bug: an unrelated question silently
lands on billing and gets a nonsense refund answer.
Routing is where multi-agent quality is won or lost. A wrong handoff wastes a whole specialist call and erodes trust; a missing triage fallback turns "unknown" into "wrong." Get the router right and every downstream agent gets clean, in-domain work.
Fill in route: lowercase the task, scan the roster in order, and return the
first specialist whose keywords appear in the task. If none do, return
"triage". Done looks like each task printing <task> -> <specialist>, with the
Canada question landing on triage. The starter sends everything to one agent —
make it actually read the task's domain.
Specialization is leverage: a good router turns a pile of generic agents into a team where every task lands on the desk that can solve it.