# Reading bank statements with an LLM: what the balance column knows

> The running balance on each row is the cheapest audit a bank statement has, and the first check to run. Reconciliation alone is not proof, and nothing should key on text a model produced.

- Canonical: https://www.alpacamango.com/docs/reading-bank-statements-with-an-llm
- Author: Space Toucan
- Published: 2026-11-23 · Updated: 2026-11-23
- Topics: Fintech, building-taxadoo, AI & Agents

*Building Taxadoo, part 1 of 7. Lessons from building the statement engine behind Taxadoo, a UK bookkeeping product — the decisions and the failures, not the internals. *[*The whole series*](/docs/tag/building-taxadoo)*.*

**The running balance on each row is the field to check first: walked top to bottom, it finds the first bad row and tells you which kind of error you have. A misread amount shifts every later row by the same delta; a misread balance makes exactly one row diverge.** The failures that matter are not the loud ones, where the import errors out. They are the quiet ones where every row parses, the totals match, and the numbers are still wrong.

## Walk every intermediate row

A closing-balance check is not enough. Two misreads can cancel, and a dropped pair of rows that net to zero is invisible to any check that only looks at the final sum. Verify every intermediate balance along the chain, not just the last one. The check costs nothing and needs no model call.

Do not ask a model for values that are not printed. Many statements show a brought-forward balance only on the first page and a carried-forward balance only on the last. A schema that wants an opening and closing balance on every page makes the model invent them from a nearby running balance. Derive what can be derived from the row chain; extract only what is actually on the page.

## Sign is not a lookup

A current account is an asset: spending lowers the balance. A credit card is a liability: spending raises what you owe. Infer signs from balance direction under the wrong convention and every amount inverts: spending becomes income. Decide the convention per statement before extraction, and do not trust a user-chosen account type field to decide it for you. The balance chain fixes a sign flip deterministically once the convention is known, with no model call.

## Identity is (account, period), not what the model wrote

A statement's identity is its account and period, never its filename and never its file hash. Users routinely name every export `statement.pdf`, and a hash only catches a byte-identical re-upload. An amended statement for the same account and month should replace the old import; importing both double-counts the month.

Never deduplicate on text a model produced. Re-import the same statement with a different prompt or model and the descriptions come back slightly different, so a key built on the raw description lets duplicates through. Normalise in the database so no insert path can forget. Two genuinely different transactions can share date, amount and description: the same direct debit taken twice in one day. Treating equality as duplication silently drops one of them. Count occurrences within the statement instead.

## The model earns its keep on the long tail

For common statement layouts, write a deterministic parser. A parser fails loudly on anything it does not understand; a model fails quietly, and its misreadings cluster on the rows a parser handles well: wrapping descriptions, shifted columns, country-specific amount formats. Keep the model for layouts nobody has written a parser for yet, and identify the bank from the first page masthead; other banks appear inside a statement as payees.

Where a statement prints no running balance, this check is unavailable, and you are back to trusting the model's word. That is when every reading should be treated as suspect, because a plausible wrong ledger is worse than one the importer refused.
