By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
A single generalist agent with every tool is the right default: one loop, one prompt, one trace, and fewer places to be wrong. It stops scaling when the tool list becomes a menu the model cannot choose from, or when different work needs different policies - billing needs an approval-gated refund tool, and delivery must never see it.
Two patterns follow. A router picks one specialist for the request. An orchestrator keeps the plan and calls specialists as steps, then combines their results. They are not competing architectures: the router is the cheap, common case, and the orchestrator is what you use when one request genuinely needs several specialists.
Route with the cheapest instrument that meets the accuracy bar. That is usually rules on structured signals - the topic selected in the help widget, the tool the customer already used, the intents a classifier returns - and only then a small model call for the ambiguous remainder. A deterministic first pass is testable, auditable and free; a model-only router adds latency and cost to every ticket, including the obvious ones.
"""A deterministic first-pass router with a confidence floor and fallback."""
ROUTES = {
"refund": {
"queue": "billing",
"tools": ["lookup_order", "queue_for_approval"],
"max_steps": 4,
},
"delivery": {
"queue": "logistics",
"tools": ["lookup_order", "track_shipment"],
"max_steps": 3,
},
"account": {
"queue": "identity",
"tools": ["lookup_account", "reset_password_link"],
"max_steps": 3,
},
}
DEFAULT_ROUTE = {
"queue": "generalist",
"tools": ["lookup_order", "search_docs"],
"max_steps": 6,
}
REQUESTS = [
{
"id": "t-1",
"text": "My refund never arrived",
"scores": {"refund": 0.91, "delivery": 0.22, "account": 0.05},
},
{
"id": "t-2",
"text": "Where is order ORD-4521?",
"scores": {"refund": 0.10, "delivery": 0.88, "account": 0.12},
},
{
"id": "t-3",
"text": "Can you change my login email?",
"scores": {"refund": 0.08, "delivery": 0.11, "account": 0.86},
},
{
"id": "t-4",
"text": "This is urgent, sort it out",
"scores": {"refund": 0.48, "delivery": 0.44, "account": 0.41},
},
]
CONFIDENCE_FLOOR = 0.70
for request in REQUESTS:
best = max(request["scores"], key=request["scores"].get)
score = request["scores"][best]
if score >= CONFIDENCE_FLOOR:
route = ROUTES[best]
reason = f"{best} {score:.2f}"
else:
route = DEFAULT_ROUTE
reason = f"fallback; best is {best} at {score:.2f}"
print(
f"{request['id']}: queue={route['queue']} "
f"max_steps={route['max_steps']} ({reason})"
)The fourth request has no clear winner: the best score is 0.48, below the floor of 0.70. It goes to the generalist with the full step budget, which is the correct failure mode - the specialist routes are built for narrow, high-confidence work. Note that each route carries its own max_steps, so a routing decision is also a budget decision.
Routing is usually discussed as a quality technique. It is also a security boundary. If a request is routed to the delivery worker, the delivery worker's tool list is the complete set of tools that request can reach, and the route table - not the model - decided that. A worker must not be able to re-route itself into a higher-privilege worker, and the routed request must keep the original tenant and approval context.
An orchestrator is a plan with steps. The hard part is not the plan; it is what happens when step three fails. The orchestrator must own the total step, token, cost and wall-clock budget, express the plan as data before executing it, and pass each worker only the slice of context it needs. Workers return structured results, not prose the orchestrator has to parse.
The trace must show the route decision even when it was right. Log the router's inputs, the chosen route, the confidence and the table version; when a ticket is mis-routed, that record is the difference between a one-line fix and a week of speculation.
Key takeaways
Start with one generalist agent; split into routes only when the tool menu or the policy differences demand it.
Route with deterministic rules on structured signals first, and reserve a model call for the ambiguous remainder.
A routing decision is an authority boundary: a worker receives only the tools and budget its route declares.
An orchestrator owns the shared budget, validates the plan as data and decides once when a step fails.
Log the route inputs, choice, confidence and table version; a silent router cannot be improved.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.