03Conversation
Interruptions
Let callers cut in — and tell a real interruption from a "yeah".
With barge_in: true, the caller can interrupt the agent mid-sentence. The
hard part is that people constantly make small sounds while listening, like
"yeah", "mhm" and "right". An agent that stops for each one is unusable.
turns:
barge_in: true
barge_in_detector: maai # vad | backchannel-detector | maai
interrupt_after: 300 # ms of speech before vad counts it (vad only)Detectors
| Value | How it decides | Cost |
|---|---|---|
vad | Any caller speech longer than interrupt_after ms stops the agent, including "yeah". | Free |
backchannel-detector | A small model separates backchannels from real interruptions in the first few hundred ms. | Light |
maai | MaAI predicts from both voices whether the caller is taking the floor. The default. | ~23 ms CPU per 80 ms, shared with backchannels |
The detector emits either user_backchannel (keep talking) or interrupt.
The policy waits hold_ms (200 ms by default) after an interrupt before
stopping, and cancels the stop if a user_backchannel arrives in that window.
What happens when the agent stops
- LLM generation and TTS are cancelled mid-stream.
- The server emits
agent.interrupted. Over the Realtime API, clients getinput_audio_buffer.speech_started, and the response ends with statuscancelled. - Clients must drop audio they haven't played. Buffered audio would keep talking over the caller.
- If the reply was cut off before any audio played, it is dropped from the history, and the caller's words carry into their next turn. Otherwise the partial reply stays in the history, and any unanswered tool calls are marked interrupted.
Tuning
- Stops too often: use
maaiorbackchannel-detectorinstead ofvad, or raiseinterrupt_after(vad). - Stops too slowly: lower
hold_msin a custom policy:StandardTurnTaking(hold_ms=100). See Custom turn-taking. - Never interrupt (an IVR prompt, a legal disclosure): set
barge_in: false, or filterSTOPdecisions in a custom policy (example in Custom turn-taking).
In the dashboard, barge-in rate and interruptions per call show how often callers cut in. Listen to a few with the call player to check the stops were real.