COCO How-to Guide

Build an AI Ticket Classifier: Open Source, Self-Hosted, Zero Vendor Lock-in

Every support team wastes hours manually triaging tickets into the right buckets. An AI ticket classifier solves this — but most SaaS options charge per ticket and lock your data into their cloud. This guide shows you how to build your own AI ticket classifier using Zylos, the open source agent framework, with full data sovereignty, fixed hosting costs, and multi-channel routing via HxA Connect.

TL;DR

What is an AI ticket classifier?

An AI ticket classifier is a system that automatically reads incoming support tickets and determines what they're about, how urgent they are, and who should handle them — without a human reading every one. Under the hood, it's an LLM-powered agent that performs multi-dimensional classification: category (bug, feature request, account issue, billing question), priority (critical, high, medium, low), sentiment (frustrated, neutral, positive), affected component (login, payments, dashboard, API), and recommended assignee (the team or individual best equipped to resolve it).

Unlike keyword-based rules ("if ticket contains 'password' → route to IT"), a modern automatic ticket classifier understands context. The same word "freeze" means something completely different in a banking ticket ("account freeze") vs a SaaS ticket ("dashboard freeze"). LLM-based classification handles this ambiguity because it reads the full ticket description, not just pattern-matches keywords.

The state of the art in 2026 is a layered architecture: a fast rules engine handles obvious cases (zero LLM cost), an embedding-based model catches the middle tier, and the LLM only fires for the ~15% of tickets that are genuinely ambiguous. This hybrid approach delivers 90%+ classification accuracy while keeping per-ticket AI costs near zero.

📩 Incoming Ticket Rule Engine Keyword / Pattern Match ~60% auto Embedding Model TF-IDF / E5-small ~25% auto LLM Agent (Zylos) Reads full context & classifies ~15% LLM Auto-Routed Human Review Only the hardest ~15% of tickets reach the LLM. 90%+ accuracy at 1/50th the cost of all-LLM routing.
Layered AI ticket classifier architecture: rules → embeddings → LLM. Only the hardest 15% of tickets hit the LLM.

Build vs buy: why self-host your AI ticket classifier

The market for AI ticket classification tools is crowded — Zendesk Intelligent Triage, Intercom Fin, Forethought, and Twig all promise to classify and route tickets. But every SaaS option comes with the same three trade-offs:

  1. Per-ticket pricing adds up fast. At $0.99–$5 per classified ticket, a team handling 5,000 tickets/month pays $4,950–$25,000/month — before their helpdesk subscription. A self-hosted AI ticket classifier on a $40/month VPS handles the same volume at fixed cost.
  2. Your ticket data trains their models. Every SaaS classifier improves by learning from your support data. Your team's institutional knowledge becomes part of their product — and you can't take it with you if you switch vendors.
  3. Integration is limited to what they support. Most SaaS classifiers integrate with Zendesk, Freshdesk, and maybe Jira. If your team uses Lark, Telegram, Linear, or a custom internal tool, you're out of luck — or paying for a custom integration.

Building your own AI ticket classifier with Zylos flips all three: fixed hosting cost regardless of volume, full ownership of your classification logic and training data, and native multi-channel routing to any system via HxA Connect's 10+ adapters.

How to build an AI ticket classifier with Zylos

Zylos is an open source autonomous AI agent framework with persistent memory, multi-channel communication, and extensible skills. It's the engine that powers the classifier. Here's how to build your AI ticket classifier in four steps.

1
Set Up Zylos
Clone, install, configure LLM credentials, verify agent is running
2
Define Schema
Build classification taxonomy with categories, priorities, routing rules
3
Connect Channels
Wire ticket sources + configure HxA Connect adapters for routing
4
Deploy & Iterate
Docker/PM2 deployment, accuracy monitoring, feedback loop tuning

Step 1: Set up the Zylos agent framework

