Write an eval set for Triage
Build a versioned triage dataset from real tickets, run it as a baseline, change the routing, and catch the regression.
After reading this page you will be able to:
- Create a triage dataset from tickets and JSONL
- Run it and set a baseline
- Use the result as a CI gate
Intermediate30 minService deskDocker
Prerequisites
- A running Liyagent instance with resolved tickets that carry triage labels: from a source that brings its own category, team and priority, or tickets where a person corrected triage. Sync a source or run the Jira lab first.
Steps
- Create the dataset from your labelled tickets. Every resolved ticket with triage labels in scope becomes a case:
curl -b cookies.txt -X POST http://127.0.0.1:8787/api/evals/datasets/triage-core/from-tickets \ -H "Content-Type: application/json" -d '{"limit": 500}' - Add edge cases as JSON Lines, one per line, with the expected category, team and priority:
{"id": "printer-3f", "title": "Cannot print to 3rd floor printer", "labels": {"category": "Hardware", "team": "Field Services", "priority": "P3"}} {"id": "ransomware", "title": "Ransomware note on finance share", "labels": {"category": "Security", "team": "Security Operations", "priority": "P1"}}Send them with
POST /api/evals/datasetsand{"name": "triage-core", "kind": "triage", "append": true, "jsonl": "<the lines>"}. Each write is a new dataset version. - Split it into calibrate and holdout sets:
POST /api/evals/datasets/triage-core/splitwith{"seed": 7}. - Run it (
POST /api/evals/runswith{"dataset": "triage-core"}) and open the run on Evaluations. Choose Pin as baseline. - Make a change that should hurt: route Hardware to Service Desk L1 with
PUT /api/routingand{"table": {"Hardware": "Service Desk L1"}}. - Run again. The comparison shows the Hardware cases regressing against the baseline.
- Put the gate in CI:
tiq eval run --dataset triage-core --fail-on-regression
Clean up
DELETE /api/routing restores the default routing table.