A production-ready, multi-agent voice assistant built from scratch using LiveKit Agents SDK. Features consent collection, manager escalation with a different Cartesia voice, semantic turn detection, and multi-model fallback.
π Based on the workshop: Building Production-Ready Voice Agents with LiveKit
- π€ Real-time voice conversation via WebRTC (LiveKit)
- π§ Multi-model LLM fallback β OpenAI GPT-4.1 Mini β Google Gemini 2.5 Flash
- π£οΈ Multi-model STT fallback β AssemblyAI Universal Streaming β Deepgram Nova-3
- π Multi-model TTS fallback β Cartesia Sonic-3 β Inworld TTS-1
- π Background noise cancellation via LiveKit BVC
- π Semantic Turn Detection β no awkward mid-sentence interruptions (
MultilingualModel) - β‘ Preemptive generation for ultra-low latency responses
- β Consent Collection Task β legally compliant recording consent before call starts
- π¨βπΌ Manager Escalation β seamless handoff to
ManagerAgentwith a different Cartesia voice - ποΈ Full conversation history preserved across all agent handoffs
- π³ Docker support for containerized deployment
- βοΈ LiveKit Cloud deployment ready via
lkCLI
| Category | Provider | Model / Details |
|---|---|---|
| LLM (Primary) | OpenAI | gpt-4.1-mini |
| LLM (Fallback) | gemini-2.5-flash |
|
| STT (Primary) | AssemblyAI | universal-streaming:en |
| STT (Fallback) | Deepgram | nova-3 |
| TTS β Assistant | Cartesia | sonic-3 Β· voice 9626c31c-bec5-4cca-baa8-f8ba9e84c8bc |
| TTS β Manager | Cartesia | sonic-3 Β· voice 6f84f4b8-58a2-430c-8c79-688dad597532 |
| TTS (Fallback) | Inworld | inworld-tts-1 |
| VAD | Silero | β |
| Turn Detection | LiveKit | MultilingualModel (semantic) |
| Noise Cancellation | LiveKit | BVC |
| Infrastructure | LiveKit Cloud | WebRTC |
User joins room
β
βΌ
ββββββββββββββββββββββββ
β CollectConsent Task β ββ Asks for recording permission (Yes / No)
ββββββββββ¬ββββββββββββββ
β
Yes ββ€β No
β βββΊ Proceed without recording
βΌ
ββββββββββββββββββββββββ
β Assistant Agent β ββ Friendly CSR Β· Cartesia Voice 1
β β Handles general queries
ββββββββββ¬ββββββββββββββ
β
"I want a manager"
β
βΌ
ββββββββββββββββββββββββ
β Manager Agent β ββ Empathetic Manager Β· Cartesia Voice 2
β β Full chat history preserved β
ββββββββββββββββββββββββ
WORKSHOP-DEMO/
βββ livekit-voice-agent/
βββ agent.py # Main voice agent β all agent classes & entrypoint
βββ .env # API keys (not committed to git)
βββ .env.example # Environment variable template
βββ pyproject.toml # uv project config & dependencies
βββ uv.lock # Locked dependency versions
βββ Dockerfile # Docker container config
βββ .dockerignore # Docker ignore rules
βββ livekit.toml # LiveKit Cloud deployment config
βββ README.md # This file
- Python 3.11+
uvpackage manager- LiveKit Cloud account β cloud.livekit.io
- LiveKit CLI (
lk) β Install guide
git clone https://github.com/suyashsahu00/WORKSHOP-DEMO.git
cd WORKSHOP-DEMO/livekit-voice-agentuv synccp .env.example .envOpen .env and fill in your LiveKit credentials:
LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=your_api_key_here
LIVEKIT_API_SECRET=your_api_secret_hereπ Get your API keys here: LiveKit Cloud API Keys
Note: All model inference (OpenAI, AssemblyAI, Cartesia, Deepgram, Inworld) runs via LiveKit Cloud Inference β no separate API keys needed!
uv run agent.py consoleThen open LiveKit Agents Playground, connect to your room, and start talking!
uv run agent.py devdocker build -t livekit-voice-agent .docker run --env-file .env livekit-voice-agentlk cloud authlk agent deployLiveKit Cloud Dashboard β Agents β status should be Running β
| Commit | Message |
|---|---|
8b6f5ba |
feat: replace tech support persona with Dr. Sydney health assistant |
2f37fce |
feat: initialize project with uv dependency management and configuration files |
7c8876e |
feat: change Sydney persona from health assistant to weather girl |
febb85d |
feat: connecting voice agent to external services with MCP |
ef7aaf7 |
feat: implement production-ready LiveKit voice agent with semantic turn detection, fallback models, and manager escalation |
latest |
feat: add multi-agent voice system with consent workflow, manager handoff, and Cartesia TTS override |
- ImportError: Ensure you have run
uv syncto install all plugins listed inpyproject.toml. - API Key Errors: Double-check your
.envfile. EnsureGROQ_API_KEY,DEEPGRAM_API_KEY, andMURF_API_KEYare correctly set alongside your LiveKit credentials. - Voice Not Working: Some voices like "Tanushree" are premium on Murf AI. Ensure your API key has access to the requested voice and model (FALCON/GEN2).
- Network Issues: If running locally, ensure you have a stable internet connection as the STT, LLM, and TTS all communicate with cloud providers.
| Resource | Link |
|---|---|
| π Workshop Tutorial | Building Production-Ready Voice Agents with LiveKit |
| π LiveKit API Keys | cloud.livekit.io β API Keys |
| π LiveKit Agents Docs | docs.livekit.io/agents |
| π§ͺ Agents Playground | agents-playground.livekit.io |
| π¬ LiveKit Community | LiveKit Slack |
| βοΈ LiveKit Cloud | cloud.livekit.io |
MIT License Β© 2026 Suyash Sahu
This branch introduces several high-performance updates to the tech stack:
- π§ High-Performance LLM β Groq Llama-3.3-70b-versatile
- π£οΈ Ultra-fast STT β Deepgram Nova-2
- π Premium TTS β Murf AI (Tanushree Voice Β· FALCON Model)
| Category | Provider | Model / Details |
|---|---|---|
| LLM | Groq | llama-3.3-70b-versatile |
| STT | Deepgram | nova-2 |
| TTS | Murf AI | Tanushree (FALCON model) |
To use the features from this branch, get your keys from the following consoles and add them to your .env file:
- Groq: console.groq.com
- Deepgram: console.deepgram.com
- Murf AI: murf.ai/api
GROQ_API_KEY=your_groq_api_key_here
DEEPGRAM_API_KEY=your_deepgram_api_key_here
MURF_API_KEY=your_murf_api_key_here
