Getting voice AI to converse naturally isn’t just a matter of training a smarter foundation model; it is fundamentally an infrastructure challenge. If you’ve ever interacted with earlier iterations of voice assistants, you are intimately familiar with the awkward conversational dance.
You speak, you pause, the AI attempts to guess if you are finished speaking, and invariably, it either cuts you off prematurely or takes three agonizing seconds to formulate a reply.
That latency stems directly from legacy turn-based architectures that rely heavily on a discrete “turn detector” to gate speech.
Building a genuinely responsive, real-time voice system one that feels alive, handles interruptions gracefully, and mirrors human conversational rhythm requires ripping out that turn detector entirely.
Over a highly focused six-month development sprint, achieving this level of performance meant completely rethinking model inference, isolating media transport, and transitioning entirely to a continuous, full-duplex streaming architecture.
Ditching the Turn Detector for Continuous Streaming
Historically, voice AI cascaded through three distinct, sequential phases: speech-to-text transcription, text-based LLM inference, and finally, text-to-speech generation.
Even as engineering teams shifted toward native speech-to-speech models to preserve tone and pacing, the core architecture remained stubbornly turn-based.
The system sat idle, waiting for a localized turn detector to make a binary decision on whether the user had stopped speaking before inference could even begin.
To achieve sub-second conversational responsiveness, a modern voice architecture must push audio directly into a full-duplex model. This structural shift means the system can listen to incoming audio frames and generate outbound speech simultaneously.
By placing the voice model in total control of the conversation, you eliminate the artificial start-stop latency entirely.
However, sustaining this continuous media loop introduces a massive orchestration hurdle. You cannot allow a slow database query, a complex agentic tool call, or a secondary LLM request to stall the audio playback. The architectural solution is establishing a hard, unyielding boundary.
The primary fast path is dedicated solely to moving audio between the client and the voice model. Everything else deep reasoning, API triggers, and application logic is pushed behind an asynchronous RPC boundary.
The voice model maintains the immediate conversational flow. It keeps the user engaged while frontier reasoning models handle complex tasks off the live path.
Engineering Resilient Media Flow and Stateful Handoffs
Delivering uninterrupted audio frames on schedule requires abandoning heavy, blocking execution frameworks. The team transitioned the media frontend and inference orchestration from Python asyncio to Go. This change significantly stabilizes production performance.
In practice, the backend shift smooths out frame delivery. The new system’s p95 latency now matches the previous architecture’s median (p50) times.
The optimized backend works alongside WebRTC on the client side. This allows the transport layer to handle real-world network degradation more effectively. It can dynamically stretch or accelerate audio to mask packet loss and clock drift.
Yet, the most complex challenge of maintaining a live voice session is managing stateful inference during extended interactions.
As users talk, context windows inevitably fill up. Standard context compaction is a computationally expensive operation because altering past context invalidates the model’s key-value (KV) cache.
Traditionally, rebuilding this state forces the system to pause the conversation, shattering the illusion of real-time interaction.
To engineer around this bottleneck, context compaction must be treated as a seamless background handoff.
When a current session approaches its token limit, the system spins up a parallel, warmed replacement model instance.
It compacts the historical context, prefills the new instance to fully rebuild the KV cache, and runs both models simultaneously.
Once the fresh instance is fully initialized and ready, the system executes a silent cutover. The media transport never drops a single frame, maintaining the uninterrupted flow of the application.
Source: Official OpenAI, "How We Built a Realtime System for Responsive Voice AI in Six Months"




