Skip to main content

System Architecture

Vaani is a 4-service monorepo where each component handles a specific responsibility:

Component Breakdown

FastAPI Backend

14 REST API routers handling agents, calls, phone numbers, batch jobs, campaigns, workspaces, reports, chats, webhooks, auth, and admin. Runs on Gunicorn with Uvicorn workers.

LiveKit Agent Worker

The real-time AI engine. Connects to LiveKit rooms, processes audio via STT, generates responses via LLM, and delivers audio via TTS. Handles recording, transfers, and post-call analytics.

Next.js Dashboard

Full-featured management UI for configuring agents, viewing call logs, managing phone numbers, launching batch campaigns, and monitoring analytics. Protected by JWT authentication.

VUI Widget

Embeddable React component that connects to agents via WebRTC. Can be dropped into any website for voice-based customer interaction without requiring phone infrastructure.

Data Flow: Inbound Phone Call


Data Flow: Outbound Batch Call


Infrastructure Requirements

ComponentTechnologyPurpose
Application ServerPython 3.12 + Gunicorn + UvicornREST API serving
Real-time ServerLiveKit (self-hosted or cloud)WebRTC SFU + SIP gateway
Primary DatabasePostgreSQL 16All application data
Cache / QueueRedis 7Caching, Celery broker, active call tracking
Object StorageAWS S3Call recordings
Task QueueCelery (worker + beat)Batch dispatch, scheduled tasks
Container RuntimeDocker + Docker ComposeDeployment orchestration
All components are containerized and defined in docker-compose.yml. A single docker-compose up brings up the full backend stack.