FDE Times dataFDE jobs open 932▼14 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 62Companies hiring 202Remote-friendly 24%Median US pay $201kTop hirer Databricks 92
中文VI

The newspaper of the Forward Deployed Engineer

Guides

Your voice agent yields on a laptop. Production may differ

A trial insurance hotline on LiveKit shows how to protect a legal notice, let callers cut in and hand off through the client's SIP trunk.

ShareLinkedInFacebookX

In brief

  • Adaptive interruption is on by default only when the agent runs on LiveKit Cloud, or in dev mode with Cloud credentials, and the session has a VAD model.
  • For a mandatory line such as a disclaimer, set allow_interruptions=False on that line alone instead of disabling interruptions for the whole session.
  • Warm transfer needs an outbound SIP trunk; cold transfer needs a trunk that permits call transfers, and it ends the caller's LiveKit session.
Two-step decision tree. If the agent is deployed to Cloud, or runs in dev mode with Cloud credentials, and the session has VAD, adaptive is on by default. If the session has no VAD, adaptive may not be on by default. If it runs in the console, nothing can yet be concluded about interruption behaviour.
Adaptive interruption is on by default only when the agent is deployed to LiveKit Cloud, or runs in dev mode with Cloud credentials, and the session has a VAD model. The console falls outside both cases, so do not use it to draw conclusions about interruption behaviour. Source: LiveKit documentation, as cited in the article.

LiveKit turns on adaptive interruption by default only under specific conditions. An agent that stops on cue when you talk over it on a laptop may therefore behave differently once it reaches the client’s environment.

Small details like this separate a demo from a system that takes real calls. This guide goes past the LLM’s answers to what happens on those calls: a caller coughs mid-sentence, cuts the agent off or demands to speak to an employee.

If you work as an FDE, this is the part you will have to explain to the client’s operations team.

What will you build, and what do you need?

Take a hypothetical insurance hotline. The agent reads a legal notice that must not be cut short, answers questions, lets callers interrupt, and transfers them to an employee on request.

LiveKit’s documentation requires Python 3.10 or later, and its quickstart manages dependencies with uv. Check both before doing anything else:

python3 --version
uv --version

Check: Python must be 3.10 or later. The code below is simplified to make the ideas clear, so take the project scaffold, installation steps and full parameter names from the LiveKit documentation.

Step 1: Connect three providers in one session

In the quickstart, the agent connects three separate providers (STT, LLM and TTS) through LiveKit Inference, wrapped in an AgentSession. These three links are the first place to look when a client complains that the agent mishears or responds slowly.

from livekit.agents import AgentSession

# Simplified: will not run until completed per the quickstart
session = AgentSession(
    stt="<STT model>",
    llm="<LLM model>",
    tts="<TTS model>",
    # add a VAD model here; see the quickstart for how to declare it
)

This is not yet a working agent. You need four things from the quickstart: the uv commands that create the project and install dependencies, the STT, LLM and TTS model names to replace the placeholders, the code that starts the agent and session, and the way to declare the VAD model.

Check: once all four are filled in, the file runs without import errors. Do not leave out the VAD model. It is one of the conditions for adaptive interruption to be on by default, and the measurement in step 3 depends on it.

Step 2: Listen in console mode, but don’t trust it too soon

The quickstart includes a console mode, separate from dev mode, that runs the agent directly in the terminal. It is the fastest way to hear whether the prompt works.

# Simplified: file name depends on your project; see the quickstart for full syntax
uv run agent.py console
uv run agent.py dev

Adaptive interruption is on by default only when the agent is deployed to LiveKit Cloud or runs in dev mode with Cloud credentials, and the session also has a VAD model. Console mode is not among the listed cases, so do not use it to draw conclusions about interruption behavior.

Check: interrupt the agent in both modes and note any differences. Test interruptions in dev mode with Cloud credentials, or in the exact environment where the agent will run.

Step 3: Choose an interruption mode by measuring

Two questions are easily conflated: has the caller finished speaking, and does the caller really want to cut the agent off? On the first, a VAD-only setup relies on silence alone and can react to coughs or line noise.

LiveKit recommends a turn detector model for this question because it examines speech directly, combining words with acoustic signals such as intonation and rhythm. On the second, adaptive interruption is designed to let the agent respond naturally when a caller speaks over its answer.

If you don’t use adaptive interruption, the turn handling options leave two alternatives. The snippet below only illustrates the values to set and is not exact syntax:

# Illustrative: see the LiveKit docs for class names and how to pass this to the session
turn_handling = {"interruption": {"mode": "vad"}}     # VAD only
turn_handling = {"interruption": {"enabled": False}}  # disable interruptions entirely

Apart from the turn detector recommendation, the suggestions in this table are for the example hotline and are not LiveKit rules:

