Production AI Institute — vendor-neutral certification for AI practitioners
Verify a credentialFor organisationsContact
Pattern LibraryCore Patterns
Part 1: Core PatternsPSF D1 · Input GovernancePSF D5 · Deployment SafetyPAI-8 C1 · AI Governance PolicyPAI-8 C7 · Incident Management

Routing

A classifier that directs each input to the most appropriate specialist agent or pipeline.

Routing is the pattern that makes complex agent systems manageable. Instead of one general-purpose agent attempting to handle every type of input, a router classifies the input first and forwards it to the specialist best equipped to handle it — with the appropriate tools, permissions, and safety controls for that input type.

A routing agent sits at the entry point of the system. It reads each incoming request, classifies it against a taxonomy of known task types, and forwards it to the designated downstream agent or pipeline. The router may use a classifier model, keyword matching, or a rules engine — the choice depends on the complexity and risk level of the misclassification. Critically, the router must define explicit handling for inputs that don't match any known category: route to a catch-all agent, escalate to a human, or reject with a clear message. The router also enforces scope: it prevents inputs intended for one pipeline from accidentally reaching another with different permissions.

In practice

A large insurer deploys a routing layer in front of its customer service agent system. Incoming queries are classified into: claims status, policy amendments, billing disputes, general enquiries, and complaints. Each category routes to a specialist agent with different access permissions and different escalation thresholds. A 'complaint' classification routes to an agent with a mandatory human escalation after 2 exchanges — a rule that would be inappropriate for general enquiries. The router logs every classification decision for compliance audit.

Why it matters

Without routing, you either build one agent that tries to do everything (complex, fragile, hard to audit) or expose users directly to specialist agents and hope they navigate correctly (they don't). Routing is the architectural equivalent of a triage system: it ensures the right resource handles the right problem, with the right level of oversight.

Framework alignment

PSF Domains
D1
Input Governance
View PSF domain →
D5
Deployment Safety
View PSF domain →
PAI-8 Controls
C1
AI Governance Policy
View PAI-8 standard →
C7
Incident Management
View PAI-8 standard →

Production failure modes

How this pattern fails in practice — and what to watch for.

Misclassification with high confidence

The classifier routes a sensitive query (e.g. a complaint about discrimination) to a general enquiry agent because it's stated conversationally. The specialist complaint agent with mandatory human escalation is never triggered. The system responds inappropriately and the incident goes unlogged.

Coverage gaps

A query type not present in the classifier's training data defaults to a catch-all agent that isn't equipped to handle it. The user receives an unhelpful response, and the routing gap is never flagged because the catch-all agent completes without error.

Route distribution drift

Over months, the volume of queries hitting one route grows significantly while another route shrinks. Capacity is still allocated based on original assumptions. The high-volume route becomes a bottleneck; the low-volume route wastes resources.

Implementation checklist

Seven things to verify before deploying this pattern in production.

1

Define an explicit fallback route for inputs that match no known category

2

Set confidence thresholds below which routing escalates to human review

3

Log every routing decision with the classification, confidence score, and routing destination

4

Test the classifier with edge cases and adversarial inputs monthly

5

Monitor route distribution for drift and alert when distribution shifts >20% from baseline

6

Define what happens when the destination agent is unavailable

7

Document the scope and exclusions of each route explicitly

Certification relevance

AIDA covers routing as a core D1 pattern — the exam focuses on the governance of the classification decision, particularly what happens at the boundaries between routes. CAIG candidates are assessed on how routing decisions are documented and audited. CAIAUD auditors look for evidence that misclassification risk is measured and that coverage gaps are systematically identified.

AIDA — Take the exam →CAIG — Take the exam →CAIAUD — Take the exam →

Related patterns

Part 1 · Core Patterns
Orchestration
A controlling agent that directs sub-agents, manages state, and decides when a task is complete.
Part 1 · Core Patterns
Multi-Agent Collaboration
Specialised agents working together, each owning a domain of the overall task.
Part 2 · Production Patterns
Exception Recovery
How agents detect failure and decide whether to retry, escalate, skip, or fail gracefully.
Production AI Institute

Certify your understanding of production AI patterns

The AIDA certification covers all 21 agentic design patterns with a focus on deployment safety, governance, and the PSF. Free to attempt.

Start AIDA — Free →All 21 patterns