AI-powered voice agents for phone calls and real-time conversations using LiveKit, OpenAI, Deepgram, and Cartesia.
- 🎙️ Real-time voice conversations with AI
- 📞 Telephony-optimized agent for phone calls
- 🗣️ Speech-to-Text powered by Deepgram Nova-3
- 🤖 LLM responses using OpenAI GPT-4o-mini
- 🔊 Text-to-Speech with Cartesia Sonic-2
- 🎯 Voice Activity Detection using Silero VAD
- 🔧 Function tools for dynamic capabilities
Simple voice assistant with:
- Class-based Agent architecture
- Turn detection for natural conversations
- Noise cancellation (LiveKit Cloud BVC)
- General purpose web/app use
Phone-optimized agent with:
- Telephony-specific audio settings (16kHz)
- Time-based personalized greetings
- Function tools (current time)
- Named agent for dispatch routing
-
Install dependencies
python3.12 -m venv venv source venv/bin/activate pip install "livekit-agents[deepgram,openai,cartesia,silero,turn-detector]~=1.0" \ "livekit-plugins-noise-cancellation~=0.2" \ "python-dotenv"
-
Configure environment variables
Create a
.env
file:LIVEKIT_URL=wss://your-livekit-server.livekit.cloud LIVEKIT_API_KEY=your_api_key LIVEKIT_API_SECRET=your_api_secret DEEPGRAM_API_KEY=your_deepgram_key OPENAI_API_KEY=your_openai_key CARTESIA_API_KEY=your_cartesia_key
python agent.py dev
python telephony_agent.py start
python telephony_agent.py dev
- Create a LiveKit Cloud account at livekit.io
- Create a new project and get your credentials
- Set up a dispatch rule to route calls to
telephony_agent
- Configure your SIP trunk for phone integration
Phone Call → LiveKit Cloud → Dispatch Rule → telephony_agent
↓
Speech Pipeline:
VAD → STT → LLM → TTS → Audio Output
- Python 3.9+
- LiveKit Cloud account
- API keys for Deepgram, OpenAI, and Cartesia
MIT