Technical

AI Bank Reconciliation: Suggested Matches a Person Confirms

How an AI matcher suggests bank reconciliation matches from descriptions and amounts, explains each one, sorts them by confidence, and leaves the final confirmation to a person.

Kalvyai Engineering · · 7 min read

AI Bank Reconciliation: Suggested Matches a Person Confirms (cover)
On this page

Bank reconciliation is mostly reading. Someone looks at a statement line like UPI/412345678901/ACME TRADERS/PAYMENT INV 0423, searches the ledger for an open invoice, checks the amount, and clicks match. Most lines are easy. A few take real thought. The time goes into the easy ones because there are so many of them.

This post explains how we build AI-assisted matching that handles the easy lines quickly, shows its reasoning for every suggestion, and sends anything uncertain to a person. The person still confirms. That last part is a design choice, and we explain why.

What a statement line gives you to work with

Each bank statement line usually carries four useful things:

  • Amount and direction (credit or debit)
  • Date (transaction date, sometimes a separate value date)
  • Description or narration, which is free text written partly by the bank and partly by whoever sent the money
  • Reference fields, such as a UTR number for NEFT, IMPS or UPI transfers in India, a cheque number, or a bank reference

On the ledger side you have open customer invoices, open vendor bills, payments already recorded but not yet reconciled, and recurring items like bank charges, salaries or loan instalments.

The job is to connect one side to the other. The difficulty is that descriptions are inconsistent. The same customer might appear as ACME TRADERS PVT LTD, ACME TRAD, or the name of the person who made the transfer. Invoice numbers get typed with spaces, without prefixes, or not at all.

How a matching engine produces suggestions

We split the work into three steps. Keeping them separate makes the system easier to test and easier to explain.

Step 1: Narrow the candidates

Do not ask a model to search the whole ledger. Use plain database filters first:

  1. Keep only open items in the same company and currency.
  2. Keep items whose direction matches (a credit on the statement looks for receivables or customer payments).
  3. Keep items within a date window around the statement date.
  4. Keep items where the amount is equal, or within a tolerance you define for known cases such as bank charges deducted from a transfer.

This step is fast, deterministic and cheap. It often reduces thousands of open items to a handful.

Step 2: Extract signals from the description

Next, pull structured signals out of the narration:

  • Reference numbers (UTR, cheque number, transaction ID)
  • Anything that looks like an invoice or bill number
  • A counterparty name
  • Keywords that suggest a type, such as charges, interest, refund or salary

Regular expressions handle most of the structured parts. A language model is useful for the messy parts, for example deciding that ACME TRAD and Acme Traders Pvt. Ltd. are the same party, or that inv 423 probably means INV/2024/0423.

Python
import re

UTR_PATTERN = re.compile(r"\b\d{12}\b")
INV_PATTERN = re.compile(r"\bINV[\s/\-]*(\d{2,6})\b", re.IGNORECASE)

def extract_signals(narration: str) -> dict:
    text = narration.upper()
    return {
        "utr_candidates": UTR_PATTERN.findall(text),
        "invoice_refs": INV_PATTERN.findall(text),
        "raw": narration,
    }

The patterns above are examples. Banks format narrations differently, so build your patterns from your own statements.

Step 3: Score each candidate

Each candidate gets a score built from separate, named signals. We prefer a transparent weighted score over a single opaque number, because every part of it can be shown to the reviewer.

Python
def score_candidate(line, candidate, signals) -> dict:
    reasons = []
    score = 0.0

    if line.amount == candidate.amount_residual:
        score += 0.40
        reasons.append("Amount matches the open balance exactly")

    if candidate.number_digits in signals["invoice_refs"]:
        score += 0.35
        reasons.append(f"Description mentions invoice {candidate.number}")

    name_sim = name_similarity(signals["raw"], candidate.partner_name)
    if name_sim >= 0.8:
        score += 0.15
        reasons.append(f"Counterparty name resembles {candidate.partner_name}")

    days = abs((line.date - candidate.due_date).days)
    if days <= 7:
        score += 0.10
        reasons.append(f"Paid {days} days from due date")

    return {"candidate_id": candidate.id, "score": round(score, 2), "reasons": reasons}

The weights here are illustrative, not recommendations. Tune them against your own reconciled history (more on that below).

Where a language model helps, and where it does not

A model is good at reading text: normalising names, spotting an invoice number written oddly, classifying a line as a bank charge. It is not the right tool for arithmetic or for deciding that two amounts are equal. Keep amount and date logic in plain code, and let the model contribute named signals that feed the same score.

This also keeps costs predictable. If the model only runs on lines that the rules could not settle, you send far fewer requests. Putting a hard monthly spending cap on the model calls is sensible either way.

Every suggestion needs an explanation

A suggestion without a reason forces the reviewer to redo the work. A suggestion with reasons lets them check it in seconds. We store each suggestion in a shape like this:

JSON
{
  "statement_line_id": 18842,
  "suggested_match": "INV/2024/0423",
  "score": 0.90,
  "band": "high",
  "reasons": [
    "Amount matches the open balance exactly",
    "Description mentions invoice 0423",
    "Counterparty name resembles Acme Traders Pvt. Ltd."
  ],
  "warnings": [],
  "alternatives": [
    {"match": "INV/2024/0431", "score": 0.40, "reasons": ["Amount matches the open balance exactly"]}
  ]
}

Three details matter:

  1. Reasons are facts the reviewer can verify, not phrases like "the model is confident". Each one points at something visible on the screen.
  2. Warnings are shown as prominently as reasons. Examples: two open invoices with the same amount, an amount that differs by a small fee, a partner whose bank account has changed recently.
  3. Alternatives are listed. If the second-best candidate is close, the reviewer should see it. A big gap between first and second is itself useful information.

