Routing
Classify the input first, then send it down the right path.
How it works
- 1Define a small set of mutually-exclusive routes.
- 2Use a classifier step (LLM or rules) to label the incoming input.
- 3Dispatch to the specialized handler for that label.
- 4Keep a default/fallback route for anything that doesn't match.
Use it when
Inputs fall into distinct categories that are each handled best by a different prompt, model, or tool — support tickets, query types, difficulty tiers.
Reach for something else when
Categories overlap heavily or you can't define them crisply — a single flexible prompt may do better.
Where you stay in the loop
You define the categories and their handlers; the agent classifies and dispatches. Watch the low-confidence and fallback cases — that's where misroutes hide, and where your judgment recalibrates the boundaries.
In the wild
A support agent routes "refund" to a billing flow, "bug" to a triage flow, and "how-do-I" to a docs-RAG flow — each with its own tuned prompt.
Hand this to your agent
Set up a routing workflow. First, propose 3–5 mutually exclusive categories for the kind of inputs I'll send, plus a "fallback" category, and a one-line rule for each. Then for every input I give you: (1) state the category and your confidence, (2) handle it using the approach you defined for that category. If confidence is low, use the fallback and ask me one clarifying question. Domain: <describe your inputs>
Replace the <…> placeholders, paste it into your agent, and it'll scaffold the workflow with you.