Case Study // AI Voice Assistant

My AI Voice Assistant

Nova is built to answer inbound phone calls, book live appointments during the call, text back callers if they hang up before scheduling, and answer questions about me on my behalf.

Call+1 (888) 600-3783

Project Overview: The Problem & The Solution

The Problem: Voice is an unforgiving interface. If an AI phone assistant pauses for more than a second or two while waiting on a calendar API or a chain of no-code webhooks, callers think the line dropped and hang up. And once a caller hangs up on a traditional voice bot, that missed connection is gone.

The Solution: I built Nova as a standalone asynchronous Python microservice with zero reliance on third-party automation glues like n8n or Make. To keep the conversation natural while never losing a caller, the service splits every call into two separate pipelines:

  • Mid-Call Tools (< 500ms budget, 3.5s timeout fallback): While the caller is speaking with Nova, Retell AI calls HMAC-SHA256 verified endpoints (/api/v1/retell/tools/check-availability, book-appointment, and urgent-escalation). If a calendar lookup ever takes longer than 3.5 seconds, the service returns a graceful spoken fallback instead of leaving the caller in dead air.
  • Post-Call Webhook & Missed-Call Recovery (< 50ms ACK): As soon as a call ends, /api/v1/retell/webhook verifies the signature, returns an immediate 200 OK in under 50ms, and hands the rest of the work to FastAPI BackgroundTasks. If the caller hung up without booking, the service automatically sends a follow-up text message with a direct calendar link and logs the call transcript and summary to the database.
Operational Profile

System Specs

  • Voice EngineRetell AI + ElevenLabs
  • Telephony / SMSTelnyx SIP & Twilio
  • Toll-Free Line+1 (888) 600-3783
  • Voice Turnaround< 800ms
  • Mid-Call Tools< 500ms (3.5s Guard)
  • Webhook ACK< 50ms (Async Queue)
  • RuntimeFastAPI • Python 3.12+
  • DeploymentDocker + Nginx VPS

System Architecture Diagram

System architecture showing Incoming Caller to Retell AI Voice Engine, splitting into Mid-Call Tools under 500ms and Post-Call Webhook under 50ms with FastAPI BackgroundTasks
// System Architecture & Dual-Pipeline Data Flow (architecture-diagram.png) ⬇ Download architecture-diagram.png

Carrier-Compliant Toll-Free SMS Opt-In Workflow

Sending automated follow-up texts from a phone number requires passing strict carrier verification. Using Telnyx SIP trunking and a dedicated toll-free number (+1 (888) 600-3783), the same number handles both inbound voice calls and outbound confirmation texts after obtaining verbal opt-in during the call.

Three-step inbound phone call SMS opt-in verification process: Customer calls +1-888-600-3783, AI Voice Assistant requests verbal consent, and a single SMS confirmation is dispatched
// Inbound Phone Call SMS Opt-In Verification Process

Repository Structure

// Project Directory Layout
call-agent/
├── Dockerfile                  # Multi-target container (Hostinger VPS, Cloud Run, Azure)
├── docker-compose.yml          # Compose stack with Nginx & Certbot profile
├── requirements.txt            # Python 3.12+ dependencies
├── assets/
│   ├── architecture-diagram.png        # System architecture & dual-pipeline diagram
│   └── toll-free-opt-in-workflow.jpg   # Carrier SMS verbal opt-in workflow diagram
├── docs/
│   ├── architecture_overview.md        # Architecture specs & integration guide
│   ├── TELNYX_SETUP_GUIDE.md           # SIP trunking & toll-free SMS compliance guide
│   ├── RETELL_WORKSPACE_SETUP_GUIDE.md # Workspace & agent setup SOP
│   ├── NEW_CLIENT_ONBOARDING_GUIDE.md  # End-to-end tenant onboarding SOP
│   └── CLIENT_KNOWLEDGE_UPDATE_GUIDE.md
├── nginx/conf.d/call-agent.conf        # Nginx reverse proxy & TLS 1.2/1.3 config
├── scripts/
│   ├── init_nginx_ssl.sh               # One-command SSL bootstrap script
│   └── provision_client.py             # CLI for onboarding tenants & Retell agents
├── tests/test_webhooks.py              # Pytest suite for webhooks, tools, and security
└── app/
    ├── main.py                 # FastAPI app, lifespan handler, and /health probe
    ├── config.py               # pydantic-settings configuration
    ├── database.py             # Async SQLAlchemy 2.0 (aiosqlite & asyncpg)
    ├── models.py               # Tenant and CallLog database models
    ├── schemas.py              # Pydantic v2 request/response schemas
    ├── core/security.py        # Retell HMAC-SHA256 verification & tenant resolver
    ├── services/
    │   ├── calendar.py         # Async availability lookup & appointment booking
    │   └── sms.py              # Telnyx / Twilio confirmations, alerts & recovery
    └── api/
        ├── tools.py            # Mid-call tool endpoints (<500ms budget)
        ├── webhooks.py         # Post-call webhook & BackgroundTasks recovery
        └── admin.py            # Multi-tenant onboarding endpoints

Try the AI Voice Assistant Live

Nova is connected to my live calendar. Call the toll-free number from your phone to try it out. If you hang up before booking a time, the post-call pipeline will text you a link to my calendar.

📞 Call+1 (888) 600-3783
Live AI Voice Assistant

Call Nova

Nathan Lester's AI Assistant Connected to Live Calendar

+1 (888) 600-3783
Dial from your phone to speak with Nova and schedule time on Nathan's live calendar.
Engine: Retell Neural Voice • < 800ms Latency
Call+1 (888) 600-3783
Hang-ups or missed calls automatically receive a follow-up SMS with Nathan's direct calendar link.