Skip to main content

Layered Classifier

Blueprint · ← Route table · Classifier · Wire agentic app →

Do not send every message to one LLM with the full route table. Use a short pipeline: cheap layers first, capable layers only when needed, safety on every path.

THE CLAIM

Eligible routes first, then rules, then classifier, then LLM fallback, then safety. Keep Layer ③ rare.

Pipeline

Layer reference

LayerJobClarification
Eligible routesPrune table by ingress claimsNo payment_initiate if user lacks payment role
① RulesCommands, channel, session stickiness"yes", "$500" stay on active route
② ClassifierSmall model / kNN on your golden setTarget most traffic in <50ms
③ LLM fallbackStructured JSON, fixed route_id listTop 3 + user pick for ambiguous or high-risk only
④ SafetyInjection, PII, vetoInput plane: 100% adversarial pass

Outcomes

OutcomeTypical action
Routeconfidence ≥ threshold → hand off to agentic app
Clarifymissing entities or mid confidence → question or top-k pick
Abstainlow confidence or OOD → safe refusal or human handoff

Tune thresholds per route risk. Details: How to Design an Intent Router (Step 3).

Trace fields

intent_label, route_id, confidence, router_layer, eligible_routes, safety_flags, outcome, latency_ms, route_table_version

Wire agentic app →