How faelsou/settlr works
Settlr is a WhatsApp collections agent paired with deterministic payment reconciliation and a human-operator dashboard. The main workflow receives debtor messages or payment evidence, routes conversational work through policy-guarded agent tasks, and processes receipts or bank-reported payments through matching and reconciliation; operators review exceptions and approvals in the panel. Separate branches cover scheduled collections, issuer ingestion, onboarding, and Slack-based AIOps. Edges follow explicit README statements or shown imports/calls; some capabilities are documented but their internal wiring was not sampled.
Main entry points: tasks.py Message routing · webhooks.py Inbound webhooks · service.py Reconciliation · engine.py AIOps engine
Components 29
WhatsApp and agent
- Inbound webhooks
api/app/api/routes/webhooks.py - WhatsApp channel
api/app/channels/whatsapp.py - Message routing
api/app/channels/tasks.py - Agent turns
api/app/agent/tasks.py - Outbound delivery
api/app/channels/outbound.py - Delivery tracking
api/app/channels/delivery.py - Channel metrics
api/app/channels/metrics.py
Collections and onboarding
- Collection rules
api/app/dunning/official.py - Dunning service
api/app/dunning/service.py - Member onboarding
api/app/onboarding
Payments and reconciliation
- Receipt processing
api/app/receipts/service.py - Bank ingestion
api/app/ingest/tasks.py - Reconciliation
api/app/reconciliation/service.py - Payment matcher
api/app/reconciliation/matcher.py - Business records
api/app/models/entities.py - Task workers
api/app/workers/celery_app.py
Operator panel
- Operator dashboard
web/app/(painel) - API gateway
api/app/services/gateway.py - Audit log
api/app/core/audit.py
Incident response
- AIOps engine
api/app/aiops/engine.py - Incident diagnosis
api/app/aiops/diagnose.py - Slack notifications
api/app/aiops/slack.py - Incident store
api/app/aiops/store.py
Other components
- Debtor
- Operator
- Bank and issuers
- Evolution API
- Slack
- Alertmanager
Connections 31
- Debtor → Evolution API: sends messages
README.md - Evolution API → Inbound webhooks: posts events
api/app/api/routes/webhooks.py - Inbound webhooks → WhatsApp channel: parses events
api/app/api/routes/webhooks.py - Inbound webhooks → Message routing: queues inbound
api/app/api/routes/webhooks.py - Message routing → Agent turns: queues agent turn
api/app/channels/tasks.py - Message routing → Receipt processing: queues receipt
api/app/channels/tasks.py - Agent turns → Outbound delivery: sends replies
api/app/agent/tasks.py - Outbound delivery → Delivery tracking: dispatches messages
api/app/channels/outbound.py - Delivery tracking → WhatsApp channel: sends via channel
api/app/channels/delivery.py - WhatsApp channel → Evolution API: uses API
api/app/channels/whatsapp.py - Message routing → Channel metrics: records routing
api/app/channels/tasks.py - Dunning service → Collection rules: applies rules
api/app/dunning/service.py - Dunning service → Outbound delivery: sends collections
api/app/dunning/service.py - Operator → Operator dashboard: reviews work
README.md - Operator dashboard → API gateway: calls API
README.md - API gateway → Audit log: audits actions
README.md - Receipt processing → Business records: records payment
api/app/receipts/service.py - Receipt processing → Payment matcher: requests match
api/app/receipts/service.py - Bank and issuers → Bank ingestion: sends payment data
README.md - Bank ingestion → Reconciliation: queues reconciliation
api/app/ingest/tasks.py - Reconciliation → Payment matcher: scores candidates
api/app/reconciliation/service.py - Reconciliation → Business records: updates payment state
api/app/reconciliation/service.py - Reconciliation → Bank ingestion: queues settlement
api/app/reconciliation/service.py - Inbound webhooks → Bank ingestion: queues issuer events
api/app/api/routes/webhooks.py - Message routing → Task workers: dispatches tasks
api/app/channels/tasks.py - Member onboarding → Business records: manages members
- Alertmanager → AIOps engine: reports alerts
api/app/aiops/engine.py - AIOps engine → Incident diagnosis: collects evidence
api/app/aiops/engine.py - AIOps engine → Slack notifications: posts incident
api/app/aiops/engine.py - Slack notifications → Slack: notifies operators
- AIOps engine → Incident store: tracks incidents
api/app/aiops/engine.py