📍 Join the 1st DeepEval meetup in SF, this Friday 5pm PT. RSVP on Luma →
💥 Introducing JevEval: Jev-as-a-Judge for LLM evaluation. Read the post →
Voice AgentsAudio Defects

Echo

Beta
Multi-turn
Referenceless
Chatbot
Voice

The echo metric checks whether the agent's own voice comes back through the caller's side of the call, as when the caller's speaker is loud enough for their microphone to pick the agent up again. It returns the share of the agent's speech that wasn't heard back, between 0 and 1.

CallerAgent
0.0s / 4.5s

Required Arguments

To use the EchoMetric, you'll have to provide a ConversationalTestCase with audio on the test case: a stereo recording of the whole call, with the caller and agent on separate channels.

This full call audio is required, since an echo is only heard on the caller's own channel. Without it the metric is skipped. Mono full call audio is ignored, because the two voices can't be told apart. Set agent_channel="left" on the test case if the agent is on the left.

Usage

The EchoMetric() can be used for end-to-end evaluation of voice calls, such as ones produced by the ConversationSimulator in voice mode with record_call=True, which records the full call:

from deepeval import evaluate
from deepeval.dataset import ConversationalGolden
from deepeval.metrics import EchoMetric
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"),
        record_call=True,
    )
)
test_cases = simulator.simulate([golden])

metric = EchoMetric(threshold=0.8)
evaluate(test_cases=test_cases, metrics=[metric])

A simulated caller never plays the agent's voice back, so simulated calls are expected to pass. For a real call, attach its stereo recording as the test case's audio:

from deepeval.test_case import Audio, ConversationalTestCase, Turn

test_case = ConversationalTestCase(
    turns=[
        Turn(role="user", content="Can you look up order 4417?"),
        Turn(role="assistant", content="Sure, it's out for delivery today."),
    ],
    # One stereo file with both sides of the call
    audio=Audio(url="call.wav"),
)
metric.measure(test_case)

There are THREE optional parameters specific to the EchoMetric, on top of the common voice metric parameters:

  • [Optional] use_speech_detection: a boolean which when set to True, only counts a stretch when speech is detected in the agent's sound, so a chime or hold tone coming back isn't an echo. Defaulted to True.
  • [Optional] eval_mode: "deterministic" or "hybrid". In "hybrid", each echo 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 to HumeDecisionModel().

As a standalone

You can also run the EchoMetric 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 stretch of agent speech that came back shows up in score_breakdown as one event. Here is what the example call returns:

{
    "eligible_turns": 3,
    "turns_with_events": 1,
    "events": [
        {
            "type": "echo",
            "duration_seconds": 2.76,
            "start_time": 10.45,
            "mark": "whole_reply",
            "timing_source": "call_recording",
            "description": "Agent's voice echoed back from the caller's side",
            "reply_start": 10.0,
            "delay_seconds": 0.45,
            "level_db": -14.0,
        }
    ],
    "skipped": [],
    "timing_source": "call_recording",
}
FieldWhat it means
reply_startWhen the agent's echoed speech started, in seconds into the call
start_timeWhere the copy is heard on the caller's side: reply_start plus delay_seconds
duration_secondsHow long that stretch of agent speech lasted
delay_secondsHow long after the agent its voice came back on the caller's side
level_dbHow loud the copy was compared with the agent. 0 is as loud. Copies more than 17 dB down aren't counted

Every event also has the fields all voice events share, such as mark and description.

eligible_turns is how many stretches of agent speech were counted and turns_with_events how many came back. The score is the share that didn't.

How Is It Calculated?

The EchoMetric score is calculated according to the following equation:

Echo=Number of Agent Sound Stretches Not Heard BackTotal Number of Agent Sound Stretches of 1 Second or More\text{Echo} = \frac{\text{Number of Agent Sound Stretches Not Heard Back}}{\text{Total Number of Agent Sound Stretches of 1 Second or More}}

Counting agent sound

CallerAgentcountedtoo short0s2s4s6s8s

The metric checks each stretch of agent sound on the full call audio, not each reply. A gap under 0.3 seconds doesn't split a stretch, so a reply with longer pauses can be several stretches. Only stretches of 1 second or more are counted, since a shorter one is too little to match reliably.

Echo criteria

For each stretch, the metric looks for the same sound on the caller's channel, up to 1.75 seconds later. It compares only the timing of the two signals, so it doesn't matter how the phone line or the room changes the sound.

CallerAgentagent speakscomes back0s1s2s3s4s5s6s

A stretch came back when all of these hold:

CheckRule
DelayThe copy arrives 0.15 to 1.75 seconds after the agent, the round trip out of the caller's speaker and into their microphone
Stands outThe match is at least 12 times stronger than the typical match, so noise that happens to line up doesn't count. A stretch under 2 seconds needs 30 times, since a short match is noisier
Loud enoughThe copy is no more than 17 dB below the agent, in the speech band
Line loud enoughThe caller's line, where the copy is heard, is no more than 8 dB quieter than the agent
Not talked overThe caller's line is no more than 9 dB louder than the copy. Any louder means the caller is talking, so the match is chance or buried under their voice
SpeechWith use_speech_detection, at least half of the agent's stretch is speech, so a chime or hold tone coming back doesn't count

These limits come from real phone calls labelled by human reviewers, where leaks came back 0.25 to 1.7 seconds after the agent. Reviewers heard copies down to about 16 dB below the agent, and called copies on a caller's line more than 8 dB quieter "barely there".

If there's nothing to count, the metric is skipped.

Second check

In the hybrid eval mode, each echo is double-checked before it counts. The audio decision model hears the caller's side of the call where the copy was heard, the whole stretch and at least 5 seconds, and is asked:

Can the AI agent's own voice be heard echoed back on this caller's line?

If the model judges "no" more likely than "yes", the echo is dismissed and doesn't count against the score.

Example call

A call where the agent's voice leaks back through the caller's speaker during one reply.

CallerAgenttoo short0s5s10s15s
Agent soundWhat the caller's side hearsEcho?
2.5 – 5.3 sNothingNo
8.0 – 8.8 sUnder 1 second, not counted–
10.0 – 12.8 sA copy of the agent's speech 0.45 s later, 14 dB quieter, on a caller's line 7 dB quieter than the agentYes
14.0 – 16.3 sNothingNo
3 stretches1 echo → 2/3 = 0.67

FAQs

Is this the agent's fault?
Not directly. The leak comes from the caller's speaker and microphone, but it still harms the call: the caller hears a delayed copy of the agent, and the agent's own speech detection can hear itself and stop or reply to its own words.
Will the caller talking over the agent be reported as an echo?
Rarely. Sound on the caller's side only counts if it repeats the agent's sound at a steady 0.15 to 1.75 second delay and stands out clearly. The caller's own voice, or noise, lines up at random delays and is ignored. When the caller's line is more than 9 dB louder than the copy, the caller is talking, so the stretch isn't counted as an echo either.
How is this different from Audio Loop?
AudioLoopMetric catches the same chunk of audio played again in the agent's own stream. Echo looks for the agent's voice arriving on the caller's side.
Does this metric call an LLM or an external speech model?
Not by default. Detection is deterministic and runs locally over the full call audio, so it has no model or token cost. In the "hybrid" eval mode, each echo is also checked by an audio decision model, at one paid request per echo.

On this page