Real-Time Full-Duplex Voice Interaction Architecture and Engineering Practice
This article explains how real-time voice systems move from turn-based pipelines to full-duplex architectures. It covers streaming input and output, barge-in and pause handling, noisy telephony audio, layered system design, event protocols, backend model collaboration, and monitoring practices for low-latency, recoverable voice agents.
From Turn-Based Pipelines to Full Duplex
Traditional voice systems often use a cascade: voice activity detection, speech recognition, a text dialogue model, then speech synthesis. The modules are easy to swap, but three issues remain. Latency stacks because recognition, reasoning, and synthesis run in series. Errors propagate from ASR into understanding and replies. Turns are rigid: the system usually waits until the user “finishes,” so thinking pauses, barge-in, background noise, and multi-speaker settings feel unnatural.
Turn-based speech models may merge some stages, but they still assume one message in and one message out. If the user interrupts playback, the system typically stops and starts a new turn. Short pauses may be treated as turn ends. That is a poor fit for call centers, live assistants, and in-car interaction.
Full duplex is not just simultaneous send and receive. The system must keep processing input while generating output, with a session state machine coordinating input and output cursors, interrupt events, and tool-call state. Core capabilities include continuous streaming I/O, interruptible TTS, robustness to pauses and noise, and recoverable session context.
Key Design of Full-Duplex Voice Models
Continuous Streaming Input and Output
Audio should be sliced into continuous chunks. The input path is incremental; the output path is streaming synthesis. Playback can start from confirmed semantic fragments instead of waiting for a full sentence. Output must be interruptible: when the user starts speaking, stop playback quickly, record what was played and what was not, and write the interrupt into context. Full duplex is a state machine over input, output, context, and tools—not a stateless bidirectional pipe.
Interrupts, Pauses, and Turn Decisions
Interrupt handling should combine VAD, semantic completeness, recognition confidence, and business rules. Short “uh-huh” or “yes” may be backchannel or barge-in; judge using current playback, energy, duration, and intent. Distinguish thinking pauses from turn ends: wait briefly or ask a clarifying question for the former; only then reply for the latter. After an interrupt, support context rollback or marking so unplayed content is not treated as known to the user.
Noise Robustness and Telephony Audio
Real environments include noise, echo, narrowband phone audio, and jitter. Typical preprocessing is denoising, echo cancellation, AGC, and jitter buffering, plus dynamic VAD thresholds. Narrowband audio loses high-frequency detail, so recognition and synthesis should be more conservative. False triggers can be reduced with confidence gates, secondary confirmation, and silence-timeout re-asks. Weak-network fallbacks include lower bitrate, shorter output chunks, or text confirmation.
System Layers and Event Protocol
A practical split is: access, audio preprocessing, real-time speech inference, session orchestration, backend text reasoning and tool gateway, plus observability and security. Access handles bidirectional streams, auth, and tenant isolation. Preprocessing handles denoise, AEC, and chunking. Speech inference handles continuous understanding and streaming output. Orchestration owns the state machine, interrupt policy, and timeouts. The tool gateway handles permission checks, idempotent calls, and result summaries. Observability records event sequences, latency, and failures.
Events can be a generic stream, for example session.start, input.audio, output.audio, interrupt, tool.request, tool.result, error, session.end. Illustrative only:
session.start -> create session, load tenant policyinput.audio -> preprocess, incremental ASR, update input cursoroutput.audio -> stream playback, update output cursorinterrupt -> stop playback, mark barge-in, roll back unconfirmed output if neededtool.request -> async business tools with timeout and idempotency keytool.result -> summarize results for spoken outputerror -> retry, degrade, or end per policy
Define backpressure: cap audio buffers, throttle fast output, and under congestion prefer intelligibility over complete playback. Reconnect using a session ID to restore context. Tool calls must be idempotent to avoid duplicate orders or queries.
Telephony Voice Agents
Phone use cases demand tighter latency, robustness, and compliance. Audio must handle narrowband, echo, jitter, and noise. Interaction must support barge-in, silence waits, and repeated confirmation. Business queries, transactions, and tickets go to backend tools. The voice model handles live dialogue and spoken style; complex reasoning, retrieval, and tool planning stay with a backend text model. Tool results should be validated and summarized before TTS—do not read raw payloads.
Compliance needs recording notice, consent, log redaction, and tenant isolation. Sensitive fields are authorized only at the tool gateway, not in the voice layer. Security includes content review, tool timeouts, retry caps, circuit breakers, and an auditable event trail.
Division of Labor with Backend Text Models
The full-duplex voice layer fits real-time interaction, barge-in, tone, and pacing. The backend text model fits multi-step tools and long-context analysis. Do not forward raw audio or huge context; pass structured events, intent summaries, and tool results. Route by complexity: simple Q&A on the voice layer; complex work asynchronously on the backend, with spoken fillers such as “looking that up.” Tool results are authoritative; speak from summaries, and on failure say so and offer retry or human handoff.
Engineering Practice and Monitoring Checklist
Split an end-to-end latency budget across capture, preprocessing, speech inference, synthesis, network, and tools, with timeouts and fallbacks per stage. Capacity planning should cover concurrent streams, audio buffers, tool-gateway throughput, and tenant isolation. Useful metrics: time to first audio, barge-in response latency, false-interrupt rate, silence-timeout rate, audio stutter rate, tool success rate, error-recovery rate, and abnormal-session rate. Logs need trace IDs and redaction. Tests should cover noise, barge-in, weak networks, tool failure, and reconnect.
Check: events are replayable; interrupts can stop, mark, and roll back; backpressure and buffer caps exist; tools are idempotent and circuit-breakable; there are degrade and human-handoff paths; recording consent and log redaction are met. Low-latency, recoverable, observable voice agents come from designing the real-time speech model, session state machine, backend reasoning, and tool gateway as one system.
