> This page is for Kumo Engine.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/sdgm/llms.txt.

# Money Laundering Detection

Predict whether each account will be reported for money laundering in the coming weeks so an investigations team can review the riskiest accounts before the funds move on.
Money laundering moves illicit funds through a network of accounts and transactions to disguise their origin.

Kumo Engine learns from each account's attributes and the funds it has sent and received across the transaction network represented in the graph.
These network patterns are missed by a rule applied to a single account.

## Data and relationships

For a Databricks example using prepared labels for simulated future reports within 30 days, see [Screen accounts for money muling](https://github.com/NVIDIA/kumo-engine/blob/main/examples/kumo-example-notebooks/kumo-engine/fsi/notebooks/databricks_kumo_engine_money_muling_detection.ipynb).
The notebook targets `accounts.mule_label` and keeps reports outside the feature graph; this page uses a temporal report aggregation query.

The example assumes a prepared Kumo Engine `graph`, a matching `snapshot`, and these tables:

![Accounts connect to reports directly and to transactions through inputs for senders and outputs for receivers. The five tables show their defined fields, the primary keys accounts.account\_id, transactions.transaction\_id, inputs.input\_id, outputs.output\_id, and reports.report\_id, five foreign keys, four timestamp time columns, and optional transaction amount.](/sdgm/_fern-files/nvidia-sdgm.docs.buildwithfern.com/429fba99ecf8d617d1c4c7878715fdcfb515bcb29cf5f453c8bec89b0956c6db/_dot_dot_/images/diagrams/workflow-money-laundering-detection-schema.svg)

| Table          | Required columns                                         | Purpose                                                                                                                                                                                         |
| -------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `accounts`     | `account_id` as the primary key                          | A static entity table of accounts being scored, with attributes such as account type or opening date and no time column.                                                                        |
| `transactions` | `transaction_id`, `timestamp`                            | Each movement of funds, with an optional `amount` and `timestamp` as the time column; transactions link to accounts through the `inputs` and `outputs` tables rather than a direct foreign key. |
| `inputs`       | `input_id`, `transaction_id`, `account_id`, `timestamp`  | The sending side of each transaction, with one row linking a transaction to the account the funds came from and `timestamp` as the time column.                                                 |
| `outputs`      | `output_id`, `transaction_id`, `account_id`, `timestamp` | The receiving side of each transaction, with one row linking a transaction to the account the funds went to and `timestamp` as the time column.                                                 |
| `reports`      | `report_id`, `account_id`, `timestamp`                   | Money-laundering reports filed against accounts, such as suspicious-activity reports, with filing time recorded in the time column `timestamp`; these are the events the queries below predict. |

The `inputs` and `outputs` bridge tables represent money flow in both directions; there is no direct foreign key from `transactions` to `accounts`.

The direct foreign key from `reports` to `accounts` lets the queries below count an account's future reports.
Although the query text only counts reports, the model learns from the transaction network: funds sent through `inputs` and received through `outputs` shape each account's prediction.

## Score each account for money-laundering risk

This query predicts whether each account will be reported for money laundering in the next 30 days.
`COUNT(reports.*, 0, 30, days)` counts reports filed against the account over the 30 days following the scoring time.
`> 0` converts the count into a yes or no label, and `FOR EACH accounts.account_id` produces one prediction per account.

The forward window is anchored at the scoring time you run the query, rather than at each account's own history.
It is the half-open interval `(scoring time, scoring time + 30 days]`, shared by every account scored in the same run.
Every transaction and any earlier report is dated before that anchor, so training and scoring use only information known before the prediction window.

Use `COUNT(reports.*, 0, 30, days) > 0` for this target; Kumo Engine treats a raw report count as a numeric target and scores it as a regression.

```python
from kumo.engine import PredictiveQuery

query_text = (
    "PREDICT COUNT(reports.*, 0, 30, days) > 0 "
    "FOR EACH accounts.account_id"
)
query = PredictiveQuery(graph, query_text)
query.validate()
print(query.get_task_type())  # binary_classification
```

## Focus on accounts that just moved funds

Scoring every account on a fixed schedule supports periodic sweeps.
To review accounts as soon as funds arrive, use the same 30-day prediction with a `WHERE` filter that includes an account in training and scoring only if it received funds in the 7 days up to the scoring time.

`COUNT(outputs.*, -7, 0, days) > 0` counts the account's incoming transactions over the 7 days before the anchor, focusing the model on currently active accounts.
The target remains whether the account will be reported in the next 30 days.

```python
query_text = (
    "PREDICT COUNT(reports.*, 0, 30, days) > 0 "
    "FOR EACH accounts.account_id "
    "WHERE COUNT(outputs.*, -7, 0, days) > 0"
)
query = PredictiveQuery(graph, query_text)
query.validate()
print(query.get_task_type())  # binary_classification
```

## Reading the predictions

Both queries return a probability that an account will be reported for money laundering within the next 30 days.
An investigations team can rank accounts by that probability and open a review, file a suspicious-activity report, or place a temporary hold on the highest-risk accounts before further transfers obscure the funds' origin.
The first query scores every account for a periodic sweep of all accounts; the second limits scoring to accounts that recently received funds for monitoring as money moves.

These probabilities are estimates from past behavior, not proof of wrongdoing; every flagged account still needs a human investigation.

The 30-day window is a starting point: widen or narrow it to match how quickly your team can act.
Shift the window forward, for example `COUNT(reports.*, 10, 30, days) > 0`, to separate accounts that need review this week from those to keep on a longer watchlist.

The forward window is anchored at the time you run the query, so the model uses only transaction and report history recorded before that point and never sees the outcome it predicts.
Refresh predictions as new transactions arrive so each decision reflects the account's latest activity.