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
| Component | Technology | Purpose |
|---|---|---|
| Application Server | Python 3.12 + Gunicorn + Uvicorn | REST API serving |
| Real-time Server | LiveKit (self-hosted or cloud) | WebRTC SFU + SIP gateway |
| Primary Database | PostgreSQL 16 | All application data |
| Cache / Queue | Redis 7 | Caching, Celery broker, active call tracking |
| Object Storage | AWS S3 | Call recordings |
| Task Queue | Celery (worker + beat) | Batch dispatch, scheduled tasks |
| Container Runtime | Docker + Docker Compose | Deployment orchestration |
All components are containerized and defined in
docker-compose.yml. A single docker-compose up brings up the full backend stack.