Securing the Transaction Network: The ML Model, the Agent Pass, and the Graph
Start from the bank’s side of the counter. A machine learning model scores every transfer; a bounded LLM agent adds a second pass over flagged alerts; and every claim the agent makes has to be backed by graph evidence retrieved from FalkorDB.
1. The Bank and the Money-Flow Network
Start from the bank’s side of the counter. You operate a transactional network that clears hundreds of thousands of transfers, and you already run a machine learning model that scores every one of them. The open question is no longer whether the model can flag suspicious activity. It is what happens after an alert fires: how much of the surrounding network a reviewer can actually see, and how far the evidence behind a decision can be trusted.
New engineers tend to arrive with one straightforward rule: “Why can’t we just write an SQL query that flags transactions greater than $10,000?” Sophisticated bad actors anticipate exactly that query. Real-world money laundering rarely takes the form of a single million-dollar wire from an illicit entity into a luxury asset account. Illicit syndicates fracture capital across dozens of intermediary conduit accounts, stagger timestamps across banking holidays, and calibrate individual amounts to sit just beneath regulatory thresholds.
Placement: Injecting illegitimate cash into legitimate financial institutions (e.g., small cash deposits across multiple automated teller machines).
Layering: Concealing the audit trail through an intricate web of transfers, cross-border wires, and shell companies.
Integration: Withdrawing the cleaned funds through legitimate commerce, commercial invoices, or real estate purchases.
Tripwire is organized around that reality as a layered system, not a single oracle:
- Layer one, the model: a gradient-boosted model scores every replayed transaction, and deterministic policy routes each score to a simulated block, the review queue, or straight-through processing.
- Layer two, the agent pass: a bounded LLM agent picks up flagged reviews and reads the surrounding activity in context, instead of guessing from the aggregates the model was trained to carry.
- The graph underneath: accounts and transfers live in FalkorDB as first-class nodes, so the agent’s context is retrieved evidence rather than model memory.
This guide follows that layered path in order: what the model can and cannot do (section 2), what changes when an agent pass is added on top (section 3), and how the agent reads the transaction graph through bounded tools (section 4). The remaining sections cover the AML patterns the graph exposes, the full pipeline, the analyst workbench, and further reading.
2. Layer One: The Model That Scores the Stream
The first layer is deliberately boring technology, because it has to run across the whole stream. Tripwire pairs graph-derived features with a high-performance gradient boosting detection engine. During the model selection tournament (recorded in the Iteration 2 benchmarks), three candidate architectures were evaluated against the baseline:
| Model Candidate | Feature Set | Test AP | Hard Bulk AP | Recall @ Budget |
|---|---|---|---|---|
| Baseline (Iter 1) | Simple tabular counts | 0.158 | 0.150 | 21.4% |
| Candidate C3 | Tabular + velocity windows | 0.241 | 0.150 | 21.4% |
| Candidate C2 | Graph degree + ratios | 0.733 | 0.574 | 47.5% |
| Champion C1 | Full Vectorized Graph Features | 0.752 | 0.600 | 47.7% |
Standard test splits often include easy, high-value transfers. Tripwire evaluates models on the stringent Hard Bulk September 9–10 split, isolating structured, multi-account syndicate activity. Champion C1 maintains an outstanding 0.600 Average Precision on this difficult slice.
The Three Deterministic Routes
Scores produced by the Champion model are mapped into three operational lanes:
Score >= 0.999. Immediate simulated containment. Automated hold on funds. Cannot be reversed by LLM agents.
Score >= Review Threshold (0.475 - 0.700). Primary operational queue (1,585 alerts). Dispatched to compliance investigators.
Score < Threshold. Standard straight-through processing. Preserved in replay audit log for historical baseline reference.
One limitation of this layer is structural, not a tuning problem. Every feature the model consumes was designed in advance, and many of them are aggregates: counts, velocities, ratios, balances. That compresses a sequence of related transfers into a handful of numbers, and a pattern that only exists in the shape of the activity, such as a fan-out ring or a pass-through chain, survives only as a blur. The model can rank the stream; it cannot follow a funds path, and it cannot explain itself to a reviewer. That gap is where the second layer comes in.
3. Layer Two: The Agent Pass on Flagged Reviews
To increase security, the bank adds a second pass. Instead of asking one model to carry the whole decision, Tripwire runs an LLM agent downstream of the detector, over the transactions the model already flagged. The agent’s job is narrow and explicit: look at the alert in the context of the surrounding network, and say whether the evidence supports escalation.
The pass is opt-in per investigation. With the agent disabled, a request returns the deterministic report: fast, free, and evidence-bound. With use_llm enabled and a provider configured, the same evidence set feeds a Gemini tool-calling agent. It selects among the approved graph tools, drafts a hypothesis with a risk level and reasoning, and the draft then has to survive a deterministic verifier. The provider is allowed to fail; the review is not.
The Four Rules That Keep the Pass Bounded
The agent is invoked only for flagged reviews that opt in. The bulk of the stream keeps the speed and low cost of the deterministic path, so spending on context follows attention, not volume.
The model never writes Cypher and never touches the raw database. It asks through typed, read-only tools over the Model Context Protocol: trace_funds, inspect_counterparties, and detect_flow_patterns. Arguments are validated against their ranges before any database call, and hops, windows, and row limits are capped.
The model never sets the risk score, the decision, or the recommendation; the recommendation is fixed to human review by code. A rule-based block cannot be reversed by the agent. Case proposals pass a separate deterministic gate and can only write to the local case store.
Tool calls, model rounds, and wall time are bounded by configuration, and every executed statement, parameter set, row count, and duration lands in the tool trace. Provider errors, timeouts, invalid output, and failed verification all resolve to the deterministic report, with the reason recorded instead of an exception shown.
What reaches the analyst is only what survived verification. A verified draft reads like a review, not a lecture: a risk level from 1 to 5, a hypothesis, supporting and counter-evidence transaction IDs, and one to six reasoning points, each tied to the evidence IDs that back it. If any cited ID, amount, currency, timestamp, or path is not in the records the tools actually returned, the draft is rejected and the deterministic report stands in its place.
Coinbase’s Onramp team layered an LLM risk agent onto their existing ML model and rules, downstream of those checks: the agent can block a transaction that would otherwise be allowed, but it cannot override an upstream block. In an online experiment, the agent-enabled flow recorded 30% fewer fraudulent transactions and 22% less fraud value than the existing stack alone. Their write-up, How Coinbase Built, Evaluated, and Post-Trained a Fraud Agent, is the closest public account of the same design decisions, and it is worth a full read. It is referenced again in section 9.
4. What the Agent Reads: The Graph
The agent pass is only as good as the context it can reach, and in Tripwire that context is the money-flow graph itself. The bank’s ledger was always a sequence of transfers between accounts; the design decision is how to store it. Modeling transactions as edges between accounts (e.g., (:Account)-[:TRANSFERRED]->(:Account)) is a common pitfall. When multiple transfers occur between the same two accounts over time, edges accumulate arrays of timestamps and amounts, and multi-hop Cypher queries become slower and less precise.
Tripwire enforces a fundamental architectural invariant: First-Class Transactions.
Tripwire Canonical Graph Schema: Transactions are nodes holding immutable attributes (timestamp, amount, currency, channel).
This modeling choice delivers three major operational advantages:
- Stable Transaction IDs: Every transfer possesses a permanent node ID, allowing deterministic joins between machine learning inference artifacts and graph topology.
- Bi-directional Traversal: An investigator can effortlessly trace upstream sources of funds (
SENT) or downstream dispersion (RECEIVED) in a single Cypher hop. - Zero Multi-Edge Overhead: FalkorDB stores each transaction as an independent entity in sparse matrix memory, keeping neighbor degree operations O(1).
is_laundering) and ground-truth typologies remain quarantined in offline evaluation test sets. The inference graph and API contracts never receive or return ground-truth labels.When a reviewer or the agent asks a question, it is answered by bounded Cypher executed against FalkorDB, a high-throughput graph database engine built upon Redis that translates queries into sparse-matrix operations via GraphBLAS. The agent reaches it through the same three approved read-only tools every time:
Ordered transaction and account paths outward from the anchor transfer, by direction, depth, time window, and row limit.
The accounts on both ends of the anchor and the source-backed repeated activity around them.
Fan-in, fan-out, and pass-through matches, with the supporting transaction IDs for each match.
MATCH path = (origin:Account)-[:SENT]->(tx:Transaction)-[:RECEIVED]->(destination:Account)
WHERE tx.id = $transaction_id
OPTIONAL MATCH (destination)-[:SENT]->(downstream_tx:Transaction)-[:RECEIVED]->(second_hop:Account)
WHERE downstream_tx.timestamp >= tx.timestamp
AND downstream_tx.timestamp <= tx.timestamp + $time_window
RETURN path, downstream_tx, second_hop LIMIT $result_limit;In production sweeps against 998,021 transactions and 354,660 accounts, FalkorDB delivers:
- Trace Funds P95: 6.20 milliseconds
- Counterparty Inspection P95: 2.33 milliseconds
- Pass-Through Detection P95: 1.98 milliseconds
5. The AML Patterns the Graph Exposes
In the synthetic IBM AMLworld dataset, laundering syndicates repeat a small set of structural behaviors. Each is awkward to express as a predefined feature and natural to express as a traversal, which is why the second layer works on a graph in the first place:
Interactive AML Typology Explorer
Select a synthetic IBM AMLworld typology pattern to see its graph mechanism, red flags, and the Cypher pattern that exposes it
Layered Fan-Out (Dispersion)
A primary origin account transfers a large sum into multiple intermediate mule accounts within a compact time window to fracture audit visibility.
A single high-balance account sends funds to between 5 and 20 recipient accounts within 10 to 60 minutes. Recipient accounts typically disperse the money further or liquidate via physical branch withdrawals.
- Source account out-degree explodes from 1.2 to >15.0 within 24 hours.
- Outbound transfer amounts are near-uniform or structured in tranches.
- Recipient accounts have low historical activity prior to receiving funds.
MATCH (origin:Account {id: $source_id})-[:SENT]->(tx:Transaction)-[:RECEIVED]->(mule:Account)
WHERE tx.timestamp >= $window_start AND tx.timestamp <= $window_end
WITH origin, count(DISTINCT mule) AS fan_out_degree, collect(tx.amount) AS tranche_amounts
WHERE fan_out_degree >= 5
RETURN origin.id, fan_out_degree, tranche_amountsNotice how each typology is characterized by a distinctive topological footprint: fan-outs create star graphs, structuring creates inbound bottlenecks, pass-throughs form linear conduit chains, and round-tripping forms directed cycles.
6. The Full Pipeline, End to End
Putting the layers in order: the replay stream feeds a point-in-time feature store, the model scores every transaction into deterministic routes, the agent pass picks up the flagged reviews, the graph supplies the evidence, and the analyst owns the conclusion.
End-to-End System Pipeline
Click any architecture stage to examine its implementation, latency profile, and invariants
Stage 3: Layer One - Champion Detection Model
The LightGBM champion scores every transaction along a calibrated risk distribution; deterministic policy routes each score into block, review, or standard path.
- 0.752 average precision on the held-out test cohort, 0.600 on the hard September 9-10 bulk slice.
- 76,988 transactions per second on a single CPU thread.
- Three deterministic routes: blocked_by_rule, flagged_for_review, standard_path.
Deterministic policy ownership: models output scores, deterministic rules decide.
The pipeline is engineered for sub-second analyst responsiveness. While the model scores over 76,000 transactions per second, graph evidence traversal completes in under 7ms on the demo slice, so the wait a reviewer actually notices is the agent pass, never the database.
7. The Analyst Workbench Guide
Now that you understand the underlying architecture, here is how to navigate the Tripwire workbench interface efficiently:
1. Overview Command Center (/overview)
Your operational cockpit. The top KPI HUD shows cohort size, risk triage breakdown, and FalkorDB engine status. The alert queue defaults to Flagged for review (1,585 alerts). Click the Inspect eye button on any row to open the peek drawer for a quick risk preview without losing queue position.
2. Investigation Canvas (/investigation/[id])
The graph workstation. The conversation pane logs the agent pass as it runs: every graph tool call with its purpose, the executed Cypher and its parameters, and what each result added to the graph. The review ends with a verdict: the simulated decision, the risk level, the path through the escalation chain, and the verified reasoning with clickable evidence. The graph canvas shows traveling money-flow animations on the retrieved edges, and the queue stepper (Previous Alert / Next Alert) moves through queued items sequentially.
3. Performance & Evaluation Lab (/performance)
The benchmark hub. Review Champion vs Baseline Average Precision deltas (+374%) and latency distributions. Use the Interactive Alert Budget Simulator slider to project daily alert volume, true vs. false positive ratios, and analyst workload hours.
Press ? anywhere in the application to view the shortcuts cheat-sheet. Press / to focus the transaction search input, and Esc to dismiss drawers and modals.
8. Technical Glossary & Key Terms
A searchable reference guide explaining the core vocabulary across machine learning, graph databases, and financial crime compliance:
Interactive Technical Glossary
Quick reference for core concepts across Machine Learning, Graph Databases, and AML
9. Further Reading: Field Notes
The layered design in this guide is not unique to Tripwire; banks, exchanges, and payment processors are converging on the same division of labor. The closest public account is Coinbase’s three-part series on their Onramp fraud agent, which documents the build, the evaluation method, and the post-training work in unusual detail:
Part 1: How Coinbase Built, Evaluated, and Post-Trained a Fraud Agent
Coinbase Onramp placed an LLM risk agent downstream of its existing ML model and rules engine. The agent reviews recent transaction sequences in context as a constrained reviewer rather than an open-ended workflow, can block a transaction the model would have allowed, and can never override an upstream block. Part 1 covers the build and the online experiment; the later parts cover how the team evaluated frontier models on a domain benchmark and post-trained a smaller model to own the task.
Fewer fraudulent transactions in the agent-enabled treatment group
Less fraud value than the existing stack alone
Projected fraud savings over estimated inference cost
- Route selectively: the model and rules handle broad screening, the agent adds contextual review.
- Keep the decision path simple and bounded, with application code owning the policy.
- Instrument the serving layer so detection behavior and serving behavior stay separable.
One scope note before you cite anything on this page: Tripwire is a synthetic IBM AMLworld workbench, not a production deployment and not a Coinbase replica. The shared lesson is about the shape of the system, a model for coverage, an agent for context, and deterministic code for authority. The benchmark numbers in this guide describe the synthetic replay only and do not establish real-world AML effectiveness.