Skip to main content

Overview

The application uses PostgreSQL with two main tables:
  • leads: incoming lead queue and retry state
  • calls: one record per outbound call attempt
db.py creates and migrates the schema at startup. It is safe to call init_db() repeatedly.

leads Table

Lead statuses:

calls Table

Call statuses:

Qualification JSON

The exact JSON differs by agent mode. Sarvam mode stores broader machinery qualification:
OpenAI Realtime mode stores a tighter Ignitech schema:
Only non-null values are stored.

Important Helpers

Duration Tracking

For called, pushed, and failed terminal records, duration is calculated from:
The minutes dashboard uses LEGACY_SUCCESS_CALL_ESTIMATE_MINUTES for older successful calls that do not have complete duration fields.