How Bretton resolves counterparties in messy transaction data

November 24, 2026
Shrey Jindal
Software Engineer

Inside Bretton’s approach to identifying counterparties across inconsistent transaction records, with precision built into how matches are evaluated and accepted.

Financial transaction data rarely identifies counterparties consistently. A single case can contain 200,000 rows, with evidence scattered across names, payment descriptions, and account identifiers. Before that activity can be analyzed, someone or something has to establish which records belong to the same party.

That takes more than matching similar names. A description such as “SQ *ACME COFFEE #42 SEATTLE WA” contains different evidence from “ACME LLC” or an account number alone. The system has to interpret the bank’s fields, separate counterparty information from processing details, and determine whether the evidence supports a shared identity. Different descriptions may belong together; similar names may refer to unrelated businesses.

Getting those assignments wrong changes the investigation. Missed connections can hide suspicious activity. Incorrect merges can create misleading patterns and trigger false escalations.

At Bretton, we built and evaluated an intelligent entity solution for this problem. It selects relevant evidence from each case, compresses repeated records, and uses model panels with separate merge verification. Here’s how the design works and what we measured.

Design around the consequences of an incorrect merge

Grouping transactions requires deciding whether records refer to the same party. A missed link fragments one counterparty’s activity. A false merge combines activity from different parties, potentially making an unrelated company appear connected to a suspicious flow.

Both errors matter. We prioritized the precision of accepted matches because an incorrect merge can distort the totals and relationships used in an investigation. Our evaluation reflects that preference: a false merge receives five times the penalty of a missed link.

That preference also shaped the acceptance rules. Models can abstain, proposed merges receive a separate verification pass, and unresolved records remain visible.

Why we moved beyond rules and single prompts

Our earlier system used keyword lists, name similarity scores, and tuned thresholds. Assumptions that helped one bank feed could hurt another, and supporting new formats meant accumulating exceptions.

A single model call faced a different challenge: interpreting the schema, extracting counterparties, normalizing names, and maintaining consistent groupings across thousands of rows. Repeating the call could produce different answers.

We divided the work into smaller judgments that could be checked separately. Recursive Language Models informed how we inspect and decompose large inputs; Agentic MapReduce informed how we parallelize judgments and combine their results. We adapted those ideas to counterparty resolution with panel voting, abstention, and separate merge verification.

The model judges; code counts. Models interpret fields and judge counterparty matches, using panels of three to five calls. Deterministic code handles statistics, vote counting, arithmetic, and identifier assignment. No keyword lists or name similarity heuristics make the content judgments.

Inspect the data, then compress repeated evidence

Code first counts and samples every column and raw feed field, producing an inventory of the case.

A three-call model panel uses that inventory to identify fields containing party names, free-text descriptions, and account identifiers. It also selects fields to exclude from matching, such as dates and amounts. The result is a field-selection plan for the case, rather than a fixed interpretation of every bank’s schema.

The plan is checked before execution. If it excludes the only useful field or selects a nonrepeating identifier as a grouping key, the model is asked to reconsider.

Code then groups rows with identical values across the selected evidence fields into a shared signature. In a representative case, 20,000 transaction rows became approximately 600 signatures.

Each signature is evaluated by a model panel, and its decision is applied to the corresponding rows. This reduces repeated model work while giving identical evidence the same treatment within the case. Additional transactions that repeat existing signatures require less model work than transactions containing new evidence.

Classify signatures, then verify proposed merges

In the map stage, a five-call model panel classifies each signature as an external counterparty, the account holder, bank processing information, or no identifiable party. For an external counterparty, it also proposes a canonical name.

Code counts the panel’s votes, and a majority determines the result. If no answer receives a majority, the system abstains rather than forcing an assignment.

Extracting a counterparty and linking it to another representation are separate decisions. A proposed canonical name does not, by itself, establish a shared identity.

The reduce stage separates three operations:

  • Audit: remove generic labels such as “PAYMENT” and exclude the account holder from the external counterparty set.
  • Clustering: propose which counterparty representations belong to the same entity.
  • Verification: re-examine every proposed merge with a separate model panel. Proposals that fail verification leave the records separate.

A separate verification panel can still share the proposing panel’s blind spots. We therefore measure errors across all stages, including those that survive verification.

Keep computation and failure behavior explicit

After resolution, code assigns entity identifiers and maps the decisions back to the original transaction rows. The same resolution decisions produce the same identifiers, although model judgments can still vary between runs.

In production, the system writes an entity ID and display name to each row and produces per-entity summaries containing transaction totals, date ranges, and observed name variants. Downstream agents use those summaries, while unresolved records remain separate and visible for further investigation.

Every model call passes through Bretton’s agent gateway under a structured-output contract. Each call attempt and its token usage are recorded in telemetry.

If model access remains unavailable after nine retries, the case fails explicitly. The system never silently switches to heuristic matching, which would introduce different resolution behavior when the primary method is unavailable.

Measure precision, coverage, and repeatability

We evaluated the system on 612 real cases containing approximately 33,000 randomly sampled transaction-row pairs. AI-generated labels identified whether each pair belonged to the same entity or to different entities, and humans verified those labels.

Pairwise precision was approximately 99.6%: about 996 of every 1,000 evaluated pairs predicted to belong together were correct. This measures the correctness of predicted relationships, rather than the proportion of cases resolved entirely correctly.

Recall was approximately 86%, meaning 14% of labeled same-entity pairs remained unconnected. Across repeated runs, approximately 99.8% of evaluated pair decisions stayed the same. Repeatability measures stability, not correctness.

In a stress test combining approximately 195,000 transactions into one case, processing completed in under ten minutes for $5.71 in model costs. There were three false merges among 11,596 evaluated pairs. These results describe the tested inputs, rather than guarantees for every feed.

A stronger foundation for each investigation

Counterparty resolution determines which transactions are analyzed together and which relationships become visible. An error at that stage can carry into otherwise sound analysis.

This implementation shows how we approached that problem: reduce repeated evidence, separate interpretation from computation, and verify proposed relationships before accepting them. Evaluation measures both the connections the system gets wrong and those it leaves unresolved.

Before an agent can draw conclusions about money moving between parties, it has to establish who those parties are.

If your team is exploring AI for financial crime investigations, talk to us about where Bretton could help.

Get the next one first
Sign up to receive blog posts directly to your email

AI agents for the financial back office

Bretton builds AI agents for the back office of banks and financial institutions — compliance review, investigations and the operational work that still scales with headcount. Payward, the parent company of Kraken, uses Bretton to clear high-risk cases with full quality control instead of hiring against the backlog.

Share this post
Copied!

Table of contents

The Compliance Leader's Guide to Agentic AI

Get a practical framework for evaluating agentic AI solutions purpose-built for regulated financial institutions