Deep-dive

The voice stack for AI agents: STT, LLM, TTS and the orchestration

The pieces that let an AI answer a phone call: SIP telephony, real-time transcription, LLM, voice synthesis, and the orchestration that ties it all together with low latency.

Jul 22, 2026·10 min read·.md

Getting an AI to reply in chat is a solved problem. Getting an AI to answer a phone call — to speak, listen, be interrupted, respond in real time without sounding robotic — is a completely different game. It's genuine real-time engineering, and most people underestimate how many pieces have to work together within milliseconds. This is the map of the voice stack for AI agents, from someone who builds it.

Why voice is hard (and text isn't)

In text, latency is tolerable. The customer sends a message, you process it calmly, you respond three seconds later — nobody complains. In voice, three seconds of silence kill the conversation. The human ear is unforgiving: high latency is instantly perceived as "this service is bad."

And it's not just speed. On a call, the customer interrupts, changes the subject mid-sentence, talks over you, hesitates. A serious voice agent has to handle all of this naturally — which demands an orchestration that text simply doesn't need. I covered part of this in the architecture of an AI call center; here I go deep into the pieces.

The layers of the stack

1. Telephony (SIP)

The call arrives through the world of traditional telephony — the SIP protocol, carrier trunks, audio codecs. You need a robust edge (components like Kamailio live here) that bridges that world and the rest of the system: trunk registration, call routing, converting the telephony audio into something the pipeline understands. It's the least glamorous layer and the one that breaks the most if you get it wrong.

2. Real-time media transport

With the call established, the audio needs to flow both ways with minimal latency. This is where a media layer from the WebRTC/streaming world comes in (LiveKit is a strong example) — the "pipe" optimized for real time through which the voice travels.

3. STT — real-time transcription

The customer's audio becomes text, in streaming, while they're still speaking. Providers like Deepgram are the reference here. What matters:

4. LLM — the brain

The transcribed text goes to the language model, which understands the intent, decides the response and — crucially — calls tools when it needs to act (query a system, generate an invoice). In voice, two requirements are non-negotiable:

5. TTS — the voice back

The LLM's response is synthesized into speech. Providers like ElevenLabs and Cartesia offer neural voices that sound human. Here, quality defines the customer's perception:

The orchestration: where the magic (and the difficulty) lives

Having the five pieces isn't enough. What makes the conversation sound natural is the streaming orchestration, with the stages overlapped instead of sequential:

Customer speaks ─→ STT transcribes (streaming)
                       └─→ LLM already starts processing
                               └─→ TTS already starts speaking
                                       └─→ customer hears — and can interrupt (barge-in)

Barge-in — the customer interrupting the AI mid-sentence — is not optional. Without it, the agent feels like a dumb IVR. And this whole dance has to happen with total latency below the threshold of human discomfort. Voice-agent orchestration frameworks (the ecosystem around LiveKit Agents, for example) exist precisely to manage this pipeline. Platforms like Retell package much of this into a product, trading flexibility for speed of implementation.

How to choose the pieces

There's no "best" stack — there's the right one for your case. The decision axes:

The takeaway

A voice agent is 20% language model and 80% real-time engineering: telephony that doesn't drop, STT and TTS in streaming, orchestration with barge-in and fallback, all within a brutal latency budget. The LLM is the commoditized part; the hard part — and where the value is — is making the five layers dance together in milliseconds.

That's why most of the "voice AI agents" promised out there don't deliver: they stopped at the text prototype and never faced the real time of voice. Facing that is exactly what I do.


I build voice AI agents in production — from SIP to TTS, with the orchestration that holds up on a real call. If you want an AI answering the phone, let's talk.

Frequently asked questions

What are the pieces of a voice AI agent?

Five layers: (1) the telephony edge (SIP) that connects the call; (2) the real-time media transport that carries the audio; (3) the STT (speech-to-text) that transcribes the speech; (4) the LLM that understands and decides the response, calling tools when needed; (5) the TTS (text-to-speech) that synthesizes the response into voice. Orchestrating these pieces in streaming, with low latency, is what makes the conversation sound natural.

Why is voice harder than text for AI agents?

Because voice is unforgiving with latency. On a call, every millisecond of delay is perceived as bad service, and the customer can interrupt, change the subject, or talk over the agent. That demands streaming processing (STT, LLM, and TTS overlapped), end-of-speech detection, barge-in (interruption), and fallback — real-time engineering that text doesn't need.

What tools make up an AI voice stack?

In today's ecosystem: telephony/media with components like Kamailio and LiveKit; STT from providers like Deepgram; LLMs from multiple providers (with fallback); TTS from providers like ElevenLabs or Cartesia; and voice-agent orchestration frameworks. Platforms like Retell also package part of this pipeline. The choice depends on latency, cost, language, and voice quality.

LS
Written by Lucas Silva
I build AI products that ship — from diagnosis to production.
VoiceSTTTTSLLMSIPLiveKitAI AgentsTelephony

Got a business problem to solve with AI?

Tell me the problem and I'll hand you a product that actually runs.

Get in touch

Keep reading

Guide

Guardrails: how to stop an AI agent from doing something stupid in production

An LLM hallucinates, obeys whoever manipulates it, and gets things wrong with confidence. The practical guide to the guardrails that separate a safe agent from an accident waiting to happen.

Guide

MCP (Model Context Protocol): what it is and why it matters for AI agents

The no-nonsense guide to the Model Context Protocol: what it solves, when to use it, and why it became the 'USB-C' that connects AI agents to your business tools.