Skip to content
All posts

Using AI to classify and route inbound requests: tickets, leads and emails

How to build AI classification and routing for support tickets, sales leads or shared inboxes: designing categories, handling low confidence, measuring accuracy and keeping people in charge of edge cases.

Shubham Somani 3 min read

Every growing company has an inbox that someone sorts by hand. Support tickets go to the right team, leads go to the right salesperson, invoices go to finance, and the urgent ones go to the top. It’s repetitive, it’s easy to get slightly wrong, and it slows everything behind it.

Classifying and routing inbound requests is one of the most dependable first AI features. The output is small, easy to check and easy to correct. Here’s how we’d build it.

Design the categories first

Most classification problems are really category problems.

  • Start from how work is actually handled, not from an ideal taxonomy. If two categories always go to the same team, they may not need to be separate.
  • Write a one-line definition and a few examples for each category. If your team can’t agree on them, the model won’t either.
  • Keep the list short. Fewer, clearer categories are easier to get right than a long list of near-duplicates.
  • Include “other” or “unsure”, so the model isn’t forced to pick a wrong answer.

Labels that matter beyond the category, such as urgency, language or customer tier, can be separate fields rather than more categories.

Ask for structured output with a reason

  • Return the category as a fixed value from your list, plus any extra fields, in a structure your code validates. See getting reliable JSON from an LLM.
  • Ask for a short reason, such as the phrase in the email that led to the choice. It helps reviewers and makes mistakes easier to understand.
  • Use your own data for facts. Customer tier, contract status or account owner should come from your database, not the model’s guess.

Handle low confidence on purpose

Not every request is clear, and pretending otherwise is how misrouting happens.

  • Route “unsure” to a person or a general queue rather than guessing.
  • Use simple signals of doubt, such as the model choosing “other”, giving a weak reason, or disagreeing with itself when asked twice on borderline cases, and test which ones actually predict errors for your data.
  • Flag sensitive requests for a person no matter how confident the model is: legal threats, security reports, cancellations from large customers.

Start with suggestions, then automate

  1. Suggest the category in your existing tool and let your team accept or change it.
  2. Measure how often they agree, per category, on real traffic.
  3. Automate the categories that hold up, and keep suggesting for the rest.
  4. Keep it easy to re-route, so a wrong decision costs seconds, not a lost customer.

This is the same staged approach we describe in rolling out AI features safely.

Measure what matters

  • Accuracy per category, not just overall. A good average can hide a category that’s often wrong.
  • Time to first response or time to the right owner, before and after.
  • Re-routes: how often a request has to be moved after the AI routed it.
  • Corrections as test cases. Every fix your team makes is a labelled example for your test set. See test your LLM feature before users do.

Keep it cheap and fast

Classification is usually a short input and a tiny output, which makes it a good candidate for a smaller model. Test that against the same labelled examples before switching. Our post on choosing an LLM for your product walks through the comparison.

The short checklist

  • Short, clearly defined categories with examples and an “unsure” option
  • Structured output with a reason, validated in code
  • Facts from your database, not the model
  • Low-confidence and sensitive requests go to a person
  • Suggest first, automate categories that prove reliable
  • Track accuracy per category and turn corrections into tests

If your team spends hours sorting an inbox or a ticket queue, see our fixed-scope offers or book a 30-minute call.