An AI Therapy Hotline for Engineers (Because We're Clearly Not Okay)
How I Over-Engineered a Weekend Project Into a Real-Time Voice AI That Tells Me My ETL Failures Are "Beautiful"
It's 3 AM, and I'm staring at a failed Dagster job for the fourth time this week. The error message is mocking me. At this point, I'm not just questioning my code; I'm questioning my life choices. You know the feeling.
So, I did what any sane engineer would do. I built an AI-powered phone hotline that provides personalized affirmations for people like us.
Yes, you read that correctly. I spent a weekend building a system where you can call a phone number, complain about your broken Kubernetes cluster, and have an AI therapist with a posh British accent tell you that "your infrastructure is code poetry written in YAML."
The fact that this seemed like a reasonable use of my time probably says more about the state of our industry than I’m comfortable admitting.
The Problem: We've Seen Things
Let's be honest—we're all walking around with some form of engineering PTSD. We've seen CSS that works perfectly in Chrome but self-destructs in Safari. We've witnessed database migrations that looked fine in staging, only to bring down production. We've all been haunted by the ghost of a Docker container that "worked on my machine."
We need therapy, but a traditional therapist's eyes would glaze over the moment you mention that your build pipeline feels like a personal attack. What we need is someone who gets it. Someone who understands that, yes, schema drift is genuinely traumatic, and having anxiety dreams about merge conflicts is perfectly normal.
So naturally, I built an AI for it. If you're going to have an existential crisis about your code, you might as well automate the solution.
The Solution: Real-Time Voice AI Therapy (Because of Course)
The Engineering Affirmations Hotline is a voice AI system that provides specialized therapy for different kinds of engineers. You call the number, vent about your engineering woes, and get personalized wisdom from something that actually understands your pain.
Here's what makes this particularly unhinged: it's not just a chatbot. It’s a real-time voice AI pipeline that processes your speech, generates a contextual response, and talks back to you with the patience of a zen master who has seen every possible way a deployment can fail.
Architecture: Because I Can't Help Myself
Of course, I couldn't just build a simple phone bot. That would have been too easy. No, I had to architect a distributed system with multiple AI services, real-time audio streaming, and WebSocket connections. Because when engineers build therapy, we still over-engineer it. It's just what we do.
Here’s the high-level (and completely over-the-top) architecture:
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Phone Call │◄──►│ Twilio Service │◄──►│ FastAPI Server │
│ │ │ │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌─────────────────────┐
│ │
│ Pipecat Pipeline │
│ │
└─────────────────────┘
│
┌─────────────┬─────────────────────┼─────────────────────┬─────────────┐
│ │ │ │ │
▼ ▼ ▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │ │ │ │ │
│ WebSocket │ │ Deepgram STT │ │ OpenAI LLM │ │ Cartesia TTS │ │ WebSocket │
│ Input │ │ Service │ │ Service │ │ Service │ │ Output │
│ │ │ │ │ │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘ └─────────────────┘ └─────────────────┘
I know, it's a lot. But hear me out. When you're building therapy for engineers, the architecture itself needs to be therapeutic. Look at how clean those connections are! That beautiful separation of concerns! This is how we cope.
The Pipeline: From Trauma to Affirmation in Under 4 Seconds
The actual data flow is surprisingly elegant, if I do say so myself:
Audio Input → STT → Context Aggregation → LLM → TTS → Audio Output
↓ ↓ ↓ ↓ ↓ ↓
Raw Audio Text Conversation Response Audio Phone
Frames Frames Context Text Frames Speaker
When you call and say, "My ETL pipeline failed again," here’s what happens:
- Twilio gets your call and streams the audio over a WebSocket.
- Deepgram's STT turns your suffering into text:
"My ETL pipeline failed again"
. - My Context Aggregator adds it to the conversation history (because even an AI therapist needs context).
- OpenAI's GPT-4 crafts a response like: "Ah, dear Data Engineer, your ETL pipeline failure is not a defeat—it's a data transformation ritual gone temporarily astray. Your resilience shows the heart of a true data guardian."
- Cartesia's TTS turns this wisdom into a soothing, British-accented voice.
- Twilio plays it back to you while you sit in your kitchen at 3 AM, questioning your life choices.
The whole round trip takes about 2-4 seconds, which is faster than most of our deployment pipelines and infinitely more emotionally supportive.
Technical Implementation: The Gory Details
The core of this thing uses Pipecat (opens in a new tab), which is basically a Swiss Army knife for real-time AI pipelines. It handled the WebSocket connection, frame serialization, and service orchestration without me having to write a ton of boilerplate.
# Yes, this is the actual code that makes the magic happen
pipeline = Pipeline([
websocket_transport.input(), # Audio from your phone
stt, # Speech to text
context_aggregator.user(), # Add your trauma to the context
llm, # Generate some wisdom
tts, # Turn it into a soothing voice
websocket_transport.output(), # Back to your phone
context_aggregator.assistant(), # Remember what it said
])
And check out this transport configuration. Voice Activity Detection! For a therapy hotline! Because I apparently can't build anything without at least three layers of machine learning.
transport = FastAPIWebsocketTransport(
websocket=websocket,
params=FastAPIWebsocketParams(
serializer=TwilioFrameSerializer(stream_sid),
vad_enabled=True, # Voice Activity Detection
vad_analyzer=SileroVADAnalyzer(), # AI-powered silence detection
vad_audio_passthrough=True, # So it doesn't interrupt your venting
),
)
Performance: Surprisingly Good for a Weekend Hack
The latency is actually not terrible:
- STT TTFB: ~0.5-1.0 seconds (Deepgram is fast)
- LLM TTFB: ~0.5-1.0 seconds (GPT-4o-mini is surprisingly quick)
- TTS TTFB: ~0.17-0.22 seconds (Cartesia is lightning fast)
- Total Pipeline: ~2-4 seconds end-to-end
That’s faster than most of our stand-up meetings and infinitely more productive.
The cost is also pretty reasonable for what is essentially on-demand AI therapy:
- Total cost: ~$0.03-0.04 per minute
- OpenAI: ~$0.01-0.02 per minute
- Deepgram: ~$0.0043 per minute
- Cartesia: ~$0.005 per minute
- Twilio: ~$0.013 per minute
It's cheaper than actual therapy and available 24/7. I should probably add that to the disclaimer.
The Sequence Diagram: Because Diagrams Are Calming
Here’s the full interaction flow, because nothing says "I'm taking this seriously" like a proper sequence diagram.
Look at that beautiful flow. Each step has a clear purpose, the error handling is graceful, and the WebSocket cleanup is properly managed. If this were a pull request, I'd approve it.
Real-World Usage: People Actually Used This Thing
The feedback has been... unexpectedly positive?
Actual quotes from users:
- "This is ridiculous and I love it."
- "The AI actually understood my Docker problems."
- "I called about CSS issues and felt oddly validated."
- "This is the dumbest useful thing I've ever seen."
That last one might be my favorite review ever.
What I Learned: The Inevitable Self-Reflection
Building this taught me a few things about AI and engineering culture:
- We might actually need this. The fact that an AI affirmation hotline resonates with so many engineers says something profound about our collective mental state.
- Real-time AI is just... cool. There's something magical about voice-to-voice AI that text chat doesn't capture. It feels more natural, even when you're talking about the deeply unnatural state of your production systems.
- Over-engineering is a form of meditation. I could have built this as a simple chatbot. But the process of architecting a proper real-time pipeline was its own kind of therapy.
- The tech actually worked. This stack (Pipecat, Twilio, and modern AI services) is a surprisingly robust foundation for voice AI apps. Who knew?
- Engineers just want to be understood. The specificity of the affirmations (mentioning ETL pipelines, schema drift, Kubernetes pods) made it feel personal.
So, What's Next?
Honestly, I have no idea what to do with this. Part of me wants to shut it down and pretend I never built an AI therapist for engineers. But another part of me thinks this might actually be... useful?
Maybe our culture needs to admit that our work is genuinely hard, that systems fail in ways that feel personal, and that it's okay to be frustrated when your code doesn't work. Maybe we need AI therapists who understand that a production outage at 2 AM is legitimately stressful.
Or maybe I just built an elaborate weekend project because I was avoiding writing tests for my actual work. It was probably that.
Try It Yourself
The whole thing is open source, so you can go build your own. You can find the code, architecture docs, and setup instructions at the GitHub repo (opens in a new tab).
Fair warning: setting it up requires API keys for OpenAI, Deepgram, Cartesia, and Twilio, plus configuring webhooks. It's the kind of setup that might make you need the therapy hotline before you can even use it.
But if you get it running, remember: your code is not just logic. It's digital poetry that occasionally has syntax errors. And that's beautiful, too.
The Engineering Affirmations Hotline is available 24/7 for all your existential coding crises. Side effects may include improved morale, reduced deployment anxiety, and an irrational affection for your error logs. This is not a substitute for actual therapy, proper testing, or fixing your monitoring alerts.
Call now and let an AI with a British accent tell you that your technical debt is just "deferred architectural excellence."
You deserve it.
not made by a 🤖