Knowledge > Integrations > LiveKit
LiveKit Integration
LiveKit Cloud provides the SIP gateway and real-time audio/session infrastructure for the ChurchWiseAI voice agent. It replaced the Cartesia LINE SDK as the primary voice agent platform in March 2026.
Account
| Field | Value |
|---|---|
| Provider | LiveKit Cloud |
| Dashboard | cloud.livekit.io |
| Account | john@churchwiseai.com |
| Project | cwa-voice-9x077mph |
| Agent ID | CA_pX3Me4NK6qK8 |
Architecture
Phone call
→ Twilio SIP trunk
→ LiveKit Cloud SIP gateway (cwa-voice-9x077mph.livekit.cloud)
→ Python agent worker on Railway (voice-agent-livekit/)
→ Routes by sip.trunkPhoneNumber → Church or Sales agent
LiveKit Cloud handles:
- SIP trunk termination (receives calls from Twilio)
- Room/session lifecycle management
- Audio transport between caller and agent
- Agent worker connection management
The Python agent worker (Railway) handles:
- Business logic: church routing, RAG, tools, LLM calls
- TTS via Cartesia Sonic (
livekit-plugins-cartesia) - STT via Deepgram (
livekit-plugins-deepgram) - LLM via Gemini 2.5 Flash / Claude Haiku 4.5
Framework
The agent uses LiveKit Agents SDK (livekit-agents~=1.5):
from livekit import agents, rtc
from livekit.agents import Agent, AgentSession, JobContext
from livekit.plugins import cartesia, deepgram, silero, noise_cancellation
Key plugins used:
| Plugin | Purpose |
|---|---|
livekit-plugins-cartesia | TTS — Cartesia Sonic voice synthesis |
livekit-plugins-deepgram | STT — speech-to-text transcription |
livekit-plugins-silero | VAD — voice activity detection |
livekit-plugins-noise-cancellation | Background noise filtering |
livekit-plugins-google | Gemini 2.5 Flash LLM |
livekit-plugins-anthropic | Claude Haiku 4.5 LLM |
SIP Trunk Setup
Each church phone number goes through a Twilio SIP trunk pointing to the LiveKit SIP gateway.
New church setup:
- Purchase Twilio number
- Run
voice-agent-livekit/scripts/setup_sip.pyto configure the Twilio → LiveKit SIP trunk - Insert
church_voice_agentsrow in Supabase with the phone number - Test with a live call
Environment Variables
| Variable | Where | Purpose |
|---|---|---|
LIVEKIT_URL | Railway | WebSocket URL: wss://cwa-voice-9x077mph.livekit.cloud |
LIVEKIT_API_KEY | Railway | LiveKit Cloud API key |
LIVEKIT_API_SECRET | Railway | LiveKit Cloud API secret |
Deployment
The agent worker auto-deploys from GitHub to Railway. No LiveKit-specific deploy step is needed — the worker connects to LiveKit Cloud automatically on startup.
# Deploy: push to GitHub main branch (Railway auto-deploys)
git push origin main
# Check agent status
railway logs --tail