We Built an E-Commerce Store You Can’t Click. Here’s What Voice AI Actually Taught Us.

Try shopping for a red striped shirt without a search bar, filters, or an "Add to Cart" button.

That was the rule we set for our voice-commerce experiment: manual navigation is intentionally off-limits. You tap the mic once. After that, voice is the only way through the store.

Building a voice-only app sounds straightforward until you actually talk to it. A 3-second pause on a webpage is mildly annoying. A 3-second silence in a voice call feels broken.

Here is the honest log of how we built it—from a fragile WebSocket prototype to a tuned WebRTC voice agent—what broke along the way, and the trade-offs we accepted to keep the whole thing running on free tiers.

image-14.webp

Voice-only home screen: tap the mic once, then navigate the entire store by speaking.  

1. Where We Started vs. Where We Landed  

Version 1 (Late October): The DIY WebSocket Stack

Our first working version wired everything by hand:

  • Browser audio: Mic capture + client-side WASM VAD ( libfvad ) streaming raw PCM audio.

  • Transport: A custom WebSocket relay straight into our Express backend.

  • Pipeline: Deepgram Flux (STT + TTS) + a LangGraph agent (LLM + search, browse, and cart tools).

It worked in local demos. In real calls, it was rough. Audio glitched on weak connections, barge-in interruptions were clumsy, and because our backend sat on serverless functions, we even had to write a "session rollover" workaround just to keep calls alive past Vercel’s 4-minute execution cap.

Final Version (November): WebRTC + LiveKit Agents