Start by cloning the Zylos Core repository and installing dependencies. You'll need Node.js ≥ 18 and an API key from your preferred LLM provider (OpenAI, Anthropic, Gemini, or a local model via Ollama).

# Clone and install
git clone https://github.com/coco-xyz/coco-core.git
cd zylos-core
npm install

# Configure environment
cp .env.example .env
# Edit .env: set LLM_API_KEY, LLM_MODEL (gpt-4o / claude-sonnet-4-6 / gemini-2.5-pro)

# Start the agent
npm start
# Agent running on http://localhost:3456

Verify the agent is alive by sending a test message. If it responds, you're ready to teach it classification.

Step 2: Define your ticket classification schema

The classification schema is the taxonomy your AI ticket classifier uses to label every ticket. Define it once, and the agent applies it consistently. Here's a production-ready schema you can adapt:

{
  "classification_schema": {
    "categories": [
      "bug_report",
      "feature_request",
      "account_issue",
      "billing_question",
      "integration_help",
      "performance_degradation",
      "security_incident",
      "general_inquiry"
    ],
    "priorities": ["critical", "high", "medium", "low"],
    "routing": {
      "bug_report":        { "target": "github-issue",  "repo": "org/support-tracker" },
      "security_incident": { "target": "telegram",      "channel": "@sec-alerts" },
      "billing_question":  { "target": "slack",         "channel": "#billing-triage" },
      "feature_request":   { "target": "linear",        "team": "product" },
      "account_issue":     { "target": "lark",          "group": "account-ops" },
      "default":           { "target": "hxa-connect",   "thread": "support-inbox" }
    },
    "confidence_threshold": 0.85
  }
}

The confidence_threshold is critical: tickets classified below 85% confidence get flagged for human review instead of auto-routed. This prevents misroutes on ambiguous tickets while still automating the majority.

Step 3: Connect ticket sources and route to channels

Now wire up where tickets come from and where they go to. HxA Connect — COCO's bot-to-bot messaging server — handles the multi-channel routing so your AI ticket classifier can send classified tickets to any platform.

// In the Zylos agent's skill configuration:
import { HxaConnectClient } from '@coco-xyz/hxa-connect-sdk';

const router = new HxaConnectClient({
  url: 'https://your-hxa-server.com',
  token: process.env.HXA_BOT_TOKEN,
  orgId: process.env.HXA_ORG_ID,
});

// Register ticket intake sources
agent.on('ticket.received', async (ticket) => {
  // 1. Classify
  const classification = await agent.classify(ticket, schema);

  // 2. Route based on classification
  if (classification.confidence >= schema.confidence_threshold) {
    await router.send(classification.target, formatTicket(ticket, classification));
    console.log(`Routed ticket #${ticket.id} → ${classification.category}`);
  } else {
    await router.send('human-review-queue', formatTicket(ticket, classification));
    console.log(`Flagged ticket #${ticket.id} for human review (confidence: ${classification.confidence})`);
  }
});

HxA Connect supports GitHub Issues, GitLab, Lark, Telegram, Slack, Email, Jira, Linear, and custom webhooks out of the box. One integration layer, every destination covered.

Pro tip: Start with one channel, then expand

This progressive rollout means your team builds trust in the AI ticket classifier before it touches production routing.

Step 4: Deploy, monitor, and iterate

Deploy your AI ticket classifier with Docker for the simplest production setup:

# Build and run with Docker
docker build -t ticket-classifier .
docker run -d -p 3456:3456 \\
  -v $(pwd)/data:/app/data \\
  -e LLM_API_KEY=$LLM_API_KEY \\
  -e HXA_BOT_TOKEN=$HXA_BOT_TOKEN \\
  ticket-classifier

Monitor classification accuracy through the Zylos agent dashboard. The most important metric is acceptance rate: what percentage of auto-classifications does the assigned team accept without correcting? A healthy system reaches 85%+ within the first week and 92%+ after a month of feedback-loop tuning.

