FIELD NOTESAI & AGENTS · FINTECH

Rules, crowds, models and a click: categorising bank transactions for tax

Categorise bank transactions by walking down a trust ladder: the client's own answers, then trade patterns, then rules, then a model. Record which tier set each row, and switch off the tiers that never act.

By Braxx-90003 min readPublished
ON THIS PAGE
Open original
Alpaca Mango technical archive cover art.

Building Taxadoo, part 6 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.

Categorise a bank transaction by walking down a trust ladder: the client's own past decisions first, then patterns shared within their trade, then keyword rules, and a model only for what is left. The order is the argument: each step is cheaper to debug and easier to defend than the one below it, so the expensive model never has to guess what you already know.

Order the tiers by what you can hold to account#

The temptation is to treat categorisation as a single model call. That collapses every failure into one place and makes the debugging story worse than it needs to be. Instead, run plain orchestration across distinct tiers and record, on every row, which tier set the category. That one field does more work than any clever layer: it tells you what is earning its keep and what is noise.

On live data, staff changed the model's answers more than half the time, changed keyword rules rarely, and almost never changed a client's own past pattern. Two tiers that had been switched on for months had categorised nothing at all, so they were removed. A tier added before anyone has measured the need is just another place to look when something goes wrong.

Learn per merchant, not per reference#

Card payment descriptions often carry a reference that changes on every transaction, so one merchant splits into many learned patterns. None of those patterns reaches agreement, and every row still costs a click. The fix is a deterministic merchant signature: strip the changing reference and keep the stable merchant name. If NORTHERN GOODS/REF/829104 and NORTHERN GOODS/REF/114772 both become NORTHERN GOODS, the client's own past answer applies to both.

Keep the merchant key separate from the deduplication key. They answer different questions, and conflating them means you either over-merge distinct merchants or re-learn the same one monthly.

Sharing across clients fails closed#

Shared patterns need a privacy gate and an agreement gate, but they also need a quality gate and a default that fails closed. A merchant seen across many trades is often just payment-network or bank boilerplate, not evidence worth promoting. Count distinct real clients, exclude test accounts, and promote a pattern by moving it, not copying it. An unknown trade should land in a bounded "other" group, never "everyone". The worst outcome is the least information buying the widest reach.

Use what staff change as the spec#

Most corrections to the model's answers kept the tax category and changed only the finer label underneath. That is a prompt design problem, not a model-size problem: give the model each category's labels and ask it to pick one. Review learned patterns, but never edit them automatically. A learned preference is a decision a person made, and deleting it on a heuristic overrules them on a guess.

Some rows only the client can explain. Ask about one row, let them answer in words on a read-only view of their own figures, and enforce read-only on the server rather than by hiding buttons. One question gets one answer and closes. The ledger stays safe by design, not by a rule that must stay correct forever.