LearnSystem design

AML / financial-crime monitoring with an investigator loop

Detect money-laundering patterns across transfers and accounts, generate alerts for investigators, and learn from their outcomes.

ML engineering8 parts

Contents

Constraints

  • 10M customers
  • 20M transfers/day
  • investigator capacity 2k cases/day
  • regulatory filing timelines

What to cover

Sketch your own design first. A complete answer has these parts; the notes say what each should settle.

  1. RequirementsDetect money-laundering patterns across transfers and accounts, generate alerts for investigators, and learn from their outcomes.
  2. Estimates10M customers; 20M transfers/day; investigator capacity 2k cases/day; regulatory filing timelines.
  3. API
  4. Data model
  5. ArchitectureShared graph of customers, accounts, devices and counterparties with network features (PageRank, communities, label propagation).; Transaction-level and customer-level models; typology-specific detectors (structuring, mule networks).; Label platform with versioned, auditable ground truth and quality scores.; Alert prioritisation; investigator UI with explanations; active learning.; Shadow-mode path for new models; governance and model-risk documentation.
  6. Deep dives
  7. Trade-offsrecall vs investigator workload; explainability vs model power (GNNs); per-typology models vs one model; latency (real-time blocking vs batch monitoring).
  8. EvaluationOffline: precision@capacity (top-k per day), recall on confirmed cases, per-typology precision drift.; Online: SAR conversion rate, time to alert, investigator hours per confirmed case.; Label-drift monitoring.

Reference design

One way to answer it, part by part. Open a part once you have your own version of it.

Requirements

Functional: monitor transfers and account behaviour for money-laundering typologies (structuring, mule accounts and networks, rapid pass-through, funnel accounts); generate prioritised alerts and group them into cases per customer or network; give investigators explanations and a network view; record outcomes (SAR filed, no further action, exit relationship) as labels; learn from them.

Regulatory constraints (UK): Money Laundering Regulations 2017 and POCA; SARs to the NCA, with defence-against-money-laundering requests subject to statutory notice periods; tipping-off rules; five-year record keeping; model risk management and explainability expectations; ability to justify why something was or was not alerted.

Latency modes: batch monitoring (daily) for most typologies; near-real-time scoring for outbound payments where a hold is justified — since 30 October 2024, UK payment providers may delay an outbound sterling push payment executed within the UK by up to four business days when they have reasonable grounds to suspect fraud or dishonesty by someone other than the payer (relevant to mule flows; suspected laundering itself goes through the SAR and DAML route).

Assumptions to confirm: 10M customers, 20M transfers/day, 2k investigator cases/day; existing rule-based system with a high false-positive rate; labels only exist for investigated alerts.

Estimates

  • Transfers: 20M/day ≈ 230/s average, ~1k/s peak — modest for streaming features.
  • Graph: ~10M customers, ~15M accounts, ~20M devices, ~100M external counterparties; 90 days of transfers ≈ 1.8B edges, aggregated to ~500M weighted edges (per pair per window). PageRank, community detection and label propagation over this run nightly on a Spark/GraphFrames-scale cluster in a couple of hours.
  • Alert budget: capacity is 2k cases/day. If legacy rules produce ~10k alerts/day at ~3% SAR conversion (~300 SARs), ranking those so the top 2k carry ~12% conversion yields ~240 SARs from a fifth of the work — or more SARs at the same workload. Precision at capacity is the metric.
  • Exploration budget: reserve ~5% of capacity (~100 cases/day) for below-threshold and novel-pattern samples to measure recall and gather labels.
  • Labels: ~2k dispositions/day ≈ 700k/year, heavily biased towards what the old rules flagged; confirmed laundering is rare (~a few % of cases).
  • Real-time path: scoring an outbound payment with cached graph features and live velocity features takes < 50 ms; holds must be rare (target < 0.05% of payments) to avoid customer harm.

API

Stream in:  transfer.created {transfer_id, from_account, to_account | counterparty, amount,
                              currency, channel, device_id, ts}
POST /v1/score/payment   {transfer_id, ...}  → {action: "allow"|"hold"|"alert", score,
                                                typology_scores, reasons[]}   (outbound, real time)
GET  /v1/alerts?queue=…&sort=priority     → [{alert_id, customer_id, priority, typologies[], sla_due}]
GET  /v1/cases/{id}  → {customers, accounts, linked entities graph, transactions, model scores,
                       explanations (top features, typology evidence), history}
POST /v1/cases/{id}/disposition {outcome: "sar"|"no_further_action"|"exit"|"rfi",
                                 typology, reason_code, notes, investigator}
POST /v1/models/{id}/shadow {start, end}   (governance-controlled)

Dispositions are append-only and versioned; corrections create a new label version rather than overwriting history.

