# Chapter 13: Voice agents

Part of the course “AI from Zero to Autonomous Agents” (https://llm.yoga/en). Page for humans: https://llm.yoga/en/13-sprachagenten

*Listening, thinking, speaking: how a phone agent is built, where the time goes, how it knows you’re done, and how to test something like that.*

About 30 min to read · about 30 min hands-on exercise

**Start with the missions**

This chapter also comes as 3 short missions with a case, a decision and feedback, about 10 minutes each:

- [13.1 Almost three seconds of silence: will a faster model help?](https://llm.yoga/en/einsatz-13-1.md)
- [13.2 “My customer number is … hold on … 4711”](https://llm.yoga/en/einsatz-13-2.md)
- [13.3 A phone agent for a fifth of the cost?](https://llm.yoga/en/einsatz-13-3.md)

For agents, this page is split into 5 parts so that each part can be fetched in full. Read the parts the question needs.

## Parts

### Part 1: https://llm.yoga/en/13-sprachagenten-1.md

- **Getting started**: Imagine you call a hotel, and at the other end three people sit in a row.
- **The chain: listening, thinking, speaking**: A language model like Claude or Qwen processes tokens, that is, pieces of text.
- **Why 200 milliseconds are so hard**: In 2009, Tanya Stivers and colleagues analyzed conversations in ten languages.
- **Streaming: letting the chain overlap**: The worked example shows where the lever is.

### Part 2: https://llm.yoga/en/13-sprachagenten-2.md

- **One model for everything: speech-to-speech**: The alternative to the chain is a model that hears sound and speaks sound, without the detour through text.
- **When is the person done? Turn-taking and interrupting**: The hardest question sounds trivial: has the caller finished speaking?
- **On the phone: Twilio, SIP and 8 kHz**: For a real phone number, a voice agent needs a provider that connects the phone network to the internet.

### Part 3: https://llm.yoga/en/13-sprachagenten-3.md

- **Build it yourself or have it built: platforms and frameworks**: Programming a voice agent from scratch means solving audio formats, VAD, streaming, interruptions and telephony yourself.
- **Local building blocks**: All three links exist as open models for your own computer, which is interesting if conversations shouldn’t leave the computer or you want to experiment without a per-minute price.
- **Testing: conversations can’t be checked by hand**: With a voice agent, you’d have to call ten times after every prompt change and listen to every conversation.

### Part 4: https://llm.yoga/en/13-sprachagenten-4.md

- **Video 2 in context: phone agents in practice**: „Automatisiere ALLES mit KI-Telefonagenten“ (German for “Automate EVERYTHING with AI phone agents”) by Everlast AI is a course of almost two hours, in German.
- **Exercise: a small chain on your own computer**: Goal: you rebuild the cascade by hand from three local building blocks, measure each link, and compare the sum with a person’s 200 ms.
- **Common misconceptions**: A faster language model solves the latency problem.

### Part 5: https://llm.yoga/en/13-sprachagenten-5.md

- **Review questions**: 1. Your agent answers after 2.5 seconds on average.
- **Go further**: Stivers et al.: Universals and cultural variation in turn-taking in conversation (PNAS 2009), the measurement of gaps at turn changes in ten languages.
