How rahulpaul-07/three-way-financial-reconciliation-engine works
This repository is a three-way payment reconciliation product: it compares merchant orders, gateway transactions and settlements, and bank statement lines; classifies matches and exceptions; and presents the run in an interactive dashboard or report. The optional investigation agent and Q&A add model-assisted analysis backed by deterministic tools. The README documents the main workflow and dashboard capabilities; some backend and frontend connections are inferred only from the documented behavior, so those are marked unverified.
Main entry points: app.py Web API · App.tsx Dashboard composition · matcher.py Tiered reconciliation · agent.py Resolution agent
Components 25
Reconciliation engine
- Money and date rules
src/core.py - Tiered reconciliation
src/matcher.py - Ambiguous assignment
src/assignment.py
Investigation and analysis
- Investigation runner
src/investigate.py - Resolution agent
src/agent.py - Deterministic tools
src/tools.py - LLM providers
src/llm.py - Question answering
src/ask.py - Exception taxonomy
src/taxonomy.py
API and reporting
- Run analysis JSON
src/analysis.py - Web API
src/app.py - HTML report
src/report.py
Interactive dashboard
- Dashboard composition
web/src/App.tsx - Dashboard API client
web/src/lib/api.ts - Run workbench
web/src/sections/workbench.tsx - Record lineage explorer
web/src/sections/run/lineage.tsx - Evidence charts
web/src/sections/evidence.tsx - Agent panel
web/src/sections/agent.tsx - Engine and data hooks
web/src/hooks/use-engine.ts - Run data types
web/src/lib/types.ts
Data and evaluation
- Batch generator
src/generate_data.py - Evaluation harness
src/evaluate.py - Adversarial batches
src/adversarial_data.py
Other components
- Merchant analyst
- Four source CSVs
Connections 31
- Merchant analyst → Four source CSVs: supplies
README.md - Four source CSVs → Web API: uploads
- Four source CSVs → Tiered reconciliation: reconciles
README.md - Tiered reconciliation → Money and date rules: uses rules
src/matcher.py - Tiered reconciliation → Ambiguous assignment: delegates to
src/matcher.py - Web API → Tiered reconciliation: runs engine
README.md - Web API → Run analysis JSON: returns run data
src/app.py - Web API → HTML report: serves report
src/app.py - Tiered reconciliation → Investigation runner: unresolved cases
README.md - Investigation runner → Resolution agent: starts investigation
src/investigate.py - Resolution agent → Deterministic tools: calls tools
src/agent.py - Resolution agent → LLM providers: requests completions
src/agent.py - Investigation runner → LLM providers: configures provider
src/investigate.py - Web API → Investigation runner: offers investigations
src/app.py - Web API → Question answering: offers Q&A
src/app.py - Question answering → LLM providers: asks model
src/ask.py - Deterministic tools → Money and date rules: uses primitives
src/tools.py - Resolution agent → Exception taxonomy: uses classes
src/agent.py - Merchant analyst → Dashboard composition: views dashboard
README.md - Dashboard composition → Dashboard API client: loads snapshots
web/src/App.tsx - Dashboard composition → Run workbench: renders
web/src/App.tsx - Dashboard composition → Evidence charts: renders
web/src/App.tsx - Dashboard composition → Agent panel: renders
web/src/App.tsx - Dashboard composition → Engine and data hooks: reads status
web/src/App.tsx - Run workbench → Dashboard API client: requests runs
- Run workbench → Record lineage explorer: shows record paths
- Dashboard API client → Run data types: uses types
web/src/lib/api.ts - Batch generator → Four source CSVs: writes batches
README.md - Adversarial batches → Batch generator: extends batches
src/adversarial_data.py - Evaluation harness → Tiered reconciliation: grades resolutions
src/evaluate.py - Evaluation harness → Batch generator: runs scale batches
src/evaluate.py