Real-Time AI Voice Lead-Qualification Bot
Sub-second bidirectional voice pipeline connecting Gemini Live, Plivo telephony, and MiClient CRM.
01 // Problem Statement
Traditional lead qualification relied on manual phone calls, resulting in delayed response times, inconsistent lead qualification data, and high labor costs for initial outbound outreach.
02 // Technical Constraints
- Sub-second audio round-trip latency [ADD: target audio latency ms] for natural conversation flow without overlap.
- Bidirectional streaming socket resilience over lossy cellular phone connections.
- Strict strict zero-data-loss execution for customer CRM state updates during call execution.
Executive Summary
At MiClient, sales teams needed immediate automated outreach to qualify inbound leads the moment they filled a contact form or triggered a campaign. Manual calling introduced multi-hour latency.
I designed and engineered an end-to-end real-time voice bot integrating Google Gemini Live with Plivo telephony and our microservices architecture.
System Architecture
[Inbound Phone Call / Plivo Webhook]
│
▼
[Plivo Telephony Gateway]
│ (Bidirectional Audio WebSocket / PCM 8kHz)
▼
[FastAPI Orchestrator Service]
│ │
▼ ▼
[Gemini Live API] [Background Worker Queue]
(Real-time Audio) │
▼
[MiClient CRM Core]
Key Technical Achievements
- Low-Latency Audio Pipeline: Streamed 8kHz PCM audio directly between Plivo’s media streams and Gemini Live’s WebSocket interface using custom asynchronous Python state machines.
- Dynamic Tool Calling: Allowed the AI voice agent to query CRM availability slots and trigger instant SMS / email follow-ups while remaining on the line.
- Structured Entity Extraction: Post-call asynchronous transcription parsing that updates deal metadata, lead score, and next follow-up action with confidence scoring.
03 // Key Decisions & Trade-offs
Direct WebSocket Audio Streaming vs HTTP Polling
Used raw PCM audio streaming over persistent WebSockets directly between Plivo and FastAPI worker nodes, bypassing traditional HTTP request cycles to minimize latency [ADD: streaming chunk size ms].
Asynchronous CRM State Mutation
Decoupled voice conversation execution from database write cycles by queueing structured extracted entities into background workers, keeping the main voice audio loop non-blocking.
04 // Measurable Results
- Automated inbound lead qualification calls with real-time intent classification.
- Captured structured qualification fields direct into CRM without human intervention.
- Maintained audio streaming stability under concurrent call volume [ADD: peak concurrent calls].
05 // What I'd Do Next
- Implement fallback voice model routing during provider outage windows.
- Add dynamic audio jitter buffer sizing based on real-time packet loss metrics.