Agent Interruption
The agent interruption metric checks whether your voice agent starts speaking over the caller: either a false start, where it starts as the caller speaks and then backs off, or a talk-over, where it keeps going. It returns the share of the agent's starts that interrupted no one, between 0 and 1.
Required Arguments
To use the AgentInterruptionMetric, you'll have to provide a ConversationalTestCase with at least one of:
audioon the test case, a 16-bit stereo WAV recording of the whole call*audioon the caller's and agent's turns, each with astart_time
* Full call audio has to be a 16-bit stereo WAV, with the caller and agent on separate channels. Mono full call audio is ignored, because the two voices can't be told apart, and so is audio in any other format, such as MP3.
See How Is It Calculated for how each is used.
Usage
The AgentInterruptionMetric() can be used for end-to-end evaluation of voice calls, such as ones produced by the ConversationSimulator in voice mode:
from deepeval import evaluate
from deepeval.dataset import ConversationalGolden
from deepeval.metrics import AgentInterruptionMetric
from deepeval.simulator import ConversationSimulator
from deepeval.voice import ElevenLabsConnector, VoiceConfig
golden = ConversationalGolden(
scenario="The user asks the agent to look up an order by its number.",
expected_outcome="The agent reads back the order status.",
)
simulator = ConversationSimulator(
voice_config=VoiceConfig(
connector=ElevenLabsConnector(agent_id="your-agent-id"),
)
)
test_cases = simulator.simulate([golden])
metric = AgentInterruptionMetric(threshold=0.8)
evaluate(test_cases=test_cases, metrics=[metric])There are FOUR optional parameters specific to the AgentInterruptionMetric, on top of the common voice metric parameters:
- [Optional]
max_caller_silence_seconds: an integer for how long, in seconds, the caller must have been silent before a collision is excused instead of counted as a false start, since after a long silence the agent is expected to fill it. Must be greater than 0. Defaulted to4. - [Optional]
use_speech_detection: a boolean which, when set toTrue, only counts the caller as talking when speech is detected, so background noise isn't mistaken for the caller. With per-turn audio it's also used to find the agent's speech. Defaulted toTrue. - [Optional]
eval_mode:"deterministic"or"hybrid". In"hybrid", each interruption is double-checked by an audio decision model before it counts. Defaulted to the configured voice eval mode ("deterministic"unless set). - [Optional]
audio_decision_model: the model that does the second check in"hybrid"mode. Defaulted toHumeDecisionModel().
As a standalone
You can also run the AgentInterruptionMetric on a single test case as a standalone, one-off execution:
metric.measure(test_cases[0])
print(metric.score, metric.reason)
print(metric.score_breakdown)See Events for what score_breakdown contains.
Events
Each start where the agent interrupted shows up in score_breakdown. Here is what the example call returns:
{
"eligible_turns": 5,
"turns_with_events": 2,
"events": [
{
"type": "false_start",
"duration_seconds": 1.0,
"start_time": 10.8,
"mark": "range",
"timing_source": "call_recording",
"description": "Agent started over the caller, then stopped",
"reply_start": 10.8,
"agent_seconds": 1.0,
"overlap_seconds": 1.0,
},
{
"type": "talk_over",
"duration_seconds": 2.0,
"start_time": 17.6,
"mark": "range",
"timing_source": "call_recording",
"description": "Agent talked over the caller for 2.0s",
"reply_start": 17.6,
"agent_seconds": 3.0,
"overlap_seconds": 2.0,
},
],
"skipped": [],
"timing_source": "call_recording",
}| Field | What it means |
|---|---|
type | False start or talk-over. False start when both apply |
reply_start | When the agent started, in seconds into the call |
agent_seconds | How long the agent kept speaking |
overlap_seconds | How much of that the caller was also talking |
start_time | Where both started talking at once |
duration_seconds | How long both talked at once. The agent's whole stretch if the caller never spoke inside it |
Every event also has the fields all voice events share, such as mark and description. With per-turn audio, events carry turn, the index of the agent turn, instead of reply_start.
eligible_turns is how many agent starts were checked and turns_with_events how many interrupted the caller. The score is the share that didn't.
How Is It Calculated?
The AgentInterruptionMetric score is calculated according to the following equation:
With per-turn audio instead of full call audio, the metric finds the speech inside each clip and places it on the call's clock by the clip's Audio.start_time, then finds starts the same way. Events carry the agent turn's index, turn, instead of reply_start.
Counting agent starts
A start is a timed reply: the agent starting to speak after at least 1 second of its own silence. The agent's opening line, spoken before the caller made any sound, isn't counted. When the caller opens the call, the agent's first start is checked like any other.
Interruption criteria
An agent start is an interruption when it's a false start or a talk-over:
- False start: the caller is already talking, or starts within 0.5 seconds after the agent, and the agent stops within 1.5 seconds.
- Talk-over: the caller is already talking, and makes 1 second or more of sound while the agent keeps speaking.
| Check | Rule |
|---|---|
| Caller already talking | Caller sound in at least 0.2 of the 0.3 seconds before the agent starts |
| Collision | The caller starts within 0.5 seconds after the agent |
| Backs off | The agent stops within 1.5 seconds |
| Talks over | 1 second or more of caller sound during the agent's stretch |
A collision isn't counted as a false start when the caller had been silent for more than max_caller_silence_seconds (4 seconds by default) before it, since the agent is expected to fill a long silence. This never excuses a talk-over, or an agent that starts while the caller is already talking.
When the two start within 0.5 seconds of each other, the moment belongs to this metric. A caller cutting in once the agent has been talking for longer is judged by User Interruption, so the two never flag the same moment.
If there's nothing to count, the metric is skipped.
Second check
In the hybrid eval mode, each interruption is double-checked before it counts. The audio decision model hears about 5 seconds of the caller's audio around it, to confirm the caller was really talking when the agent cut in, and is asked:
Is a person speaking in this clip, rather than only background noise, breathing or silence?
If the model judges "no" more likely than "yes", the interruption is dismissed and doesn't count against the score.
Example call
A call where the agent sometimes starts over the caller. Each row is one agent start and whether it interrupted the caller.
| Agent start | What the caller was doing | Interruption? |
|---|---|---|
| 0.2 s | Hadn't spoken yet | Not counted |
| 5.8 s | Finished at 5.0 s | No |
| 10.8 s | Talking; the agent stopped after 1.0 s | Yes (false start) |
| 13.0 s | Finished at 12.0 s | No |
| 17.6 s | Talking; both talked for 2.0 s | Yes (talk-over) |
| 22.0 s | Finished at 19.6 s | No |
| 5 starts | 2 interruptions → 3/5 = 0.6 |
FAQs
What if my turn timestamps are inaccurate?
audio and the metric ignores the turn timestamps. With per-turn audio, silence at the edges of a clip is fine, since the metric listens for the speech inside it. A wrong start_time still moves the speech, though, and can report an interruption that didn't happen. Listen to a flagged moment before acting on it.How is this different from turn-taking naturalness?
Does this metric call an LLM or an external speech model?
use_speech_detection on, it runs the small Silero VAD model locally. In the "hybrid" eval mode, each interruption is also checked by an audio decision model, at one paid request per interruption.