Sofia — Real-time voice AI agent
Real-time voice AI agent
Sofia
- Python 3.12
- LiveKit Agents
- Deepgram Nova-3
- Claude Haiku 4.5
- Gemini 2.5 Flash
- ElevenLabs Flash
- Silero VAD
- PostgreSQL
- Docker
Overview
Sofia is a 24/7 AI voice receptionist for clinics. A caller dials a normal phone number and talks to a real-time agent that books, captures details, and hands off to a human when unsure — in natural speech, under a second and a half per turn.
Architecture
caller
STTDeepgram Nova-3
LLMClaude Haiku 4.5 · Gemini 2.5 Flash
TTSElevenLabs Flash
caller
~416 ms
~882 ms
~163 ms
~1.46 s
Highlights
- Real-time cascade: Deepgram Nova-3 (STT) → an LLM (Claude Haiku 4.5, with Gemini 2.5 Flash as a runtime-swappable failover) → ElevenLabs Flash (TTS), orchestrated over LiveKit.
- Median ~1.46s end-to-end latency per turn — measured and logged per turn (STT / LLM / TTS breakdown), because past ~1.5s callers assume voicemail and hang up.
- Idempotent tool-calling: the model calls save_caller_name once; a Postgres unique index enforces exactly one row per call, so retries can’t duplicate.
- Silero VAD + an LM end-of-turn detector decide when the caller has actually finished — no mid-sentence cut-offs.
- Typed (mypy --strict), ≥90% test coverage on business logic, Dockerized, CI-gated. EU-resident stack for GDPR.