Data model

  • Entity graph: Customer, Account, Device, Counterparty, Address nodes; edges for ownership, shared device or address, and transfers (aggregated per window with count, sum, first/last seen).
  • Transfer: id, parties, amount, currency, channel, device, timestamp, payment scheme.
  • FeatureSnapshot: entity, as-of date, transaction aggregates, velocity, network features (PageRank, community id and size, distance to known mules, label-propagation score).
  • Alert: id, entity, model and rule versions, score, typology scores, explanations, created_at, status.
  • Case: grouping of alerts by customer or network, investigator, SLA dates, outcome.
  • Label (versioned, auditable): case or entity, outcome, typology, source (investigator, QA second review, law-enforcement feedback, account closure), quality score (e.g. agreement on double review), label version.
  • ModelRecord: version, training data snapshot, validation report, approvals, shadow results, monitoring thresholds.

Architecture

Flow · 5 stepsAML monitoring architecture

AML monitoring architectureCore banking and payments flow into Kafka, which splits to a real-time outbound-payment path and a nightly lake path. The batch path builds the entity graph, network features, models and prioritised cases, which investigators review and disposition. Dispositions become versioned labels that drive active learning, shadow mode and governance before models go live.Core banking + paymentsCore banking + paymentsKafkaKafkaReal-time pathlive velocity + cachedgraph featuresLakenightly batchPayment modelallow | hold | alertGraph featuresPageRank,communities, labelpropagationModels + legacy rulestransaction, customer, typologydetectorsAlerts and casescalibrated risk × severity → cases bynetworkInvestigator UIexplanations, timeline, graph viewLabel platformversioned, quality-scoredActive learningsampler + retraining → shadow →approvalGovernancemodel inventory, validation, auditlogoutbound paymentsnightly batchdispositionslabelsshadow, approvallive12345StreamBatchInvestigationLearning
  1. Stream in Core banking and payments stream into Kafka; outbound payments take the real-time path.
  2. Nightly batch The lake feeds the nightly graph build and network features.
  3. Score and prioritise Models and legacy rules feed alert prioritisation and cases by network.
  4. Investigate and label Investigators review cases and record dispositions as versioned labels.
  5. Learn and govern Active learning retrains and shadows models; governance validates and approves live.

Streams feed a real-time payment path and a nightly batch path, ending in cases, investigator dispositions and a versioned label platform.Diagram drafted by a local AI model (Inkling 2 Mini) from this page's text and drawn from data. Checked by an independent reviewer.
Data
Steps
StepTitleWhat happens
1Stream inCore banking and payments stream into Kafka; outbound payments take the real-time path.
2Nightly batchThe lake feeds the nightly graph build and network features.
3Score and prioritiseModels and legacy rules feed alert prioritisation and cases by network.
4Investigate and labelInvestigators review cases and record dispositions as versioned labels.
5Learn and governActive learning retrains and shadows models; governance validates and approves live.

Source: This page's text

Boxes
BoxGroupDetail
Core banking + paymentsStreamCore banking + payments
KafkaStreamKafka
Real-time pathStreamlive velocity + cached graph features
Payment modelStreamallow | hold | alert
LakeBatchnightly batch
Graph featuresBatchPageRank, communities, label propagation
Models + legacy rulesBatchtransaction, customer, typology detectors
Alerts and casesBatchcalibrated risk × severity → cases by network
Investigator UIInvestigationexplanations, timeline, graph view
Label platformInvestigationversioned, quality-scored
Active learningLearningsampler + retraining → shadow → approval
GovernanceLearningmodel inventory, validation, audit log

Source: This page's text

Core banking + payments ─► Kafka ─┬─► real-time path (outbound payments):
                                  │     live velocity + cached graph features
                                  │     ─► payment model ─► allow | hold | alert
                                  └─► lake ─► nightly batch:
   Graph build (customers, accounts, devices, counterparties) ─► network features
   (PageRank, communities, label propagation from confirmed mules)
   ─► Models: transaction-level, customer-level, typology detectors
      (structuring, mule networks, pass-through)  +  legacy rules
   ─► Alert prioritisation (calibrated risk × severity) ─► cases (by network)
   ─► Investigator UI: explanations, timeline, graph view, evidence export
   ─► Dispositions ─► Label platform (versioned, quality-scored)
   ─► Active learning sampler + retraining ─► shadow mode ─► approval ─► live
Governance: model inventory, validation, model-risk documentation, audit log

Deep dives

Sequence · 6 stepsInvestigator loop from alert to approved model

