Ticket Classification

Auto-route tickets via _predict on description. Confidence-tiered — high auto-routes, mid suggests, low routes to manual.

Ticket Classification: screenshot from the Grocery demo
🛍 Grocery_predictCross-vertical
In the demoConfidence-tiered routing: high auto-routes, mid suggests, low routes to manual. In the agent demo's banking77 benchmark (616 queries), one Aito prediction took about 70 ms at the median against 1.9 s for one gpt-5-mini call, so a 6-step LLM chain projects to about 11 s.

The problem

Support ticket routing is the day-one productivity hit for any SaaS team. Tickets land in a single inbox; someone has to read them, decide which team owns them, mark the priority, tag the topic, and route to the right responder. On a busy product, that triage role consumes hours of senior engineer time per day — and the cost of a misrouting (a P1 stuck in the wrong queue overnight) is the kind of thing that turns up in postmortems.

The decision is regular. The same kind of ticket from the same kind of customer routes to the same team most of the time. Title, description, customer segment, product area, priority — all available, all correlated with the routing decision. The data already contains the answer for the next ticket; the team is just reading it manually.

How it works

A single _predict on the tickets table predicts the team, the priority, and the tag from the available fields (title, description, customer, product area). Confidence-tiered: above 95%, auto-route. Between 50% and 95%, pre-route to the suggested team and surface the alternatives. Below 50%, leave for manual triage.

The system updates from corrections. When a manual triage moves a ticket from "wrongly auto-routed to Team A" to "correct team B," the override enters the index immediately and the next similar ticket reflects the correction. No retraining schedule; just normal data flow. Tilisi's deployment runs this pattern in Freshdesk and recovered 4 hours per week of CEO time by eliminating manual routing rules.

{
  "from": "tickets",
  "where": {
    "title": "App crashes on iOS 17",
    "description": "Customer reports white screen after login",
    "customer.segment": "enterprise"
  },
  "predict": ["team", "priority", "tag"],
  "select": ["$p", "$why"],
  "limit": 1
}

For the full architecture, see the technology overview. For the broader narrative across multiple use cases, read The Predictive Application.

See it live

This use case runs in the 🛍 Grocery demo today. Click through to the live application and inspect the queries that produce the result.

Open the live demo →

Build it with Claude Code

Paste this prompt into Claude Code, or another coding agent, in your own codebase. It runs Aito locally from the Docker image, reads the API docs written for agents, and follows a working reference implementation.

Ticket triage: a prompt for Claude Code
Add ticket triage to this codebase using Aito, a predictive database. The feature: classify each incoming support ticket (category, team, priority) from our resolved tickets.

1. Run Aito locally: `docker pull ghcr.io/aitohq/aito`, then follow https://aito.ai/docker/ to start it with your own API keys (keep them in the environment, never in code).
2. Read https://aito.ai/docs/api/llms.txt for the v2 query shapes before writing any query.
3. Read the use-case guide: https://aito.ai/docs/api/v2/use-cases/support-triage/
4. Use this reference implementation as the pattern (schema, data load and queries): https://github.com/AitoDotAI/aito-agent-demo/blob/main/scripts/support_fixture/schema.json and https://github.com/AitoDotAI/aito-agent-demo/blob/main/src/aito_client.py
5. Find the matching tables in this codebase, design the Aito schema for them (links between tables where we have foreign keys), and load a sample.
6. Measure before wiring the UI: hold out recent rows, run the predictions, and report accuracy against the current behaviour.
7. In the UI, show the confidence ($p) and the reasons ($why). Fill in automatically only above a threshold I choose; below it, suggest.

Ask me before changing anything outside the new feature.

Frequently asked

How does this compare to keyword-rule-based ticket routing?

Keyword rules ("if title contains 'login', route to Auth team") work on the easy cases and miss the rest. The same description rephrased ("user can't get in", "session won't start", "auth flow broken") confuses keyword rules, but the predictive system reads them as the same intent through the underlying word distributions. The two are complementary: rules for clear cases, predictive for the long tail.

What if our ticket volume is low — around 100 a month?

The conditional probability machinery is data-density-sensitive but not data-volume-sensitive in the obvious way. At 100 tickets/month, after 3 months you have ~300 tickets — enough for the most common routing patterns to converge. New ticket types still take 3-5 observations to reach auto-route confidence; below that the system stays in suggest-mode. Low-volume teams get less auto-routing but the same accuracy on what they do auto-route.

Can the system handle multi-language tickets?

Yes, in two senses. First, the predictive operators work on whatever language the data is in — Aito does not require translation. Second, predictions are independent per language; a ticket in Finnish routes based on Finnish-language patterns, a ticket in English on English-language patterns. If your team handles multiple languages, the system learns the routing pattern per language automatically.

How do we handle tickets that span multiple teams?

The prediction returns top-N teams with calibrated confidences. If two teams are close (50% / 40%), the ticket can be flagged as "needs multi-team triage" with both surfaced. The application can route to a triage queue, ping both teams, or default to one with the other CC'd — application-level decision, not a prediction problem.

Does this integrate with Zendesk, Freshdesk, or Intercom?

Yes. Aito returns the prediction as JSON; any RPA tool, webhook, or direct integration with the ticketing platform can act on the prediction. Tilisi runs ticket routing on a Freshdesk + Aito stack; other deployments use UiPath as the orchestration layer.

How does this compare to letting an LLM agent do the triage?

An LLM agent can triage a ticket, but it chains calls sequentially. In the banking77 benchmark behind agent.aito.ai, one gpt-5-mini call takes 1.9 seconds at the median, so a 6-step resolution projects to about 11 seconds, with per-token cost at every step. One Aito prediction took about 70 ms at the median on the same 616 queries, more than ten times faster than a single LLM call, with a calibrated confidence per field. The composition still holds: let the predictive layer handle the routine volume and escalate the low-confidence remainder to the LLM or a human.