We ripped out the custom WebSocket relay and moved the live audio loop onto WebRTC using LiveKit and LiveKit Agents:

  • Dedicated long-running voice worker off Vercel

  • Silero VAD + Deepgram Flux (STT & TTS) over one persistent connection

  • Thinker–Talker split between real-time speech and backend reasoning

  • Speculative early turns (starting backend work before the user's pause fully finishes)

2. WebSockets vs. WebRTC (and What the Benchmarks Actually Showed)  

When people talk about production Voice AI, LiveKit comes up for a reason: voice isn't chat text, and WebSockets were never built for live media.

  • WebSockets run over TCP. If one audio packet drops, TCP stalls everything behind it waiting for retransmission (head-of-line blocking). You also end up maintaining your own browser resampling, buffering, and echo workarounds.

  • WebRTC runs over UDP-first media tracks. It handles packet loss, jitter buffering, echo cancellation, and real-time audio routing natively—and LiveKit wraps that complexity with room state and agent turn handling.

image-17.webp

Measured median turn latencies: WebSocket (Nov 4) vs. LiveKit before tuning (Nov 5) vs. LiveKit after tuning (Nov 6).  

Here is the part most blog posts leave out: switching to LiveKit did not magically make us faster on Day 1.

Look at our median turn numbers across three builds:

Metric  

WebSocket (Nov 4)  

LiveKit — Before Tuning (Nov 5)  

LiveKit — After Tuning (Nov 6)  

Words → Audio

1.30 s

1.09 s

0.56 s  

First Audio

2.90 s

3.47 s

2.76 s  

Agent Finished

2.60 s

2.65 s

2.53 s  

 

Our first LiveKit cut actually regressed on First Audio ( 2.90 s → 3.47 s ). The real drop only came after we fixed what was happening inside the pipeline:

  • Reusing one TTS connection per call: The default plugin dropped and reconnected after every interruption. Switching to Deepgram's native  Interrupt message kept the socket warm.

  • Turning off markdown filtering: LiveKit's default text filter held back sentence-ending periods until more tokens arrived, stalling the first spoken sentence.

  • Cutting out dead air on simple actions: Commands like "next page" , "open three" , or "show cart" stopped making a second LLM roundtrip and switched to instant template replies.

That cut our Words → Audio lag by more than half—from 1.30 s down to 0.56 s.

3. The Two Changes That Made It Feel Human  

Raw speed alone doesn't make a voice agent feel natural. Two design choices mattered just as much as latency:

A. The Thinker–Talker Split     

In a standard tool-calling loop ( LLM → DB/Vector Search → LLM → TTS ), the user sits in silence while your database works. We separated the responsibilities:

  • The Talker (LiveKit voice worker) stays responsive in real time—handling barge-in, instant greetings, one-call confirmations ( "Showing the next 6" ), and immediately announcing searches ( "Looking for red striped shirts for men" ) the moment a search starts.

  • The Thinker (LangGraph backend) runs MongoDB facet counts, Pinecone vector search, and cart state updates in the background, streaming words back as soon as they're ready.

We also fixed a bunch of small, painfully real voice bugs along the way: requiring at least 1 heard word before interrupting (so a cough or speaker echo doesn't cut the assistant off), disabling false-interruption replay (so old audio doesn't talk over a shopper pausing mid-sentence), and adding domain keyterms so "M size" stops transcribing as "yum size" .

B. Designing a UI That You Can Talk To  

A normal e-commerce grid fails the second you remove the mouse. Nobody wants to say, "Add the Mark Taylor Men Red White Stripe Slim Fit Shirt in 40."

image-16.webp

Serially numbered product cards (1–6) let shoppers pick items by number instead of reading long titles aloud.  

So we threw out standard storefront patterns and designed a voice stage:

  • Serial numbering on every item (1 to 6): Shoppers just say "number two" or "add number two to my bag." That single UI choice solved the hardest UX problem in voice commerce.

  • Viewport-fitted pages: The browser measures how many cards fit cleanly on screen—no endless scrollbars to manage by voice.

  • Subtle voice cues: A small footer hint ( Say "show more" · "number two" to hear about one ) and a header fit badge ( Your fit: Men's topwear 40 ) keep people oriented without turning the store into a chat log.

image-15.webp

Voice-driven cart view showing remembered fit in the header and live spoken confirmation.  

4. The Free-Tier Reality Check (Models & Infra Trade-Offs)  

We built this project to stay as close to $0 infrastructure as possible. That forced real compromises—and it's worth being upfront about them.

Voice Models: Budget Cascade vs. Paid SOTA

We used a modular cascade (Silero VAD + Deepgram Flux STT/TTS + fast mid-tier LLMs via OpenRouter) instead of paying for top-end production voice models:

  • Ultra-low-latency TTS: Paid options like Cartesia Sonic (~40–90 ms time-to-first-audio, ~$49/1M chars) or ElevenLabs Flash/v4 (best emotional expressiveness, ~$40–80/1M chars) sound sharper and start faster.

  • Production STT: Paid tiers like Deepgram Nova-3, Cartesia Ink, or AssemblyAI Universal-3 Pro handle accents and noisy rooms more reliably.

  • Native Speech-to-Speech: Models like OpenAI Realtime API (~$32/$64 per 1M audio tokens) or Gemini Live skip the  STT → LLM → TTS relay entirely for sub-second, full-duplex tone and pacing.

Our trade-off: a 2.76 s median first audio instead of sub-second speech-to-speech, flatter vocal cadence, and working around free-tier ceilings. (We even had to drop LiveKit’s cloud adaptive interruption model after its free quota ran out mid-call and started ignoring "stop" and "wait" .)

Infrastructure: Hosting a Live Backend on Vercel

Our live voice worker runs on LiveKit Agents, while both the React frontend and Express API live on Vercel.

Honestly? Vercel isn't the ideal home for a real-time voice backend. It shines for static frontends and short-lived serverless routes—putting a stateful shopping API there means dealing with cold-start latency that directly shows up in a voice conversation. We did it anyway because the free tier let us ship and iterate without provisioning servers. If we ever opened this to real traffic, moving the API onto an always-warm container right next to the database would be change #1.

5. The Voice AI Glossary That Now Lives Rent-Free in Our Heads  

If you're coming from text chatbots, these are the voice-specific terms that end up running 80% of your debugging:

  • VAD (Voice Activity Detection): Spots when human speech starts or stops in an audio stream, separating real voice from silence and room noise.

  • EOT (End of Turn): The signal that a user actually finished their thought—not just paused to breathe—so the agent knows it's safe to reply.

  • Eager EOT (Speculative Turns): Triggering the backend the moment the user has probably finished speaking, then quietly discarding the work if they keep talking.

  • TD (Turn Detection): The coordination layer (mixing audio cues, pauses, and transcript context) that manages conversational handoffs without talking over the user.

  • Barge-in: Letting a shopper cut the agent off mid-sentence, stopping playback immediately, and tracking only the words they actually heard.

  • TTFA (Time to First Audio): The exact wait between the user finishing a sentence and hearing the first syllable back—the only latency number people actually feel.

  • AEC (Acoustic Echo Cancellation): Stripping the agent's own speaker output out of the microphone feed so it doesn't hear itself and interrupt its own reply.

  • Keyterm Prompting: Hinting domain-specific words (sizes, brands, "stop") to the STT model so "M size" stops transcribing as "yum size".

Building a voice-only store made one thing obvious: Voice AI is a systems-latency and UX problem way more than a prompt problem. Getting the model to answer accurately was week one. Making the conversation feel like it wasn't happening over a satellite phone took everything after that.

If you're building with LiveKit, WebRTC, or voice-first UIs—what ended up being your biggest latency bottleneck?  

Leave a comment

Your email address will not be published. Required fields are marked *