Use case / Voice agents

Find the pause that lost the caller.

Voice agents live or die by delay. Time each turn through speech recognition, the model and speech output, and the slow step is obvious.

Turns
Timed
First token
Measured
Tool waits
Visible

Turn timeline

Where the pause came from.

  1. Each call is a trace with one run per turn.

  2. Recognition time is separate from model time.

  3. Time to first token tells you how fast the reply started.

  4. A slow tool call shows up as the longest bar in the turn.

  5. Compare turns to see which ones callers waited on.

Voice agents1 / 5 steps
  1. 01

    Caller speaks

    Audio received, 3.2 seconds long.

    ok
  2. 02

    Transcript ready

    Speech recognition took 410 ms.

    ok
  3. 03

    Model thinking

    First token after 700 ms.

    ok
  4. 04

    Tool wait

    Order lookup took 1.9 seconds.

    slow
  5. 05

    Reply spoken

    Speech output started after a long gap.

    ok

What you get

What Tracify watches.

Turn latency

01

Recorded on every run, so it can be searched, compared and alerted on.

Time to first token

02

Recorded on every run, so it can be searched, compared and alerted on.

Interruptions

03

Recorded on every run, so it can be searched, compared and alerted on.

Tool wait

04

Recorded on every run, so it can be searched, compared and alerted on.

Instrument it

Time every turn of the call.

Put speech recognition, the model and speech output in separate spans and the slow part of a turn is obvious.

$ npm install tracify-sdk

import { span, traceAgent } from "tracify-sdk";

export const handleTurn = traceAgent(async (audio: Buffer) => {
  const text = await span("transcribe", () => speechToText(audio), { type: "tool" });
  const reply = await span("think", () => callModel(text), { type: "llm", input: text });
  return span("speak", () => textToSpeech(reply), { type: "tool" });
}, { environment: "production" });

The failure to catch

A two second silence that made the caller hang up.

Trace speech recognition, model and speech output for each turn so slow or broken moments show up as steps, not guesses.