Core Capabilities & Features
| Feature | Implementation & Description |
|---|---|
| ποΈ Voice-First Interface | Real-time speech-to-text with Deepgram Nova-2 + ultra-expressive streaming text-to-speech with Cartesia Sonic over WebRTC via LiveKit Cloud. End-to-end latency kept under 650ms. |
| π€ AI Video Avatar | Tavus-powered photorealistic doctor avatar responds directly in video with synchronized lip motion, expressions, and human-like conversational presence. |
| π Calendar Booking | Interactive visual calendar UI enabling patients to inspect available specialist slots, select appointment times, and confirm reservations hands-free or via click. |
| π Session Memory | Identifies callers by phone number. Returning users immediately receive personalized greetings, access their medical history, and continue uninterrupted care. |
| π Auto Call Summary | Structured clinical summary generated dynamically after each session, logging symptoms, booked slots, patient preferences, and clinical timestamps. |
| π οΈ Live Tool Feedback | Visual on-screen pulse indicators display agent tool states in real time: "Fetching available slotsβ¦", "Verifying scheduleβ¦", "Booking confirmed β ". |
| π¬ Dual Transcript | Color-coded, real-time synchronized chat bubbles (caller on right in electric blue, agent on left in sleek charcoal glass) with auto-scroll. |
System Architecture & Data Pipeline
CareVoice AI coordinates a distributed real-time pipeline between a modern TypeScript frontend, a Python async token service, LiveKit's global WebRTC mesh, an autonomous Python Agent Worker, and a local persistence store.
ββββββββββββββββββββββββ HTTPS βββββββββββββββββββββββββββ
β React Frontend β βββββββββββββββββββββββΊ β Python Token Server β
β (Vite + TS) β β (aiohttp :8080) β
ββββββββββββββββββββββββ ββββββββββββ¬βββββββββββββββ
β β
β WebRTC (LiveKit SDK) LiveKit Cloud
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββΊ β
ββββββββββββΌβββββββββββββββ
β Python Agent Worker β
β (LiveKit Agents 1.x) β
β β
β STT: Deepgram β
β LLM: OpenAI GPT-4o β
β TTS: Cartesia β
β Avatar: Tavus β
ββββββββββββ¬βββββββββββββββ
β SQLite
ββββββββββββΌβββββββββββββββ
β voice_agent.db β
β users Β· appointments β
β time_slots Β· summaries β
βββββββββββββββββββββββββββ
1. Frontend Client (Vite + React + TS)
Provides zero-latency WebRTC media negotiation via the LiveKit Client SDK. Renders an adaptive UI with live audio visualizer waveforms, calendar slot picker, and interactive transcript.
2. Authentication & Token Server
An asynchronous Python microservice built on aiohttp generating cryptographically signed JWT tokens with granular room permissions and ephemeral identity management.
3. Autonomous Agent Worker
Built with LiveKit Agents 1.x, managing bidirectional audio streaming pipes. Performs Voice Activity Detection (VAD), calls tool functions for calendar manipulation, and orchestrates Tavus avatar video frames.
4. Relational State Store
A SQLite persistent store preserving callers, structured appointment records, provider schedules, and GPT-synthesized consultation notes with audit timestamps.
Engineering Highlights & Low Latency Optimizations
Sub-Second Voice Turnaround
Traditional voice agents suffer 2β3 second conversational lag. By streaming audio directly through Deepgram's websocket STT into GPT-4o's token streaming pipeline, chunked directly into Cartesia's neural audio engine, conversational interruption and turn-taking feel instantaneous.
Deterministic Function Calling
Engineered rigorous JSON function schemas for doctor schedule checking, patient identity verification, and appointment booking, preventing hallucinations while keeping responses empathetic and medical-compliant.
Audio-Visual Sync with Tavus
Synchronized streaming audio tracks with Tavus photorealistic avatar video tracks over WebRTC channels without desync or stutter under fluctuating network conditions.