# Transaction Reconciliation Agent

> A reconciliation agent that matches bank and ledger transactions, flags unmatched items and discrepancies for review, and never force-matches or auto-adjusts the books.

- **Category:** Finance & Accounting
- **Difficulty:** Advanced
- **Setup time:** 45 min
- **Stacks:** Claude, LangGraph, OpenAI
- **Version:** 2.0.0 (updated 2026-06-21)
- **Source:** https://agent-kits.com/kit/transaction-reconciler

## Overview

Reconciles two sources — bank vs ledger, invoices vs payments — matching what lines up.

Attaches a confidence to each match and flags unmatched items, mismatches, and duplicates.

Routes discrepancies to a human for review rather than resolving them silently.

Defensive: never force-matches, never auto-adjusts the books, and reports the exact unreconciled difference.

## When to use it

- You reconcile statements against a ledger and want the matching automated.
- You want discrepancies, duplicates, and timing differences surfaced clearly.
- You need an audit trail and human review for anything that doesn't tie out.
- You want confidence on each match, not a black-box 'balanced.'

## When not to use it

- You want it to auto-adjust or create entries to force a balance — it won't.
- You expect it to approve or post journal entries autonomously.
- You can't supply both sources of data to reconcile.
- You need final sign-off automated (a human owns that).

## Architecture

- **Source intake** — Loads both sources to reconcile (e.g. bank statement and ledger) as read-only inputs.
- **Matching engine** — Matches transactions on amount, date, reference, and counterparty, attaching a confidence to each.
- **Confidence gate** — Leaves ambiguous or low-confidence pairs unmatched rather than forcing them together.
- **Discrepancy detector** — Identifies amount mismatches, duplicates, and timing differences with exact figures.
- **No-adjust guard** — Prevents any creation, edit, posting, or balancing 'plug' entry — the books are never touched.
- **Audit trail** — Records every match and flag so the reconciliation is fully traceable.
- **Review reporting** — Reports the exact net unreconciled difference and routes flagged items to a human.

## Files in this bundle

- `system-prompt.md` — the agent's system prompt
- `tools.json` — tool/function definitions the agent expects
- `workflow.md` — step-by-step run loop
- `.env.example` — environment variables to fill in
- `kit.json` — full structured metadata
- `starters/` — minimal starter snippets
- `LICENSE` — Apache-2.0 (code, configuration, and schema)
- `LICENSE-CONTENT` — CC BY 4.0 (specification text and documentation)
- `NOTICE` — attribution and trademark notice
- `run.py` — **runnable demo**: real agent loop with mock tools (`pip install anthropic`, set `ANTHROPIC_API_KEY`, `python run.py`)
- `agentaz.json` / `agentaz.schema.json` — AgentAz™ governance spec + schema

## Implementation notes

- Keep both sources read-only and hard-block any entry creation, edit, posting, or balancing plug; an agent that adjusts the books to balance defeats the control it's meant to provide.
- Never force a match to clear an item; low-confidence or ambiguous pairs must stay unmatched and flagged, because a wrong match hides a real problem.
- Report the exact net unreconciled difference and the specific items behind it, rather than a vague 'almost balanced.'
- Detect duplicates and timing differences explicitly, since these are common and easy to misread as discrepancies.
- Keep a full audit trail of matches (with confidence) and flags so the reconciliation is defensible.
- Leave all booking and adjustment decisions to a human with proper coding and approval.
- Exact 1:1 matches are cheap-model work; reserve the strong model for the ambiguous matches and discrepancy explanation.

## Variations

- **Basic — Matcher:** Matches transactions between two sources and lists unmatched items. Read-only, on demand.
- **Advanced — Reconciliation with flags:** Adds confidence scoring, discrepancy and duplicate detection, exact net-difference reporting, and review routing — never adjusting the books.
- **Enterprise — Close-cycle reconciliation:** Adds bank/ERP integration (read), configurable matching rules, audit logging, period-close workflows, and accountant review queues.

## FAQ

**Will it adjust my books to make them balance?**

Never. It doesn't create, edit, post, or delete entries, and it won't insert a balancing 'plug' to force a reconciliation. It matches what it can and reports exactly what doesn't tie out for a human to handle.

**What if two transactions almost match?**

If a match isn't clear, it stays unmatched and flagged rather than forced. A wrong match would hide a real discrepancy, so ambiguous pairs are surfaced for review with their exact amounts.

**How does it handle an item in one source but not the other?**

It flags it as unmatched with the exact amount and a likely explanation (for example, an unrecorded bank fee), but it does not book the entry itself — that's a human decision with proper coding and approval.

**Does it hide small differences?**

No. It reports the precise net unreconciled difference and the specific items behind it. Even a small gap is surfaced, because it can indicate an error, a missing fee, or fraud.

**Is there an audit trail?**

Yes. Every match (with its confidence) and every flag is recorded, so the reconciliation is fully traceable and defensible.

**Does it approve the reconciliation?**

No. It prepares the matched set and the exceptions; final review, adjustments, and sign-off stay with a human.


---

© 2026 AgentKits · www.agent-kits.com

**Open source.** Code, configuration, and the AgentAz™ schema are licensed under
**Apache-2.0**; specification text and documentation under **CC BY 4.0** (with
attribution to AgentKits, link to https://www.agent-kits.com). See LICENSE, LICENSE-CONTENT,
and NOTICE in this bundle. "AgentAz" and "AgentKits" are trademarks of AgentKits.

**Flagship reference blueprint.** View the source, AgentAz™ spec, and frozen v1.0 schema
in the public registry: https://github.com/agent-kits/agentaz
Original: https://agent-kits.com/kit/transaction-reconciler
