How iamgiridharan/ai-revenue-recovery-agent works
AI Revenue Recovery Agent provides a merchant dashboard and a controlled failed-payment recovery workflow: cases are assessed with ML, agent recommendations are checked by deterministic policy, approved actions may execute through Razorpay Test Mode, and payment outcomes and decisions are audited. The graph also includes simulation, value-aware scoring, and dashboard analytics. Several backend implementations were not sampled, so their documented capabilities are shown without asserting unverified internal calls.
Main entry points: api.js REST API client · App.jsx Dashboard application · recovery_service.py Recovery execution · ml_service.py ML inference service
Components 26
Merchant dashboard
- Dashboard application
frontend/src/App.jsx - REST API client
frontend/src/services/api.js - Case views
frontend/src/pages/CaseDetail.jsx - Dashboard and analytics
frontend/src/pages/Dashboard.jsx - Policy settings
frontend/src/pages/Policy.jsx
Recovery backend
- Cases API
backend/app/api/cases.py - Agent API
backend/app/api/agent.py - Policy API
backend/app/api/policy.py - Dashboard API
backend/app/api/dashboard.py - Simulation API
backend/app/api/simulation.py - Webhook handler
backend/app/api/webhooks.py - Agent orchestration
backend/app/services/agent_service.py - Deterministic policy
backend/app/services/policy_engine.py - Recovery execution
backend/app/services/recovery_service.py - Synthetic recovery simulation
backend/app/services/simulation_service.py - Value-aware scoring
backend/app/services/value_service.py - Dashboard aggregates
backend/app/services/dashboard_service.py
ML capabilities
- ML inference service
backend/app/services/ml_service.py - Training pipeline
ml/pipeline.py - Synthetic dataset
ml/data_generator.py - Feature preprocessing
ml/preprocessing.py - Recovery model
ml/model.py
Persistence
- Application database
backend/app/core/database.py - Webhook idempotency ledger
backend/app/models/webhook_event.py
Other components
- Merchant
- Razorpay Test Mode
Connections 29
- Merchant → Dashboard application: uses
- Dashboard application → Case views: routes to
frontend/src/App.jsx - Dashboard application → Dashboard and analytics: routes to
frontend/src/App.jsx - Dashboard application → Policy settings: routes to
frontend/src/App.jsx - Case views → REST API client: requests
frontend/src/pages/CaseDetail.jsx - Dashboard and analytics → REST API client: requests
frontend/src/pages/Dashboard.jsx - REST API client → Cases API: calls cases endpoints
frontend/src/services/api.js - REST API client → Dashboard API: calls dashboard endpoints
frontend/src/services/api.js - REST API client → Policy API: calls policy endpoints
frontend/src/services/api.js - Cases API → Agent orchestration: orchestrates diagnosis
- Agent orchestration → ML inference service: gets predictions
- Agent orchestration → Deterministic policy: requests authorization
- Deterministic policy → Recovery execution: authorizes actions
backend/app/services/recovery_service.py - Recovery execution → Razorpay Test Mode: executes approved recovery
- Razorpay Test Mode → Webhook handler: sends payment events
- Webhook handler → Recovery execution: processes outcomes
backend/app/api/webhooks.py - Webhook handler → Webhook idempotency ledger: records deliveries
backend/app/api/webhooks.py - Webhook idempotency ledger → Application database: persists ledger
backend/app/models/webhook_event.py - Recovery execution → Application database: records actions and audit
- Dashboard API → Dashboard aggregates: aggregates metrics
- Dashboard aggregates → Value-aware scoring: uses scoring
backend/app/services/dashboard_service.py - Simulation API → Synthetic recovery simulation: runs simulation
- Synthetic recovery simulation → ML inference service: requests predictions
backend/app/services/simulation_service.py - Synthetic recovery simulation → Deterministic policy: checks policy
backend/app/services/simulation_service.py - Training pipeline → Synthetic dataset: generates dataset
ml/pipeline.py - Training pipeline → Feature preprocessing: preprocesses data
ml/pipeline.py - Training pipeline → Recovery model: trains and evaluates
ml/pipeline.py - ML inference service → Feature preprocessing: prepares inference
- ML inference service → Recovery model: predicts recovery