Barge-in: How a Voice Agent Stops Talking When You Interrupt It
The problem
Picture a dental clinic's booking line run by a voice agent. The agent starts reading out three open slots: "I have Tuesday at 9, Tuesday at 2:30, and Thursday at..." The caller already heard what they wanted and says "Tuesday at 2:30, please."
A person would stop mid-word. A naive voice agent keeps going. It finishes the list, then answers a question nobody asked any more, and its memory of the call now says it offered Thursday too, even though the caller never heard Thursday.
Letting the user cut in is called barge-in. It sounds like one feature, but it is really five jobs that have to happen in the right order, fast:
- Notice that the user is speaking while the agent is speaking.
- Decide whether that sound is a real interruption, or a cough, a "mm-hm", or the agent's own voice leaking back in through the microphone.
- Stop the audio that is playing and throw away audio that is queued.
- Cancel the work still in flight: the LLM response being generated, the text-to-speech (TTS) synthesis, and maybe a tool call.
- Fix the conversation history so it only contains the words the user actually heard.
Animation: on the dental line, a cough triggers VAD but brings no words, so the agent resumes. Then a real barge-in stops playback, cancels the reply, and the history keeps only what the caller heard.
This post walks through each job, how LiveKit Agents and Pipecat expose them, and what changes with speech-to-speech models. If you are new to the pipeline, part 2 of this series covers the stages, and part 3 covers how the agent decides you finished talking. Barge-in is the opposite question: how the agent decides it should stop.
Job 1: hearing the user while the agent talks
The first signal is usually voice activity detection (VAD): a small, fast model that says "speech is present" or "no speech" for each short slice of audio. It does not know what was said, only that someone is talking.
LiveKit's turns documentation describes the rule it uses. If a VAD plugin is configured, VAD triggers the interruption, and interim (partial) transcripts do not. If there is no VAD, interim transcripts from the speech-to-text (STT) service trigger it. Final transcripts can trigger an interruption in both cases.
Pipecat's default is similar. Its user turn strategies page says a user turn starts on "VAD detection or transcription received", and every start strategy has an enable_interruptions flag, on by default, that makes the start of a user turn also broadcast an interruption.
The catch is that VAD fires on anything that sounds like a voice, which is the root of most barge-in bugs.
Job 2: telling a real interruption from noise
False barge-ins come from short noises (a cough, a door), from backchannels (the "uh-huh", "okay", "right" people say to show they are listening, which mean "keep going", not "stop"), and from echo, covered below. There are three broad defenses, and both frameworks offer all of them.
Thresholds: minimum duration and minimum words
The simplest filter is "do not stop for very short sounds". LiveKit's InterruptionOptions has min_duration, documented with a default of 0.5 seconds of speech, and min_words, default 0, which counts transcribed words and so needs an STT model. Pipecat offers MinWordsUserTurnStartStrategy(min_words=...), which its docs describe as useful for stopping brief utterances like "okay" or "yeah" from triggering a response.
The tradeoff is direct. Raise the thresholds and the agent ignores more backchannels, but it also keeps talking longer when the user really does want it to stop. "No" is one word.
A model that classifies the overlap
The second defense is a model trained to answer one question: is this overlapping speech an attempt to take the turn, or a backchannel?
LiveKit calls this adaptive interruption handling. Its docs say it needs Python SDK v1.5.0 or later (Node v1.2.0 or later), runs after VAD, and works on the audio directly, so it does not wait for a transcript. It is on by default when the session runs on LiveKit Cloud or in dev mode, a VAD is present, and the session is able to stop on a backchannel. If the inference service is unavailable, the docs say it falls back to plain VAD behaviour.
LiveKit's own blog post announcing the feature (19 March 2026) reports 86% precision and 100% recall at 500 ms of overlap, says it rejected 51% of the barge-ins that VAD alone would have accepted, and says it was faster than VAD in 64% of cases, with inference taking 30 ms or less. These are LiveKit's published numbers from LiveKit's own evaluation, not an independent benchmark.
Pipecat's equivalent is KrispVivaIPUserTurnStartStrategy, which feeds audio into Krisp's Interruption Prediction model while the bot is speaking. A user turn (and so an interruption) starts only when the model's probability exceeds a threshold, default 0.5.
Recovering when the guess was wrong
The third defense accepts that the first two will sometimes be wrong, and plans for recovery.
LiveKit defines a false interruption as one where VAD fired but no words came back from STT. With resume_false_interruption=True (the default), the agent resumes speaking after false_interruption_timeout, default 2.0 seconds, and the session emits an agent_false_interruption event. LiveKit's official basic_agent.py example sets that timeout to 1.0 second.
Pipecat handles the same case with EmptyUserTurnConfig. Its docs say that when a user turn that interrupted the bot ends with no transcript (a cough, background noise, or speech the STT could not recognize), the LLM runs once by default, "so the bot asks the user to repeat or picks up where it left off." An empty turn while the bot was idle gets no answer by default.
Both solve the worst version of the bug: the agent going silent because someone coughed.
sequenceDiagram participant C as Caller participant V as VAD participant S as STT participant A as Agent A->>C: reading out open slots C->>V: cough V->>A: speech detected A->>A: pause speaking S-->>A: no words came back Note over S,A: LiveKit false_interruption_timeout, default 2.0 s A->>C: resumes speaking Note over S,A: agent_false_interruption event is emitted
Sequence: LiveKit's false interruption recovery with the documented defaults, when a cough triggers VAD but STT returns no words.
Jobs 3 and 4: stopping playback and cancelling work
Once the system decides an interruption is real, everything downstream has to stop, and stop in the right place.
Pipecat's interruptions doc spells out the sequence clearly. The user aggregator broadcasts an InterruptionFrame both upstream and downstream. It is a system frame, so every processor handles it immediately instead of waiting in line. Then:
- The in-flight LLM completion is cancelled mid-stream.
- Function calls registered with
cancel_on_interruption=Trueare cancelled. - The TTS service stops synthesizing and drops pending output.
- The output transport drains its audio queue, discarding audio that was generated but not yet played.
The doc says the bot "goes silent within roughly one audio write". Frames marked interruptible=False, such as a function call result, survive the interruption, which matters when a tool has already done something real.
sequenceDiagram participant C as Caller participant V as VAD participant A as Agent session participant L as LLM participant X as TTS and playback participant H as History X->>C: Tuesday at 9, Tuesday at 2:30, and C->>V: Tuesday at 2:30, please V->>A: speech while agent is speaking Note over V,A: passes the interruption checks, LiveKit default min_duration 0.5 s A->>X: stop playback, drop queued audio A->>L: cancel the in-flight reply A->>H: keep only the words the caller heard Note over H: Thursday was never heard, so it is not stored A->>C: listening to the new turn
Sequence: a real barge-in on the dental line, from detection to a trimmed history.
LiveKit does the same work inside AgentSession, and gives you controls for the cases where an interruption should not win:
session.say(..., allow_interruptions=False)orgenerate_reply(..., allow_interruptions=False)for a line that must be heard in full, like a legal notice.run_ctx.disallow_interruptions()inside a function tool, so a half-finished write action is not abandoned.session.interrupt()to stop the agent from your own code.
In the dental example, the "find open slots" lookup is read-only, so cancelling it is harmless. "Book Tuesday at 2:30" is a write. That is the call I would protect from interruption, and then confirm out loud. Part 7 of this series, on tools with MCP, goes deeper on read versus write tools.
Job 5: keeping only what the user heard
This is the step people forget. The LLM may have generated a 60-word answer, TTS may have synthesized 40 words of it, and the user may have heard 12. If the history stores all 60, the next turn is built on things the user never heard.
All the systems below fix this, but in different ways.
| System | How the history is trimmed |
|---|---|
| LiveKit Agents (pipeline) | Docs: the agent "automatically truncates its conversation history to include only the portion of the speech that the user heard before interruption." |
| Pipecat | Docs: "Only the words that were actually spoken." Text frames are pushed in sync with playback, and the spoken-so-far text is committed on interruption. |
| OpenAI Realtime over WebRTC or SIP | Docs: the server truncates the unplayed audio automatically. |
| OpenAI Realtime over WebSocket | Your client stops playback, records how many milliseconds were played, and sends conversation.item.truncate with audio_end_ms. |
| Gemini Live API | Docs: the generation is cancelled and "only the information already sent to the client is retained in the session history." |
| GPT-Live (full duplex, via LiveKit) | LiveKit's docs say GPT-Live does not support message truncation and the model does not know what the user heard. |
Two details in that table are worth slowing down on.
First, the OpenAI Realtime WebSocket path. OpenAI's conversations guide says that when the server detects speech, the client should stop playback on input_audio_buffer.speech_started, work out how much audio was actually played, and send a truncate event. The guide also notes that truncation removes the transcript of the unplayed part but does not hand you a truncated transcript. If you log transcripts, you have to trim them yourself.
Second, Gemini's wording. "Already sent to the client" is not the same as "already played". Audio sent to your client may still be sitting in your playback buffer when the user interrupts. My reading is that if your client buffers a lot of audio ahead, the history can still include words the user never heard, so keeping that buffer short matters. That is an inference from the docs, not something Google states.
Echo: stopping the agent from interrupting itself
On a laptop with speakers, the microphone picks up the agent's own voice. VAD hears speech, the agent "interrupts" itself, and you get a stuttering loop. The fix is acoustic echo cancellation (AEC): subtracting the known outgoing audio from the incoming microphone signal.
In a browser, AEC is a microphone setting. MDN documents the echoCancellation constraint with values true, false, "all" and "remote-only". The "remote-only" value removes only audio from remote sources, meaning tracks that come from an RTCPeerConnection, which is how a WebRTC voice agent's audio usually arrives. MDN also notes the browser will try to apply the constraint but will not fail if it cannot, unless you request it with exact.
javascript// Example based on MDN's MediaTrackConstraints.echoCancellation page const stream = await navigator.mediaDevices.getUserMedia({ audio: { echoCancellation: true }, });
AEC needs a moment to adapt to the room. LiveKit's basic_agent.py example sets aec_warmup_duration=3.0, with the comment that it "blocks interruptions for a few seconds after the agent starts speaking to allow client to calibrate AEC". LiveKit's events reference also mentions that a user_transcription_timeout can happen during this warmup.
Noise and voice isolation help too. LiveKit's tuning page says voice isolation and noise suppression run before VAD and STT, so a cleaner signal reaches the barge-in logic. For phone calls, echo is mostly handled by the phone network and handset, which is a telephony topic: see how a phone call reaches an AI voice agent.
Pipecat also offers a blunter tool, mute strategies: AlwaysUserMuteStrategy blocks user audio, transcripts and interruption signals whenever the bot speaks, FirstSpeechUserMuteStrategy protects only the first line, and FunctionCallUserMuteStrategy mutes during tool calls. Muting stops self-interruption, but you lose real barge-in during those windows.
LiveKit Agents: a configuration example
The following is an example based on LiveKit's basic_agent.py and the turn handling options reference as of 26 Nov 2026. It is not code I ran. Interruption settings go in turn_handling, which takes a TurnHandlingOptions object or a plain dict.
pythonfrom livekit.agents import AgentSession, TurnHandlingOptions, inference session = AgentSession( stt=inference.STT("deepgram/flux-general", language="en"), llm=inference.LLM("google/gemma-4-31b-it"), tts=inference.TTS("cartesia/sonic-3"), turn_handling=TurnHandlingOptions( interruption={ "min_duration": 0.5, # doc default "min_words": 2, # needs STT; doc default is 0 "resume_false_interruption": True, "false_interruption_timeout": 1.0, }, ), aec_warmup_duration=3.0, ) @session.on("agent_false_interruption") def on_false_interruption(ev): # ev.resumed tells you whether speech was resumed print("false interruption, resumed:", ev.resumed)
A few notes from the reference:
- Disabling interruptions is
{"enabled": False}. The reference says the old boolean shorthand is no longer supported. modecan be"adaptive"or"vad". Adaptive is the default only when its conditions are met; otherwise it is VAD.- With adaptive mode on, the session emits
overlapping_speechevents withis_interruption,probabilityanddetection_delay, which is exactly what you want to log while tuning.
For an agent "interrupted by short acknowledgments", LiveKit's tuning page recommends adaptive mode first, then raising min_words or min_duration.
Pipecat: a configuration example
The following is an example based on Pipecat's interruptions doc and user mute strategies page (Pipecat 1.x, docs as of 26 Nov 2026). In 1.x, the old allow_interruptions and interruption_strategies pipeline parameters are gone; the migration guide says they were replaced by user_turn_strategies on LLMUserAggregatorParams, and MinWordsInterruptionStrategy became MinWordsUserTurnStartStrategy.
pythonfrom pipecat.processors.aggregators.llm_response_universal import ( LLMContextAggregatorPair, LLMUserAggregatorParams, ) from pipecat.turns.user_mute import FirstSpeechUserMuteStrategy from pipecat.turns.user_start import MinWordsUserTurnStartStrategy # Ignore "okay" and "yeah": a turn (and an interruption) needs 3 words. # Pass this in the start strategies of user_turn_strategies. start_strategy = MinWordsUserTurnStartStrategy(min_words=3) user_aggregator, assistant_aggregator = LLMContextAggregatorPair( context, user_params=LLMUserAggregatorParams( # Let the greeting play in full, then allow barge-in. user_mute_strategies=[FirstSpeechUserMuteStrategy()], ), ) @assistant_aggregator.event_handler("on_assistant_turn_stopped") async def on_assistant_turn_stopped(aggregator, message): if message.interrupted: print(f"Bot was cut off after saying: {message.content}")
Two behaviours from the docs are easy to mix up:
VADUserTurnStartStrategy(enable_interruptions=False)does not ignore the user. Speech over the bot is still transcribed, and the reply is queued until the bot finishes.- A mute strategy does ignore the user. Speech over the bot is discarded.
To stop the bot from your own code, the doc shows await self.broadcast_interruption() inside a custom frame processor, or queueing an InterruptionWorkerFrame.
What changes with speech-to-speech and full-duplex models
With a speech-to-speech model, one model hears audio and produces audio, and the provider usually decides when the user barged in. Pipecat's doc says that for services like Gemini Live and OpenAI Realtime, "the provider decides", and Pipecat still flushes local audio so the bot goes quiet immediately.
LiveKit's turns doc says the same for its realtime mode: the model decides, most InterruptionOptions are ignored, and setting enabled=False raises a ValueError. You tune the provider's own settings instead, for example OpenAI's server VAD threshold, prefix_padding_ms and silence_duration_ms, or its semantic VAD eagerness and interrupt_response. LiveKit also notes its adaptive gate is all-or-nothing with a realtime model: if it decides overlap was a backchannel, it drops the whole user turn.
Gemini's Live API lets you tune its automatic VAD (for example start_of_speech_sensitivity and silence_duration_ms) or turn it off and send your own activityStart and activityEnd messages. On an interruption, the server sends a message with interrupted set and discards pending function calls; your client still has to stop playback and clear queued audio.
Full-duplex models, which listen and speak at the same time, go furthest. LiveKit's GPT-Live page says the model controls barge-in, the framework can stop local playback while the model keeps talking, and the model does not know what the user heard. Part 5 compares these three architectures in detail.
A checklist for the dental line
If I were setting up barge-in for the clinic's agent, I would work in this order:
- Turn on echo cancellation in the client and keep an AEC warmup.
- Start with the framework defaults, then log every interruption with the overlap event or the interrupted assistant message.
- Listen to the false ones. If they are backchannels, try the adaptive or Krisp model before raising word thresholds.
- Keep false-interruption recovery on, so a cough never leaves the agent silent.
- Protect write actions ("book the 2:30 slot") from interruption, and confirm them out loud afterwards.
- Check the stored history after an interrupted turn and make sure it ends where the caller stopped listening.
Every check you add before stopping is time the agent keeps talking over the user. Part 8 covers how to measure that, and part 9 puts these settings into a working LiveKit build.
New to a term used here? The series glossary defines VAD, endpointing, barge-in, full-duplex, MCP, p95 and the rest in plain language.
Sources
- LiveKit Docs: Turn handling options reference
- LiveKit Docs: Turn-taking tuning
- LiveKit Docs: Turns overview
- LiveKit Docs: Adaptive interruption handling
- LiveKit blog: Adaptive interruption handling (19 March 2026)
- LiveKit Docs: Agents events reference
- LiveKit Agents example: basic_agent.py on GitHub
- LiveKit Docs: GPT-Live realtime model
- OpenAI API docs: Realtime conversations guide
- Google AI Studio docs: Live API capabilities guide
- Pipecat Docs: User turn strategies
- Pipecat Docs: Interruptions (docs repository on GitHub)
- Pipecat Docs: User mute strategies
- Pipecat Docs: Migrating to Pipecat 1.0
- MDN Web Docs: MediaTrackConstraints echoCancellation