Option What it does When it fits What to watch
Turn detector model Judges whether the caller has finished speaking You want the agent to listen naturally Still has to be measured on the client’s own audio
Adaptive Handles callers speaking over the agent Cloud and VAD conditions are met, and callers often speak over the agent Recheck if you change where it runs, since it may no longer be on by default
mode: "vad" Handles callers speaking over the agent You need a simple mechanism that is easy to explain The agent may stop by mistake on coughs or line noise
enabled: false Disables interruptions entirely The flow only plays one-way announcements Callers cannot cut the agent off

Don’t choose by ear, but don’t rush into measuring either. First confirm that the agent is running in dev mode with Cloud credentials or is deployed to Cloud, and that the session has a VAD model. If either condition is missing, the “default” configuration may not be adaptive, and the comparison will lead you to the wrong conclusion.

Then record 10 clips containing coughs and 10 of callers genuinely interrupting, and save them as files so that every run uses the same audio.

A simplified method needs no extra API: have the agent read a long, fixed sentence, and while it is reading, play each file from a phone into the laptop microphone. Keep the volume and distance constant, and record whether the agent stops. Then change exactly one configuration parameter and repeat the process unchanged.

The turn detector answers a different question, so it needs its own test. Record sentences in which the caller pauses midway to think, then count how often the agent replies before the caller has finished.

Some illustrative numbers: configuration A stops for 6 of 10 coughs and 10 of 10 real interruptions; configuration B stops for 1 and 8. A annoys callers because the agent keeps halting, while B forces callers to repeat themselves in 2 of 10 cases. The tally gives the client a choice with a clear cost in place of a promise that it “sounds natural.”

Check: you have a tally with one row per configuration, recording where the agent runs, whether the session has VAD, and how many times the agent stopped across 10 coughs and 10 real interruptions.

Step 4: Disable interruptions for one line only

The legal notice is a case where interruption must not happen. In Python, the LiveKit documentation lets you disable interruptions for a single utterance by passing allow_interruptions=False to say() or generate_reply().

await session.say(
    "This call is being recorded for quality assurance.",
    allow_interruptions=False,
)

Check: speak over this line, and the agent must read it to the end. Then speak over the next answer, and the agent must react. If it stops neither time, you may have disabled interruptions at the session level.

Step 5: Warm or cold when a caller asks for a person?

The two kinds of transfer differ in who holds the context. A cold transfer moves the caller to another phone number or SIP endpoint, after which the caller’s LiveKit session ends. Anything you need to keep, such as the transcript or the reason for the transfer, should be saved beforehand.

In a warm transfer, the agent calls an employee, summarizes the context and then connects the two sides. The prebuilt route is WarmTransferTask, which in Python still sits under beta.workflows. It needs an outbound SIP trunk, declared directly or through a stored trunk ID.

# Simplified: see the WarmTransferTask docs for the import path and remaining parameters
from livekit.agents.beta.workflows import WarmTransferTask

task = WarmTransferTask(
    sip_trunk_id="<outbound trunk id>",  # or sip_connection=...
    # destination number, context summary: per the docs
)

On the example hotline, a caller complaining about a claim should get a warm transfer, because nobody wants to tell the story twice. A caller who only needs another department for a simple matter can go cold.

Check: place a test call through the real trunk. On a warm transfer, the employee must hear the summary before being connected. On a cold transfer, confirm that the call reached the right destination and that the data was saved before the session ended.

Three mistakes to avoid from the start

The easiest mistake is to disable interruptions for the whole session just to stop the agent from halting at coughs. The symptom disappears, but callers also lose the ability to cut off a machine that is saying something wrong.

The next one lies with the provider rather than the code. A cold transfer will fail if the provider’s trunk does not permit call transfers, such as SIP REFER on Twilio, so check this setting in the first week.

The last is treating a beta API as stable. Because WarmTransferTask in Python is still in beta, pin the library version and rerun the transfer tests on every upgrade.

On site, the first question is not about the model

Start with three questions: where will the agent run, who manages the SIP trunk and does it permit call transfers, and who picks up when the agent transfers a call? The first determines whether adaptive interruption is on by default. The second often has to go through the client’s telecom team. The third determines who needs to receive the summary.

When reading FDE job descriptions in voice, look for terms such as telephony, SIP and contact center. On a résumé, specifics will persuade more than “experience with voice AI”: name the audio set you measured, the rate at which the agent stopped wrongly before and after a configuration change, and a warm transfer you ran through a real trunk.

A pleasant voice says little about a voice agent. Watch how it behaves in the second a caller cuts it off, and in the second it must hand the call to a person.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
6 sources
Read next on the roadmap · Stage 2: Broad engineeringDebezium reads the customer's log so you never rescan their tablesThe catch is a replication slot that can quietly fill the customer's production disk, plus snapshots and watermarks you must get right.