Voice AI agent stack · L1 · 20 min
Turn-taking and barge-in
Learn in five minutes
- LiveKit's turns page says turn detection decides when the user has finished speaking and when they start speaking while the agent is talking.
- That page says most techniques use voice activity detection, then endpointing to decide the end of a phrase.
- The same page describes adaptive interruption handling as a way to separate a real interruption from backchanneling.
- The xAI Speech to Speech page says turn_detection.type set to server_vad detects when the user has finished speaking.
- That page also says to enable server_vad for automatic barge-in, and that item.interruptible set to false drops caller audio until playback completes.
Barge-in in this lab means the person speaks while the reply is still playing. Copy the field name from the page you opened. Do not invent a silence timer.
Visual
Two ways to yield
- Write the LiveKit sentence: the agent can yield when the user starts speaking mid-response.
- Write the xAI sample field: turn_detection.type is server_vad.
- Write the xAI field that drops caller audio: item.interruptible false.
- Label each line with the page it came from.
Quiz
Ecosystem
- Barge-in
- The person speaks while the assistant is still talking. Vendors name the detector differently.
Sisters: Speech-to-text, Language model, Text-to-speech, WebRTC, SIP.
A cascaded pipeline and a speech-to-speech model are two shapes the LiveKit docs name. The xAI Speech to Speech API is a hosted speech-to-speech session.
Pin the model id, the voice, and the date you read the docs.
Config
- Write the goal in one sentence.
- Name the input and the allowed output.
- Save the trace next to the result.
Troubleshooting
- The answer looks fluent and is wrong. Check whether a source passage actually contains the claim.
- The loop never stops. Set a step cap and stop when the tool result repeats.
Sources and go deeper
- LiveKit Agents, Turns overview vendor last checked 2026-10
- Speech to Speech, docs.x.ai vendor The page title is Speech to Speech. The body names the Grok Speech to Speech API and also calls the site SpaceXSI Docs. last checked 2026-10