How Financial Decision Lab Works Under the Hood
A comprehensive architectural breakdown of our deterministic 12-stage financial calculation pipeline, mathematical formulas, sufficiency gates, and anti-hallucination regex guardrails.
From Raw Statement to Verifiable Proof in 3 Steps
Clean, strict separation between untrusted raw input parsing, deterministic mathematical calculation, and guarded natural-language presentation.
Ingestion & SHA-256 Dedup
Statement parsing for PDF, CSV, and Excel (HDFC, SBI, ICICI, Axis). Generates SHA-256 fingerprint hashes to ensure overlapping statement files are never double-counted.
Deterministic Engine & Gate
Evaluates the 4-point data sufficiency gate (≥ 90 days history, max gap ≤ 7 days). Executes balance continuity reconciliation: Opening + ΣTx = Closing.
Monte Carlo & Guarded Output
5,000 Monte Carlo daily spend simulations calculate conservative P10, median P50, and optimistic P90 headroom. LLM translates structured ledger to plain narration with regex number guard verification.
Automated Transaction Normalization & Transfer Pairing
Watch how noisy Indian UPI descriptions, internal account transfers, and statement discrepancies are parsed, cleaned, and reconciled.
Statement Ingestion
HDFC, SBI, ICICI, Axis
Auto-detects statement formats from any major bank. Computes SHA-256 file hashes to guarantee idempotent imports without duplicate processing.
Data Cleaning & Gate
Opening + ∑Tx = Closing (Δ = 0)
Strips messy UPI merchant codes, pairs internal transfers to prevent double-counting, and strictly enforces 4-point data sufficiency (≥ 90 days history).
Deterministic Math Core
5,000 Paths · Integer Paise
Simulates 5,000 daily cash-flow trajectories under random shocks (seed: 42). Computes adaptive safety buffers based on income volatility.
Reasoning Ledger & Vault
8-Step Proof · Headroom +₹42k
Generates an immutable step-by-step mathematical proof. Strict regex guard ensures zero LLM numerical hallucinations; 100% offline in fdl.db.
Universal Bank & Payment Ingestion
Directly upload and analyze bank statements from PhonePe, Google Pay, Paytm, HDFC, SBI, ICICI, Axis, Kotak, and CRED — zero cloud transmission, 100% deterministic local math.
Dual-Tier AI Architecture with Number Verification Guard
The LLM is strictly confined to natural language comprehension and narration. Every figure cited must exist verbatim in the mathematical Reasoning Ledger.
6 Core Invariants Built Into Every Calculation
Why Financial Decision Lab is fundamentally different from generic LLM chat wrappers.
Deterministic Math.Unshakeable Verdicts.
Local-First Ingestion & Reconciliation
Auto-detects HDFC, SBI, ICICI & Axis statements. Strictly verifies Opening + ΣTx = Closing. Zero cloud data egress.
Monte Carlo Headroom Forecast
5,000 simulations evaluate daily cash flow volatility to establish exact P10 conservative and P50 median safety margins.
100% Local-First & Air-Gapped
Runs completely offline on your local device. Statements, transactions, and balances remain strictly in your local SQLite database (fdl.db). Zero cloud transmission, zero telemetry, absolute data privacy.
Deterministic Integer Paise Math
All calculations are executed in integer paise (1 INR = 100 Paise). The LLM is completely isolated from computing balances, safety buffers, or affordability verdicts.
5,000 Monte Carlo Simulations
Simulates 5,000 daily spend trajectories under random shocks to establish reproducible P10 (conservative), P50 (median), and P90 headroom probability percentiles.
Dynamic Volatility Buffer
Measures income volatility via Coefficient of Variation. Freelancers with irregular credits automatically receive an elevated safety reserve multiplier (up to 2.0x essentials).
8-Step Reasoning Ledger
Every verdict produces an immutable mathematical audit trail linking starting balance, expected cash flows, recurring obligations, safety buffers, and final headroom.
Number-Verification Guard
When generating natural English narration, a strict regex guard validates every numerical figure cited against the Reasoning Ledger. Any unverified figure defaults to template math.
The 8 Core Mathematical Equations Powering Every Verdict
Every calculation is executed in integer paise with zero floating-point drift. Here are the 8 fundamental mathematical invariants enforced by our deterministic engine.
SHA-256 Idempotent Hash
Guarantees duplicate files or overlapping statement date ranges are never double-counted into ledger history.
Transfer Cancellation
Pairs intra-account transfers between savings accounts so funds shifted to secondary accounts are not treated as expenses.
Balance Anchor Equation
Any minor arithmetic mismatch (Δ > 0) instantly halts calculation and flags a discrepancy in the statement table.
4-Point Sufficiency Gate
Refuses to calculate on blind data; requires continuous transaction history with verified recurring income anchors.
Modified Z-Score (MAD)
Detects abnormal one-off spikes without distorting recurring monthly subscription and utility obligations.
Monte Carlo Evolution
Simulates 5,000 daily spend trajectories under random shocks to find conservative P10, median P50, and P90 percentiles.
Dynamic Volatility Buffer
Multiplied by income volatility CV: 1.0x for salaried workers, scaling up to 2.0x for volatile freelancers.
Headroom Proof Formula
AFFORDABLE if Headroom₁₀ ≥ 0; TIGHT if Headroom₅₀ ≥ 0; else NOT ADVISABLE. Zero LLM hallucinations.
Domain Invariants & Threshold Reference (Appendix B)
Experience the Deterministic Engine in Action
Launch the Decision Lab to run simulated purchase scenarios, review your cash horizon, and inspect the live Reasoning Ledger.