Confidence thresholds: setting the bands

A raw score is hard to act on. We group suggestions into bands that decide how they appear in the review queue:

Band

What it means

How it is shown

High

Strong, independent signals agree, and no close alternative

Pre-selected, confirm in bulk after a quick scan

Medium

Some signals agree, or an alternative is close

Shown one by one with reasons and alternatives

Low

Weak signals only

Listed as a hint, reviewer searches manually

None

No candidate passed the filters

Sent to the manual queue

Notice that even the high band is pre-selected, not posted. The person still presses the button.

Calibrate on your own history

Do not pick thresholds by feel. Use statement lines you have already reconciled by hand as a test set:

  1. Export a few months of reconciled lines with the ledger item each was matched to.
  2. Run the matcher on those lines without showing it the answers.
  3. For each score range, count how often the top suggestion was the correct one.
  4. Set the high band where the hit rate is high enough that bulk confirmation is reasonable for your team. Set the low band where suggestions stop being useful.
  5. Repeat after any change to the weights or patterns.

Two rules we apply on top of the score:

  • Ambiguity caps the band. If two candidates score within a small margin of each other, the line cannot be in the high band, whatever its score.
  • Some line types never go high. Large amounts, first payments from new parties, or lines touching sensitive accounts can be forced into the medium band so someone reads them properly.

Why a person still confirms

It is tempting to auto-post everything above some score. We advise against it, for practical reasons rather than caution for its own sake.

The cost of errors is uneven. Matching a payment to the wrong invoice of the right customer is annoying. Matching it to the wrong customer means a dunning email to someone who already paid and a credit sitting on someone else's account. One wrong match can cost more time than a week of saved clicks.

Some cases need context the data does not hold. A customer paying two invoices in one transfer, a short payment because of a dispute, a refund that looks like a receipt. A person who knows the account resolves these quickly. A matcher can only flag them.

Duplicates and fraud look like good matches. A duplicated vendor payment matches an open bill perfectly. So does a payment to a bank account that was quietly changed. Human review, helped by warnings, is where these get caught.

Accountability stays clear. Auditors and finance leads want to know who approved each entry. When the matcher suggests and a named user confirms, the audit trail records both: what was suggested, the reasons, the score, who confirmed it and when. If a reviewer overrides a suggestion, that is recorded too, and it becomes training data for better weights.

Confirmation is fast when explanations are good. The point of AI here is not to remove the reviewer. It is to turn a search task into a checking task. Checking a pre-selected match with three clear reasons takes seconds.

Handling the harder shapes

Not every line is one-to-one. Plan for these from the start:

  • One payment, several invoices. Search for combinations of open invoices from the same party that sum to the amount. Limit the search size, and always send these to the medium band.
  • Several payments, one invoice. Partial payments. Match each against the residual amount and show the remaining balance.
  • Net of charges. A transfer that arrives slightly short because a gateway or bank fee was deducted. Suggest the invoice plus a write-off line to the charges account, and let the reviewer approve both.
  • Gateway settlements. One bank credit covering many customer payments collected through a payment gateway. These are best matched against the gateway's settlement report rather than individual invoices.

Rolling it out

A sequence that works for most teams:

  1. Start in suggestion-only mode. The matcher writes suggestions, nobody bulk-confirms.
  2. Track how often reviewers accept, change or reject the top suggestion, per band.
  3. Enable bulk confirmation for the high band only once the acceptance rate there is stable.
  4. Review overrides regularly and adjust patterns and weights.
  5. Keep the manual queue visible. Lines with no suggestion should not get lost.

How Kalvyai can help

We build AI agents that work inside Odoo and ERPNext with human approvals, spending budgets and a full audit trail. Bank reconciliation is a good fit for that model: the agent does the reading, a person confirms. You can see more about this kind of work at kalvyai.com/ai-agents.

If you run Odoo, our AI Bank Reconciliation app imports CSV and Excel bank statements and auto-matches UPI, NEFT and IMPS transactions on both Community and Enterprise. Our other apps are at store.kalvyai.com.

If your statements, gateways or approval rules need something custom, get in touch and tell us how reconciliation works in your team today.

Share this article

  • bank reconciliation
  • AI agents
  • Odoo
  • ERPNext
  • accounting automation
  • human in the loop

Kalvyai Engineering · Engineering team

The engineers who build, connect and fix business systems at Kalvyai: Odoo, ERPNext, Shopify and AI agents that work inside them with approvals, budgets and an audit trail.

Comments

No comments yet. Questions and corrections are welcome.

Rate this post or leave a comment

Your rating (optional)
Not rated

Comments appear after an editor approves them. See our privacy notice.

Read next

Claude Tool Use for ERP Tasks: Safe Read and Write Actions (cover)Technical
Kalvyai EngineeringAI agents

Claude Tool Use for ERP Tasks: Safe Read and Write Actions

How to give Claude function calling access to your ERP without giving it the keys: narrow tools, argument validation in code, approval gates for writes, and a log entry for every call. Includes a Python example against Odoo.

6 min read

AI Agent Audit Trail: What to Log and How Long to Keep It (cover)Technical
Kalvyai EngineeringAI agents

AI Agent Audit Trail: What to Log and How Long to Keep It

A practical design for audit trails of AI agents in ERP and commerce systems: which events to record, how to store them so they can't be quietly changed, how long to keep them, and how to use them to investigate an incident.

8 min read

Newsletter

Get new guides in your inbox.

Practical notes on Odoo, ERPNext, Shopify and AI agents, written by the engineers who build them. No spam, and you can ask to stop at any time.

Prefer a feed? Subscribe by RSS. We use your email only to send new articles. See our privacy policy.