Case study · AI · Voice
Real-Time AI Voice Assistant
A production multi-tenant AI phone assistant that answers calls, holds natural conversations and routes intent in real time.
<800ms responsePipecatWebRTCFastAPIDeepgram
The challenge
A phone conversation with an AI only feels natural if the answer arrives in under a second and the agent handles interruptions. On top of that, the assistant had to serve several clients, each with its own flows and identity, over real phone lines.
The solution
- 01Real-time pipeline with Pipecat: Deepgram (STT) → GPT-4.1-mini (LLM) → Cartesia (TTS), with barge-in, end-of-turn detection and VAD.
- 02Telephony bridge PSTN ↔ WebRTC ↔ WebSocket: a broker drives headless Chromium (Playwright) running RingCentral's SIP/WebRTC WebPhone, with a custom PCM/WAV frame serializer.
- 03API-driven conversational flow engine that builds LLM nodes and handlers at runtime from JSON definitions, with episodic memory, per-client identity and prompt-injection protection.
- 044 Dockerized microservices (FastAPI, Express, NestJS and a headless browser) with real-time observability: live transcription and TTFB/token metrics.
Results
- Real-time voice pipeline (Deepgram → GPT-4.1 → Cartesia) with barge-in and end-of-turn detection.
- Serves 10 multi-tenant clients and 5K+ call minutes per month in production.
- New call flows ship without code changes via a JSON/API-driven flow engine.