Skip to main content

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

FieldValue
ProviderLiveKit Cloud
Dashboardcloud.livekit.io
Accountjohn@churchwiseai.com
Projectcwa-voice-9x077mph
Agent IDCA_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:

PluginPurpose
livekit-plugins-cartesiaTTS — Cartesia Sonic voice synthesis
livekit-plugins-deepgramSTT — speech-to-text transcription
livekit-plugins-sileroVAD — voice activity detection
livekit-plugins-noise-cancellationBackground noise filtering
livekit-plugins-googleGemini 2.5 Flash LLM
livekit-plugins-anthropicClaude 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:

  1. Purchase Twilio number
  2. Run voice-agent-livekit/scripts/setup_sip.py to configure the Twilio → LiveKit SIP trunk
  3. Insert church_voice_agents row in Supabase with the phone number
  4. Test with a live call

Environment Variables

VariableWherePurpose
LIVEKIT_URLRailwayWebSocket URL: wss://cwa-voice-9x077mph.livekit.cloud
LIVEKIT_API_KEYRailwayLiveKit Cloud API key
LIVEKIT_API_SECRETRailwayLiveKit 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

See Also