Skip to content
mentoor

Topic 1 of 5 · 4 min read

Simulated callers and scripted test conversations

Goal: Write a set of simulated-caller scenarios that cover the main goals, hard accents, interruptions and silence of a voice agent.

A voice agent is tested by calling it: a simulated caller with a persona, a goal and a script of awkward behaviour places hundreds of calls, so you find failures before real customers do. Reading the agent's code or its prompt tells you little about how it behaves on a bad phone line.

Check yourself · 1 of 3

Which setup makes a simulated call most realistic for a phone agent?

Choose one answer

Why it matters

Typed chat tests miss what makes voice hard: people interrupt, trail off, mumble, speak over a TV, or say nothing for six seconds. A demo made by one developer in a quiet room passes. The first customer in a car does not. Tools such as the LiveKit Agents test framework, Pipecat and hosted simulators let you script callers and run them against your agent without a human on the phone.

How to do it

  1. List the goals. One scenario per thing a caller wants: book, reschedule, cancel, ask opening hours, reach a human, and one "caller wants something we do not do".
  2. Give each caller a persona. A second LLM plays the caller with a short brief: who they are, what they want, how they talk. "Impatient, wants to move Thursday's appointment to next week, gives the date as 'the 14th, no, the 15th'."
  3. Add hard audio. Run the same script with different accents, a fast speaker, a phone-quality codec and background noise such as traffic or a café. Replay recorded real calls (with consent) as fixed audio, so every model change is compared on the same input.
  4. Script the behaviour. Interrupt the agent mid-sentence, stay silent for several seconds, change your mind after confirming, give a wrong detail and correct it, ask the same question twice.
  5. Fix the seed. Keep the scenario text, audio and random settings stored, so a failure can be replayed exactly.

Before and after

Before: "We tested by phoning the agent ten times ourselves. It worked."

After: a table of 24 scenarios, each with a goal, a persona, an audio condition and one disruption, run on every release. Each scenario has a pass rule written in advance, such as "appointment moved to 15 March and the caller heard the new time read back".

What goes wrong

  • A simulated caller is too polite. An LLM caller speaks in complete, clear sentences. Real callers do not. Tell the caller persona to hedge, restart and mumble, and check the transcript to confirm it did.
  • Clean synthetic audio only. Text-to-speech voices are clear and evenly paced, so the speech-to-text stage looks better than it is. Mix in real recordings and noise.
  • Random runs that cannot be repeated. If you cannot replay a failure, you cannot confirm the fix.

Examples

One scenario card

Goal: move a dentist appointment from Thursday to next week. Persona: nurse on a break, speaks fast, gives the date twice. Audio: hospital corridor noise, phone codec. Disruption: interrupts the agent while it reads the available slots. Pass rule: the booking tool is called once with the new date and the agent reads the new time back.

Silence test

The caller says "I'd like to book" and then stays quiet for 8 seconds. A good agent prompts once ("Are you still there?") and does not talk over the caller's late reply. A weak agent hangs up or repeats its greeting.

Key points

  • A simulated caller is an LLM with a persona and a goal that talks to your agent through the same audio path real callers use.
  • Each scenario combines a goal, a caller style, an audio condition and one disruption such as an interruption or silence.
  • Replaying recorded audio gives a fixed input, so a model or prompt change can be compared fairly.
  • LLM callers are too clear and polite by default, so persona briefs must ask for hedging, restarts and mumbling.
  • Store scenario text, audio and settings so any failed call can be replayed.

Common mistakes

  • Testing only by phoning the agent yourself in a quiet room.
  • Using only clean text-to-speech audio for simulated callers.
  • Writing the pass rule after seeing the result.
  • Having no scenario for a caller who asks for something the agent should refuse or hand over.

Check yourself · 2 of 3

Why store the seed, persona text and audio of every simulated call?

Choose one answer

Check yourself · 3 of 3

A caller says "book me in" and then stays silent for eight seconds. What is this scenario testing?

Choose one answer

Practice items, not counted towards your mastery.

Start here