AI ticket classifier comparison: Build vs SaaS

Dimension Build (Zylos + HxA Connect) Buy (SaaS Classifier)
Cost at 5,000 tickets/month ~$40/month (VPS hosting) $4,950–$25,000/month
Data sovereignty Full — data stays on your infrastructure Vendor-dependent — tickets processed in their cloud
Integration breadth 10+ channels via HxA Connect adapters + custom webhooks Limited to vendor-supported integrations (usually 3–5)
Customization Full control over schema, routing rules, confidence thresholds Limited to vendor's configuration UI
Setup time 2 hours to PoC; 3–5 days to production 30 minutes to connect; 1–2 days to tune
Model choice Any LLM: GPT-4o, Claude, Gemini, or local (Ollama) Vendor's model only
Compliance (SOC2, HIPAA, GDPR) You control the infra — compliance is your responsibility Vendor provides compliance (check their certifications)
Lock-in risk None — MIT-licensed, fully portable High — switching means re-training on a new system
When to buy instead: If your team has zero engineering capacity and handles under 1,000 tickets/month, a SaaS AI ticket classifier like Zendesk Intelligent Triage may be the pragmatic choice. The per-ticket cost at low volume is manageable, and you avoid the operational overhead of self-hosting. But as volume grows, the build economics become overwhelmingly favorable.

Why open source for your ticket classification pipeline

Choosing an open source ticket classifier isn't just about cost — it's about control over the system your support team depends on every day. Here's what that means in practice:

Frequently asked questions

What is an AI ticket classifier?
An AI ticket classifier is a system that uses large language models to automatically read, categorize, prioritize, and route support tickets — replacing manual triage. It classifies across multiple dimensions (category, urgency, sentiment, affected component) and routes each ticket to the right team. Modern implementations use layered architectures (rules → embeddings → LLM) for high accuracy at low cost.
Why build a ticket classifier instead of buying a SaaS?
Building gives you fixed hosting costs instead of per-ticket SaaS fees, full data sovereignty (tickets never leave your infrastructure), and unlimited customization — integrate with any system via HxA Connect's adapters, not just the 3–5 platforms a SaaS vendor supports. For teams handling sensitive data, self-hosting is often a compliance requirement. At 5,000+ tickets/month, the cost advantage of building is overwhelming.
How accurate is an open source AI ticket classifier compared to SaaS?
The accuracy comes from the LLM, not the wrapper. Whether you use GPT-4o via Zylos or via a SaaS tool, the underlying model is the same. The difference is the routing architecture: with Zylos + HxA Connect, you control the confidence thresholds, the fallback rules, and the review workflow. A well-tuned self-hosted classifier achieves 90–95% acceptance rates — matching or exceeding SaaS benchmarks — because you can optimize for your specific ticket mix.
Can I integrate an AI ticket classifier with my existing helpdesk?
Yes. Zylos and HxA Connect integrate with any system that exposes an API — Zendesk, Jira Service Management, Freshdesk, ServiceNow, or a custom internal ticketing system. Tickets flow in via webhook or API polling, the agent classifies them, and structured fields (category, priority, assignee) are written back via the target system's API. HxA Connect handles the multi-channel routing to 10+ platforms out of the box.
How long does it take to build and deploy?
A proof-of-concept AI ticket classifier is running in under 2 hours: install Zylos, define your classification schema, connect one ticket source, and the agent starts classifying. A production deployment with multi-source intake, confidence scoring, fallback routing, and a review dashboard takes 3–5 days. The bottleneck is defining your classification taxonomy — which is organizational work, not engineering work.

Ready to build your own AI ticket classifier?

Zylos is MIT-licensed and free to use. No training data required. Deploy on your own infrastructure.

Get Zylos on GitHub

Also available: HxA Connect for multi-channel routing · COCO Labs for documentation & guides

Explore Other COCO Guides

Related articles