Bank Records, Read by AI

Most people think AI loan risk checking means uploading a bank statement to a chatbot and trusting the verdict. That belief is exactly how lenders approve bad loans. A Chennai-based fintech just launched an AI tool that checks bank records and helps lenders spot risk, and the engineering behind that idea is worth stealing. In the next few minutes, I'll break down the pipeline, the numbers that matter, and prompts you can reuse.

Here's what the headline hides. The language model is the easy part. Reading a statement is something modern models do well. The hard part is making sure every number they read is actually true. One misread salary credit, one swapped debit, and a credit decision moves with it. So reliability has to be engineered around the model, not hoped for from it.

Parse, then check the math

Stage one is deliberately boring. Parse the statement into structured rows with dates, amounts, and running balances. Then run a reconciliation check. Opening balance, plus credits, minus debits, must equal closing balance. In this example, three of four hundred twelve rows fail, so the file goes to a review queue instead of a model. That one arithmetic test catches tampered PDFs and bad scans before any AI opinion exists, and it costs almost nothing to run.

$ statement-check --file stmt.pdf --strict ✓ Parsed 412 transactions ✓ Dates and amounts typed ✗ Balance chain: 3 rows fail → Routed to review queue 

The full risk-check pipeline

Zoom out and it's a five-stage pipeline. Ingest: take the file, or better, a consented data feed, because structured data beats scanned PDFs on accuracy every time. Parse: convert everything into typed rows. No free text goes forward without a schema. Classify: label each transaction as salary, rent, EMI, cash withdrawal, or transfer. Score: compute signals in plain code, then let a person review the borderline files.

Small model, strict schema

Classification is where a small, fast model earns its place. Claude Haiku 5.5 can label hundreds of rows against a fixed schema at a fraction of a flagship model's cost. Force JSON output, validate it against the schema, and keep a confidence field. In this run, nine rows come back low confidence, and those get flagged instead of guessed. Rule of thumb: spend big-model budget only on the ambiguous ten percent.

$ claude -p "label rows as JSON per schema.json" ✓ 412 rows labeled, JSON valid → Salary: 6 credits, same week → EMI debits: 4 recurring ⚠ 9 rows low confidence 

What lenders actually look for

So what do lenders actually look for? Income regularity beats average balance. Six salary credits landing the same week tells you more than one large deposit. Second, existing EMI load compared with income, the classic debt burden ratio. Third, bounced payments and overdraft days, which show real stress. And fourth, big unexplained credits right before applying, which can be window dressing.

  • Income regularity, not just average balance
  • EMI load against monthly income
  • Bounced payments and overdraft days
  • Large unexplained credits before applying

How to build it, in sequence

If you're building something similar, order matters. Start with a typed transaction schema. Every field has a type, and nothing is optional by accident. Add reconciliation checks next. They're deterministic, so you can unit test them. Then label with a small model, and finally compute ratios and averages in plain code. Never ask a model to do arithmetic you can run in ten lines of Python.

  • Define a typed transaction schema
  • Add deterministic reconciliation checks
  • Label with a small model
  • Compute ratios in plain code

Strict transaction labeling prompt

Here's a labeling prompt you can adapt today. Notice it restricts categories, demands JSON, and quotes the narration as evidence. The key line is the escape hatch. Allow unknown, because models guess when you don't give them permission to abstain. Run it on a batch of fifty rows first, and compare labels against a hand-checked sample before you trust it.

Label each row using ONLY these categories: [CATEGORY_LIST] Return JSON: id, category, confidence 0-1. If unsure, use category "unknown". Never infer income. Quote the narration. Rows: [ROWS_JSON] 

Guardrails before launch

Before shipping, test the way a lender's auditor would. Backtest on historical files where the repayment outcome is already known. Measure how often human reviewers overrule the model. If it's above fifteen percent, your prompt or schema needs work. Log every input and output, because credit decisions get audited. And set a confidence cutoff, say point eight, then tune it on real data.

  • Backtest on files with known outcomes
  • Track how often reviewers overrule the model
  • Log every model input and output
  • Set a confidence cutoff for human review

Explain the flag, never the decision

Last piece: let the model explain, not decide. Give it computed signals and ask for reasons that cite each number. The approval stays with rules and people. The explanation just makes human review faster, and it's easy to audit. Set temperature low and keep the output to three short reasons, so reviewers can scan it in seconds.

You receive computed signals, not raw data. Signals: [SIGNALS_JSON] Write 3 plain-language reasons for the flag. Cite the exact signal behind each reason. Do not recommend approve or reject. 

Go Build

So the pattern is parse, verify, classify, compute, explain. The model touches only the middle, and everything around it is testable. Small stage-by-stage checks beat one giant, clever prompt every time. Pick one stage this week and harden it. Follow for more AI engineering breakdowns.