Voice Platform Decision — March 25, 2026
Status: DECIDED Decision: Migrate from Cartesia LINE managed hosting to Pipecat Cloud + Twilio + Cartesia TTS Timeline: 2-3 weeks for migration, begin immediately
Why We're Moving
Cartesia LINE is the wrong layer for phone infrastructure:
- 40% call failure rate when Twilio
<Dial>forwards to Cartesia numbers - No Twilio BYOT support ("on our short-term roadmap" with no ETA)
- No Canadian phone numbers (US auto-assigned only)
- SDK 0.2.3 is pre-1.0 with breaking changes (0.2.4 broke all calls)
- Managed cloud had a 5-day outage (wrapper crash + SDK breaking change)
- Status page showed 100% during actual outage
- Churches will print phone numbers on bulletins, websites, Google Business profiles — numbers must be stable and owned by us
What We Keep
- Cartesia Sonic TTS — Best voice quality in the market. Stays as our TTS provider.
- Cartesia Ink STT — Stays as our STT provider (or swap to Deepgram if needed).
- All agent code — Prompts, tools, HEAR protocol, crisis detection, RAG, multi-tenant routing, demo handoffs. 80% ports directly to Pipecat.
- All Twilio numbers — Toll-free, US demo, CA demo. They stay in Twilio where we own them.
Target Architecture
Caller
→ Twilio number (we own it — US, Canadian, toll-free)
→ Twilio Media Streams (WebSocket audio)
→ Pipecat Cloud (our voice server)
├── Agent orchestration (our Python code)
├── Cartesia Sonic TTS (voice generation)
├── Cartesia Ink STT (speech recognition)
├── Gemini 2.5 Flash / Claude Haiku (LLM)
├── Supabase (church data, call logs, tools)
└── Turn processing (moderation, barge-in, crisis)
→ Twilio Media Streams (audio back to caller)
→ Caller hears response
Key difference from today: Twilio is the phone platform. Cartesia is just the voice. Pipecat orchestrates. We control everything.
Why Pipecat
| Criteria | Cartesia LINE | Vapi | Retell | Pipecat Cloud |
|---|---|---|---|---|
| Twilio native | No (BYOT "on roadmap") | Yes (SIP) | Yes (SIP) | Yes (Media Streams) |
| Canadian numbers | No | Via Twilio | Via Twilio | Via Twilio |
| Our code runs as | Python on their cloud | Webhooks (rewrite) | WebSocket (rewrite) | Python native (port) |
| Cartesia voices | Built-in | Supported | Supported | Plugin available |
| Migration effort | Already built | 8-12 weeks | 6-8 weeks | 2-3 weeks |
| Cost at scale | $0.06/min | $0.15-0.33/min | $0.13-0.31/min | $0.06-0.10/min |
| Reliability | 55+ incidents/8mo | 63 incidents/90d | 99.99% claimed | Daily.co backed |
| Multi-agent handoff | Native | Squads | Not native | Python native |
| Code portability | N/A | ~20% | ~30% | ~80% |
What Changes
| Component | Current (Cartesia LINE) | Target (Pipecat) |
|---|---|---|
| Phone numbers | Cartesia auto-assigned | Twilio owned (US + CA) |
| Audio transport | Cartesia internal | Twilio Media Streams |
| Agent framework | LINE SDK VoiceAgentApp | Pipecat Pipeline |
| TTS | Cartesia Sonic (built-in) | Cartesia Sonic (plugin) |
| STT | Cartesia Ink (built-in) | Cartesia Ink or Deepgram (plugin) |
| Hosting | Railway + cartesia connect | Pipecat Cloud |
| Deploy | git push + cartesia connect | git push to Pipecat Cloud |
| Barge-in | LINE SDK handles | Pipecat VAD + transport handles |
| Turn processing | Our TurnProcessor class | Ports to Pipecat event pipeline |
| Tool calling | @loopback_tool decorator | Pipecat tool/function pattern |
| Call routing | session.py PHONE_REGISTRY | Same logic, Twilio webhook layer |
What Ports Directly (~80%)
- All prompts (sales, church, care, demo) — text, no framework dependency
- All tool implementations (prayer, callback, visitor, giving, Cal.com, PCO)
- Product knowledge loading (session.py)
- Church data loading (supabase_church.py)
- Phone registry routing (session.py)
- Crisis detection and moderation logic
- HEAR protocol
- Demo church handoffs
- Repeat caller history
- Datetime context builder
- SMS link sending
- Email notifications
What Needs Rewriting (~20%)
main.py→ Pipecat pipeline setup (replaces VoiceAgentApp)turn_processor.py→ Pipecat event handlers (replaces LINE event loop)- Agent handoff mechanism → Pipecat's transfer pattern
- Audio barge-in handling → Pipecat VAD configuration
- Dockerfile → Pipecat Cloud deploy config
- Health check endpoint → Pipecat Cloud health
Cost Comparison
At Launch (10 churches, ~1,500 min/month)
| Current (LINE + Railway) | Target (Pipecat Cloud) | |
|---|---|---|
| Platform | $299 (Cartesia Scale) + $30 (Railway) | ~$15 (Pipecat hosting) |
| Cartesia TTS/STT | Included | ~$50 (API credits) |
| LLM | ~$30 | ~$30 |
| Twilio | ~$20 | ~$20 |
| Total | ~$380/mo | ~$115/mo |
At Scale (500 churches, ~75K min/month)
| Current | Target | |
|---|---|---|
| Platform | $299 + $50 | ~$500 |
| Cartesia TTS/STT | Included in $299 | ~$2,400 |
| LLM | ~$1,500 | ~$1,500 |
| Twilio | ~$640 | ~$640 |
| Total | ~$5,500/mo | ~$5,040/mo |
Migration Plan
Week 1: Foundation
- Set up Pipecat Cloud account
- Build Pipecat pipeline equivalent of main.py
- Port session.py (routing, caching, Supabase)
- Port TurnProcessor to Pipecat event handlers
- Configure Cartesia Sonic TTS + Ink STT plugins
- Test basic call flow: Twilio → Pipecat → Cartesia voice → response
Week 2: Agent Logic
- Port all agent builders (Sales, Demo Router, Coordinator, Care)
- Port all 46 tools
- Port multi-agent handoff (Sales→Demo, Coordinator→Care)
- Port product knowledge + RAG injection
- Test all demo churches (Grace Community, St. Joseph)
Week 3: Production
- Port crisis detection + moderation
- Port notification system (email, SMS)
- Test with all Twilio numbers (toll-free, US demo, CA demo)
- Run full test suite (600 Python tests adapted)
- Parallel run: old system + new system
- Cut over
Immediate Next Steps
- Save this decision document
- Send Cartesia support ticket (reliability issue documentation)
- Sign up for Pipecat Cloud
- Read Pipecat docs + examples (especially Twilio Media Streams + Cartesia plugins)
- Begin Week 1 migration
The Strategic Principle
Own your phone numbers. Own your routing. Own your business logic. Rent your voices.
Cartesia makes beautiful voices. Let them do that. Don't let them own your church phone numbers, your call routing, or your uptime.