Investigator loop from alert to approved modelSix actors run left to right: Alert queue, Investigator, Label platform, Active learning, Shadow mode and Approval. The request moves forward through alerting, disposition, versioned labels and retraining, then shadow mode sends a blind sample of new-only alerts to the investigator and shadow results to approval. Approval closes the loop by sending the approved model back to the alert queue for prioritisation.Alert queueInvestigatorLabelplatformActivelearningShadowmodeApproval1prioritised alert2disposition3versioned labels4retrained model5blind sample of new-only alertsshadow results6approved model live (prioritisation)
Investigator loop from alert to approved modelSix actors run left to right: Alert queue, Investigator, Label platform, Active learning, Shadow mode and Approval. The request moves forward through alerting, disposition, versioned labels and retraining, then shadow mode sends a blind sample of new-only alerts to the investigator and shadow results to approval. Approval closes the loop by sending the approved model back to the alert queue for prioritisation.Alert queueInvestigatorLabel platformActive learningShadow modeApproval1prioritised alert2disposition3versioned labels4retrained model5blind sample of new-only alertsshadow results6approved model live (prioritisation)
  1. Prioritised alert Alerts are prioritised and grouped into cases for investigators.
  2. Disposition The investigator records the outcome as a versioned label.
  3. Labelled learning Versioned, quality-scored labels feed active learning and retraining.
  4. Retrain The sampler and retraining path produce a candidate model.
  5. Shadow review Shadow results, validation reports and approvals are stored per model.
  6. Approval Approval sends the approved model back to the alert queue.

Follow one alert from the queue through investigator disposition, labelled learning, shadow review and approval, ending with the approved model going live.Diagram drafted by a local AI model (Inkling 2 Mini) from this page's text and drawn from data. Checked by an independent reviewer.
Data
Messages
StepFromToMessage
1Alert queueInvestigatorprioritised alert
2InvestigatorLabel platformdisposition
3Label platformActive learningversioned labels
4Active learningShadow moderetrained model
5Shadow modeInvestigatorblind sample of new-only alerts
5Shadow modeApprovalshadow results
6ApprovalAlert queueapproved model live (prioritisation)

Source: This page's text

Labels are biased and noisy. Only alerted customers get labels, investigators differ, and “no SAR” does not mean innocent. Hence the label platform: versioned outcomes, reason codes, quality scores from double-reviewed samples, and weighting of labels by quality. Active learning spends part of capacity on uncertain and below-threshold cases, giving labels outside the old rules’ blind spots and an estimate of recall.

Mule networks need the graph. A single mule account looks like a student receiving transfers; the network shows fan-in from many unrelated senders, rapid fan-out to crypto exchanges, shared devices and new accounts. Graph features fed to a GBDT give most of the lift and stay explainable; GNNs can be a challenger in shadow.

Shadow mode before replacing anything. A new model runs beside the incumbent for weeks, producing would-be alerts; investigators review a blind sample of alerts that only the new model raises. Promotion needs higher precision at capacity, no typology losing recall, and model-risk sign-off.

Trade-offs

  • Recall vs investigator workload: lower thresholds find more laundering but bury investigators; optimise precision at the fixed capacity, and argue for more capacity with evidence of what is being missed.
  • Explainability vs model power (GNNs): GNNs can capture subtle network structure but are hard to explain to investigators and regulators; prefer engineered graph features with a GBDT and attribution, and use a GNN to propose features or as a shadow challenger.
  • Per-typology models vs one model: typology detectors are interpretable and map to how investigators work and how SARs are written; one model ranks better overall. Use per-typology scores as inputs and explanations, and one prioritisation model on top.
  • Latency (real-time blocking vs batch monitoring): real-time holds stop money leaving but harm customers when wrong and must be rare and fast to resolve; most typologies need days of behaviour, so batch is the right default.

Evaluation

  • Offline: precision@capacity (top-k per day against later dispositions), recall on confirmed cases (including those found by other routes, such as law-enforcement requests), per-typology precision and its drift, calibration of risk scores; time-based splits only.
  • Online: SAR conversion rate of alerts, time from first suspicious activity to alert, investigator hours per confirmed case, backlog age vs SLA, real-time hold rate and false-hold rate.
  • Label-drift monitoring: shifts in disposition mix per typology, investigator agreement on double-reviewed samples, changes in label sources; retraining paused if label quality drops.
  • Governance: shadow results, validation reports and approvals stored per model; periodic independent review; fairness checks on alert rates across customer segments, avoiding protected characteristics and proxies.

What a strong design shows

  • Optimises precision at investigator capacity and reserves budget for exploration to estimate recall.
  • Uses a shared entity graph with network features to catch mule networks, while keeping explanations investigators can use.
  • Treats labels as a versioned, quality-scored platform, aware of selection bias and investigator noise.
  • Ships new models through shadow mode, validation and model-risk governance.
  • Distinguishes batch monitoring from rare, fast real-time holds, grounded in UK rules and filing timelines.

Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.