Skip to content
JevDirectory.org
OfficialPractices & PatternsVerified 2026-09-20

Pattern: Intent Routing

Classify intent with a Choice and complexity with a Score, then send each branch to deterministic code, a specialist model, or a person, with a 0.5 intent-confidence floor.

Category
Practices & Patterns
Published by
TypeSafe AI
Author
Added
2026-09-20
Tagsofficialpatternsroutingclassificationconfidence

Highlights

  • One request asks Choice intent over order status, product questions, returns, and complaints, plus Score complexity.
  • Intent confidence below 0.5 routes to a human agent.
  • order_status goes to deterministic code with no LLM involved.
  • Complaints escalate when complexity exceeds level 1 or its confidence falls below 0.5.

Quickstart

python
if intent.confidence < 0.5:
    return route_to_human_agent(ticket_id)

if intent.choice == "order_status":
    handle_order_status(ticket_id)

elif intent.choice == "product_question":
    handle_with_llm(ticket_id, PRODUCT_SPECIALIST)

elif intent.choice == "return_exchange":
    handle_with_llm(ticket_id, RETURNS_SPECIALIST)

Watch out

Route on the pair of answer and confidence, not either alone, or confidently-misrouted tickets slip past review.

More like this

Use the answer to decide what to do and confidence to decide whether to act: the voice-banking example routes below 0.6 to a human and needs 0.85 or more to auto-approve a transfer.
Practices & Patterns#official#patterns#confidence
Official
Ask everything the system might need in one request, then let code throw away what it does not use. The ticket-triage example sends a category plus four speculative questions in parallel.
Practices & Patterns#official#patterns#batching
Official
Pick one option from a set you define. Returns the option, the full probability distribution, and 0-1 confidence, with up to 255 options and parallel questions that barely add latency.
Practices & Patterns#official#primitives#choice
Official
Back to all resources

From the community

Posts from builders shipping with Jev right now.

Classifying rows in DuckDB

The launch post