Documentation Index
Fetch the complete documentation index at: https://docs.spn.wtf/llms.txt
Use this file to discover all available pages before exploring further.
High-Level Flow
Runtime Services
| Service | Command | Responsibility |
|---|---|---|
| Agent | python agent_realtime.py start or python agent.py start | Joins LiveKit rooms and conducts calls |
| Scheduler | python scheduler.py | Finds eligible leads, creates call records, starts SIP calls, pushes CRM tasks |
| Lead fetcher | python lead_fetcher.py | Polls IndiaMART and receives Facebook webhooks |
| Dashboard | streamlit run streamlit_app.py | Shows leads/calls and imports CSV leads |
| Token server | python token_server.py | Issues LiveKit JWT tokens for local browser testing |
| Database | PostgreSQL | Stores leads, call attempts, durations, statuses, and qualification data |
Call Room Contract
The scheduler creates one LiveKit room per lead:Concurrency Control
The scheduler limits active outbound calls using:calls with status='calling'. Before starting more calls, the scheduler also fails stale calling rows older than:
Calling Window
Calls only start when the local time is inside the configured window:Deployment Shape
docker-compose.yml runs:
db: PostgreSQL 16agent: defaults topython agent_realtime.py startlead_fetcher: lead ingestion servicescheduler: call scheduler and CRM push loopdashboard: Streamlit dashboard on container port8501, bound to host127.0.0.1:8502web: token server