Intent Routing at Scale: The Production Architecture That Replaces a Naive Prompt
Agent systems that route user requests to dozens or hundreds of backend skills are becoming the default architecture for enterprise copilots. The naive prompt approach burns budget and silently routes errors; the layered routing pattern described here is the difference between a hackathon demo and a system that survives contact with real users.
The demo approach to agent intent recognition — stuffing all intent descriptions into a single prompt — collapses under real-world loads. Token costs explode linearly with intent count, accuracy degrades as similar intents blur together, and a single misclassification gets routed straight into the wrong agent with no safety net.
A production-grade design replaces that flat prompt with a three-layer pipeline. Deterministic rules catch obvious requests for free. Embedding-based semantic recall narrows hundreds of intents to a top-5 candidate set, slashing the prompt size the LLM must process. The LLM then fine-ranks only those candidates and returns a confidence score. When confidence is low, the system does not guess — it asks the user to clarify, preventing silent misroutes.
Beyond the routing logic itself, a maintainable system needs full traceability of every decision, an observability dashboard tracking latency, token burn, and clarify rates, an offline evaluation loop built from sampled production traces, and a golden benchmark dataset that gates every prompt or model change with a regression test.
Most agent intent-recognition advice stops at the prompt, but the real engineering is in the routing architecture that sits in front of the LLM — rule matching and embedding recall do the heavy lifting so the model only sees a handful of candidates.
The clarify step is under-discussed. Refusing to guess on low-confidence classifications and instead asking the user turns a silent failure mode into a recoverable interaction, which is essential for any agent that triggers side effects.
Observability for LLM pipelines is still immature. The metrics proposed here — clarify rate, token burn per request, embedding vs. LLM latency split — are a practical starting point that most agent frameworks do not yet expose natively.
Treating intent routing as a continuous-evaluation problem rather than a one-time prompt-engineering task is the dividing line between a prototype and a system that can be safely iterated on by a team.