Use cases

How to triage and escalate support tickets

A triage prompt that works in the demo breaks in production for two reasons. The right queue often depends on who is asking, not what they wrote. And the queues themselves keep changing.

The pain points

How to do it

  1. Label from the final queue, after reassignment, and date every row. The reassignment history is also free training data: every move is a correction someone made by hand.
  2. Fetch account context as an external lookup, and freeze it. Look up plan, entitlement and open tickets once, when the row is captured, and store the answers with the row. Train on those stored values; call the lookup live in production. A ticket was an escalation because of what was true that day, not what is true when you re-run the evaluation.
  3. Treat the pipeline as a program and optimize one prompt at a time. Rewrite the summarizer or the router in a given round, never both, so that when the score moves you know which change moved it.
  4. Score escalation separately. Exact match on the queue, plus recall on the escalation class as its own metric in the objective, weighted by what a missed escalation costs.
  5. Ship a version, then close the loop. Serve a fixed version of the prompts, log every request, and record reassignments as outcomes. Those corrections are next month's dataset.

Pitfalls worth checking first

PitfallWhat it looks likeHow to check, before spending anything
First-queue labelsThe prompt learns the old router's habitsCompare first and final queue on a sample. If they differ often, label from the final queue.
Time travelAccount data fetched at evaluation time, not ticket timeFreeze the lookup onto the row when the ticket arrives.
Rare escalationsAccuracy is high, escalations are missedRead escalation recall on its own. Put it in the objective.
Renamed queuesOld and new labels for the same workMap old queue names to current ones before training, or drop rows from before the change.
Unused contextThe lookup returns five fields and the prompt uses twoCheck which fields actually change the answer. Stop pasting the rest into every call.

References

Tools that run this loop: DSPy and its GEPA optimizer, bpto (ours, open source), and Impromptune, the studio built on it.