← Back to all 57 articles
Voice AIWebSocketsStreaming AudioFull Stack

Building Bol: Engineering a Low-Latency No-Code Voice Agent Studio

By Nabil Thange • Nov 2026 • 9 min read

In spoken human conversation, natural pauses hover between 200 and 450 milliseconds. If a conversational voice agent takes 1,200ms to respond, the human brain instinctively feels the delay as robotic friction. The interaction degrades from an organic dialogue into an awkward walkie-talkie exchange.

We built Bol (bol.new) to solve two fundamental challenges:
1. The Latency Floor: Compress speech-to-text, LLM inference, and text-to-speech audio streaming into a unified sub-500ms roundtrip pipeline.
2. The Accessibility Floor: Allow non-technical founders, sales operators, and customer support leads to design, test, and deploy production voice agents visually without touching raw WebSockets or telephony code.

Here is an inside look at how we engineered the audio pipeline and orchestration architecture behind Bol.


The Latency Anatomy of Voice Agents

A naive conversational voice loop performs sequential processing:
Capture Audio (800ms) → Send to STT API (400ms) → Wait for Full LLM Response (900ms) → Synthesize TTS Audio (500ms) → Playback = ~2,600ms.

At 2.6 seconds of total latency, conversational flow is completely broken.

Bol replaces this sequential chain with a fully pipelined streaming architecture:

[ User Speaks into Microphone ]
             │ (Live PCM Chunk Stream via WebSocket)
             ▼
   [ Silero VAD + Streaming STT ] ──► Token Stream Begins at 180ms
             │
             ▼ First 3 Words Emitted
   [ Speculative LLM Completion Engine ] ──► First Token Out at 290ms
             │
             ▼ First Sentence Clause Ready ("Hello! Thanks for calling...")
   [ Streaming TTS Audio Synthesizer ] ──► First Audio Chunk Emitted at 430ms
             │
             ▼
[ User Hears Voice Response: Total Latency 430ms ]

1. Zero-Jitter WebRTC and WebSocket Audio Streaming

HTTP request/response cycles are too slow for real-time bidirectional audio. Bol establishes a persistent duplex WebSocket connection using an optimized binary protocol:

// Bol Audio Stream Controller (Client-Side Audio Buffer)
export class VoiceStreamSession {
  private socket: WebSocket;
  private audioContext: AudioContext;

  constructor(endpointUrl: string) {
    this.socket = new WebSocket(endpointUrl);
    this.socket.binaryType = 'arraybuffer';
    this.audioContext = new AudioContext({ sampleRate: 16000 });
  }

  public streamAudioChunk(pcmData: Int16Array) {
    if (this.socket.readyState === WebSocket.OPEN) {
      this.socket.send(pcmData.buffer);
    }
  }

  public handleBargeIn() {
    // If user starts talking while bot is speaking, immediately clear playback buffer
    this.socket.send(JSON.stringify({ type: 'INTERRUPT_SIGNAL' }));
    this.audioContext.suspend().then(() => this.audioContext.resume());
  }
}

2. Solving Barge-In and Interruption Handling

In human conversation, people frequently interrupt to clarify details or interject agreements. If a voice bot continues speaking over the user for four seconds after the user starts talking, it creates immense frustration.

Bol solves this with an instant Barge-In Circuit Breaker:
1. Client-side Voice Activity Detection (VAD) monitors local microphone energy.
2. The instant speech energy cross-correlates with human vocal frequency bands for longer than 80 milliseconds, an INTERRUPT_SIGNAL packet is fired to the server.
3. The server immediately terminates the ongoing LLM token generation stream, drops the TTS buffer, and flushes the client's audio playback queue.
4. The bot falls completely silent within 60 milliseconds of the user speaking, feeling genuinely attentive.


3. The No-Code Node Graph Canvas

Behind the audio engine is a clean visual node canvas built with React Flow. Non-technical users can drag and drop:


What We Learned

1. Streaming Everything Is the Only Way: You cannot wait for a sentence to complete before generating audio. You must stream tokens to the TTS engine word by word or clause by clause.
2. Interruption Feels More Human than Accuracy: Users will tolerate minor speech recognition slips, but they will never tolerate a bot that talks over them without pausing.
3. No-Code Unlocks Real Enterprise Adoption: The best voice prompts are written by sales reps and support managers who talk to customers every day, not software engineers. Giving them a no-code studio creates superior bots.

NT

Written by Nabil Thange

19-year-old Full-Stack Developer & AI Engineer from Navi Mumbai. Winner of Hackhazards '26 and IIT Hyderabad hackathon. Specialized in Next.js 16, multi-agent AI architectures, and technical search optimization.