# Case study: Call → ticket · structured tickets from support-call audio

Pipeline that drafts a structured support ticket from real call audio. Every field cites the verbatim transcript line it came from, and uncertain fields route to a supervisor. Python + FastAPI. Public build. The repo and the eval report ship together.

**Evidence:** In progress (public build). **Case page:** https://luisosio.dev/work/call-ticket/

## Problem

Support calls contain everything a ticket needs. The issue, the promise, the account details. Locked inside audio nobody re-listens to. Notes written from memory drop commitments and misattribute who said what. The corpus: AppTek diarized call audio, 128.6 hours across ~92k transcript segments.

## Shape

Audio → ingest queue with idempotent retries → speech-to-text with speaker labels → LLM field extraction → Pydantic schema validation (invalid → retry with errors fed back) → supervisor review on low-confidence fields → dispatch.

- **Verbatim-grounded fields:** every extracted field cites the transcript line it came from. Quote plus timestamp. The ticket shows its evidence.
- **Speaker-aware extraction:** a promised action must quote the agent's turn, not the customer's ask. Asking isn't promising. Speaker labels are data, not decoration.
- **Schema as a gate:** fields are Pydantic-validated; a malformed extraction retries with the validation errors fed back, not patched silently.
- **Designed uncertainty:** fields below confidence route to a supervisor queue. The system says "check this one" instead of shipping a maybe.
- **PII handling:** sensitive spans are flagged at the transcript layer, not redacted downstream after the fact.

## Decisions and what they beat

- **Diarized audio over transcripts.** Larger transcript-only datasets exist and are cheaper to work with, but they can't teach the one thing extraction needs: who said it. AppTek's ~92k speaker-labeled segments let "promised" mean "the agent's turn said it", not "the word promise appeared" — speaker attribution is a property of the corpus choice, not a feature bolted on later.
- **Verbatim quotes as the field contract.** Every extracted field must cite the transcript line and timestamp it came from; a commitment that can't be quoted doesn't exist. It beats model-written summaries on the only axis that matters — fluent summaries are unauditable, a quote either appears in the transcript or it doesn't.
- **The schema is the stage boundary.** Pydantic validation sits between extraction and dispatch, so a malformed field is a loud retry with errors fed back — not a silent patch downstream. The alternative, asking the model to "please format correctly", has no check at all.
- **A supervisor queue, not a confidence display.** Below-threshold fields route to a person because "show the user a score" just delegates the judgment back, and auto-approving above a threshold ships maybes at scale. Designed uncertainty means the system can say "check this one" — which only works if something exists to check it.
- **Idempotent ingest with bounded retries.** Bad audio is real, so ingestion is safe to re-run and retries are capped; unbounded retries turn one corrupt file into a storm, fail-fast drops calls that would have succeeded on a second pass.

## Honest classification

A **workflow with human review**. Fixed stages, a schema contract between them, and a person deciding on the uncertain fields. Not an agent: the model doesn't choose its steps.

## What could go wrong

- A fabricated commitment → promised actions must quote the agent's verbatim turn; no quote, no commitment field.
- Speaker mix-ups → extraction conditions on speaker labels; a customer request can't become an agent promise.
- Silent bad fields → schema validation retries loudly; low-confidence fields go to a human queue.
- Retry storms on bad audio → the ingest queue is idempotent with bounded retries.

*The public repo lands when the eval numbers do. This site cites the spec, not invented metrics.*
