AI-powered outbound voice agent for debt collection and EMI recovery β built for CFLO, a fintech lending and collections platform.
The agent autonomously calls borrowers, identifies them by phone number, discusses overdue EMIs, handles hardship cases empathetically, and captures Promise-To-Pay (PTP) commitments β all without human intervention.
Twilio (telephony) β FastAPI (backend) β Groq Llama 3.3 70B (LLM) β TwiML (voice response)
β
SQLite (mock banking DB)
PTP log / Call log / Borrower profiles
| Layer | Technology |
|---|---|
| Telephony | Twilio Voice |
| Backend | FastAPI + Uvicorn |
| LLM Brain | Groq β Llama 3.3 70B |
| Speech Recognition | Twilio built-in (Deepgram Nova-3 ready) |
| Text to Speech | Twilio Polly Aditi (ElevenLabs ready) |
| Database | SQLite (PostgreSQL ready for production) |
| Tunnel | ngrok |
| Language | Python 3.11 |
- Outbound calling β agent calls borrowers automatically from dashboard
- Borrower identification β looks up caller by phone number in real time
- Intelligent dialogue β context-aware conversations using Llama 3.3 70B
- Tone calibration β empathetic for hardship cases, firm for chronic defaulters
- PTP capture β automatically logs payment commitments with amount and date
- Risk segmentation β S1 (critical) to S5 (self-cure) aligned with CFLO spec
- Compliance guardrails β no threats, no PII leakage, RBI Fair Practice Code aligned
- Management dashboard β view all borrowers, trigger calls, monitor PTPs
- Human escalation β hands off to live agent when needed
cflo-voice-agent/
βββ main.py FastAPI app entry point
βββ app/
β βββ routes/
β β βββ voice.py Twilio webhook handlers (inbound + outbound)
β β βββ outbound.py Trigger outbound calls
β β βββ dashboard.py Management dashboard UI
β βββ services/
β βββ dialogue.py LLM brain β Groq + system prompt + PTP logic
βββ data/
β βββ database.py SQLite β borrowers, PTP log, call log
βββ .env API keys (not committed)
βββ requirements.txt Dependencies
git clone https://github.com/techAsmita/CFLO-Agent.git
cd CFLO-Agent
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtTWILIO_ACCOUNT_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_token
TWILIO_PHONE_NUMBER=your_twilio_number
GROQ_API_KEY=your_groq_key
BASE_URL=your_ngrok_url
python data/database.pypython main.pyngrok http 8000In Twilio Console, go to your phone number and set Voice Configuration webhook to:
https://your-ngrok-url/voice/inbound
HTTP Method: POST
http://localhost:8000/dashboard
This prototype directly implements Section 4.4 (AI Voice Agent) of the CFLO AI-ML Architecture specification (v1.0, May 2026):
- Inbound and outbound call handling
- LLM core with intent classification and slot filling
- Dialogue state management with fallback paths
- PTP capture and logging
- Risk segment awareness (S1 critical through S5 self-cure)
- Hardship detection and empathetic tone switching
- Human escalation triggers
- Compliance guardrails aligned with RBI Fair Practice Code
- Deepgram Nova-3 STT integration ready
- ElevenLabs TTS integration ready
- Multi-language Hindi and Indic support ready
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Health check |
| GET | /health | Server status |
| GET | /dashboard | Management dashboard |
| POST | /voice/inbound | Twilio inbound call webhook |
| POST | /voice/respond | Conversation turn handler |
| POST | /voice/outbound | Outbound call webhook |
| POST | /call/test | Trigger a test call |
Asmita β @techAsmita
B.E. Computer Engineering | AI/ML Enthusiast
LinkedIn