Skip to main content

Knowledge > Runbooks > Deployment > Deploy Voice Agent

Deploy the LiveKit Agents Voice Agent

Deploy an updated version of the multi-tenant voice agent. The Python agent worker runs on Railway (auto-deploys from git push to main). LiveKit Cloud connects to the worker automatically — no separate CLI connect step is required.

Deploy Steps

  1. Push code changes to GitHub main branch (Railway auto-deploys from GitHub):
    git add voice-agent-livekit/
    git commit -m "feat(voice): describe your change"
    git push origin main
  2. Monitor Railway deploy: check Railway dashboard or railway logs
  3. LiveKit Cloud agent config: no redeploy needed — the agent worker connects automatically once Railway is running

Environment Variables

Set via Railway dashboard or railway variables set KEY=VALUE:

VariableValue / Notes
LIVEKIT_URLLiveKit Cloud WebSocket URL: wss://cwa-voice-9x077mph.livekit.cloud
LIVEKIT_API_KEYLiveKit Cloud API key
LIVEKIT_API_SECRETLiveKit Cloud API secret
CARTESIA_API_KEYStill needed for TTS (Cartesia Sonic via livekit-plugins-cartesia)
DEEPGRAM_API_KEYFor STT (Deepgram via livekit-plugins-deepgram)
SUPABASE_URLProduction Supabase URL
SUPABASE_SERVICE_ROLE_KEYService role key (required for DB writes from tools)
GEMINI_API_KEYCoordinator LLM + call classification
ANTHROPIC_API_KEYCare Agent LLM (Claude Haiku 4.5)
OPENAI_API_KEYEmbedding generation (text-embedding-3-small for RAG)
TWILIO_ACCOUNT_SIDSMS sending from tools
TWILIO_AUTH_TOKENSMS auth
TWILIO_PHONE_NUMBERSMS from-number

SIP Trunk

Twilio SIP trunks forward calls to the LiveKit Cloud SIP gateway. New church phone numbers need:

  1. Twilio number purchased
  2. SIP trunk configured to forward to LiveKit Cloud SIP gateway URL (from LiveKit Cloud project settings for cwa-voice-9x077mph)
  3. church_voice_agents row inserted in Supabase with the phone number

Run scripts/setup_sip.py to configure a new Twilio → LiveKit SIP trunk connection.

Verification

After deployment:

  • Railway build completes successfully (check Railway dashboard)
  • Test call connects and routes to the correct church agent
  • Agent greets caller with the church's name (not "ChurchWiseAI")
  • Prayer request, callback, and visitor capture tools respond correctly
  • voice_call_logs table shows a new entry with status = 'completed'
SELECT id, church_id, created_at, duration_seconds, status
FROM voice_call_logs
ORDER BY created_at DESC
LIMIT 5;

Rollback

The voice agent does not have a one-click rollback. To rollback:

  1. Revert the code change and push to main:

    git revert HEAD
    git push origin main

    Railway will auto-deploy the reverted code. LiveKit Cloud reconnects automatically once the new Railway service is running.

  2. Verify calls are routing correctly again.

See Also

  • rollback.md — general rollback guidance
  • C:\dev\churchwiseai-web\voice-agent-livekit\main.py — entry point and agent routing
  • C:\dev\churchwiseai-web\voice-agent-livekit\verticals\church\agents.py — church agent builders
  • voice-agent-debug.md — if the deploy causes call issues