Back to Case Studies

Graph AI for Crypto Compliance

GNN Risk Scoring and Policy Agents for a RegTech Platform

PrototypeFinancial Services & FinTechCybersecurity & FraudJul 2025 – Sep 2025Voice AI & Autonomous Agents
0.87
ROC-AUC of the GNN, bar was 0.85
0.83
Macro F1 across low, medium and high risk
A–F
One risk rating per counterparty
8 weeks
From assessment to prototype

My Role

Role
Lead ML architect
Independent consulting
Team
Me + 3 engineers (one part-time) + PM
Stage reached
Prototype, handed over
Key decisions
  • Edge-aware GraphSAGE using fraud-ring edge features
  • Class-weighted loss, not oversampling graph nodes
  • Analyst feedback loop to refine the GNN

Approach at a Glance

Details
  1. 1GraphSAGE with Neighbour Sampling
  2. 2Edge-Aware Message Passing
  3. 3Weighted Loss for Imbalance
  4. 4Evaluation and Explanations
  5. 5Feedback Loop Design
  6. 6Graph Agents
  7. 7Risk Scoring Agent: One A–F Rating
  8. 8Policy Agent with RAG
  9. 9Event-Driven Orchestration and API

Executive Summary

An AI intelligence layer for a global RegTech platform that helps regulated crypto businesses decide whether to trust a counterparty. When a transaction arrives from an institution an analyst barely knows, they need to know quickly whether it is risky and what their own policy says to do about it.

We won the project through a technical assessment: build, within 24 hours, a scalable and explainable graph neural network that classifies virtual-asset service providers (VASPs) by risk from their network of interactions. My solution, an edge-aware GraphSAGE model with weighted loss for the heavily imbalanced risk classes, reached 0.87 ROC-AUC and 0.83 macro F1, above the client's bar of 0.85 ROC-AUC, with every high-risk prediction explainable through the subgraph that drove it.

We then built the 8-week prototype: a multi-agent system on AWS in which

  • graph agents analyse the network of institutions and the transaction flows with the GNN,
  • a scoring agent turns all risk signals into a single A–F rating,
  • a policy agent retrieves the firm's own policies and recommends the action to take,
  • an orchestrator coordinates them over an event bus and exposes the result through an API for the analyst's dashboard, with analyst feedback captured for improving the model.

I was the lead ML architect, leading an applied ML engineer, a backend and MLOps engineer, a part-time frontend developer and a PM. The prototype was handed over to the client's team.


Client Profile

The client is a global RegTech platform whose customers are regulated digital-asset firms. Under the Travel Rule, these firms exchange information about the originators and beneficiaries of transfers, which gives the platform a unique view of how VASPs interact with each other.

Why risk analysis on this data is hard:

  • Risk lives in the network, not in one record. A counterparty can look normal on its own but sit in a cluster of unusually interconnected, high-risk institutions, a typical sign of layering. Rules that look at one transaction at a time miss it.
  • Imbalance: most institutions are low risk. High-risk ones are a small minority, exactly the class that must not be missed.
  • Scale: the graph keeps growing, so the model can't require the whole graph in memory for every prediction.
  • Explainability: a compliance decision must be defensible. "The model said D" is not an answer an analyst can give a regulator.
  • From score to action: analysts don't just need a score but the step their own policy requires, such as enhanced due diligence or holding the transaction for review.

Technical Approach

The GNN Assessment

The client provided a synthetic VASP network of about 3,000 nodes and 75,000 edges, generated with realistic structure: a scale-free graph where hubs are more often high-risk, explicit "fraud ring" clusters of high-risk institutions, transaction amounts and timestamps on the edges, and a 70/20/10 split between low, medium and high risk.

  1. GraphSAGE with Neighbour Sampling – GraphSAGE learns to aggregate information from a node's neighbourhood instead of memorising the whole graph, so it generalises to new institutions joining the network. Mini-batch neighbour sampling keeps memory constant as the graph grows: each prediction uses a sampled neighbourhood, not the full graph.

  2. Edge-Aware Message Passing – Not all connections are equal. A transfer inside a known high-risk cluster says much more than a routine one. I made the model edge-aware, using the edge attributes, including the fraud-ring indicator and transaction features, in message passing, so the model learns which connections carry risk, not only how many there are.

  3. Weighted Loss for Imbalance – With only 10% high-risk nodes, an unweighted model learns to predict "low" and still looks accurate. I chose class-weighted loss over oversampling: duplicating nodes in a graph also duplicates their neighbourhoods and distorts the structure the model is learning from. The weights make missing a high-risk node cost more than misjudging a low-risk one.

  4. Evaluation and Explanations – On a held-out 20% of nodes, the model reached 0.87 ROC-AUC (one-vs-rest) and 0.83 macro F1. Macro F1 weighs all three classes equally, so the result isn't inflated by the easy majority class. For explainability, GNNExplainer identifies the nodes and edges that most influenced a correct high-risk prediction, visualised as the subgraph behind the decision: the evidence an analyst can actually show.

  5. Feedback Loop Design – As part of the assessment, I designed how analysts' corrections could refine the model over time: capturing their decisions, training a reward signal from them and using it to adjust the GNN. In the prototype, the first part, capturing analyst feedback, was built.

The Multi-Agent Prototype

  1. Graph Agents – A graph agent builds and updates the knowledge graph of institutional interactions from Travel Rule data. A risk-graph agent analyses individual transaction flows within that graph, for example how a transfer's value compares with the history and whether the counterparty sits in a high-risk cluster, using the GNN.

  2. Risk Scoring Agent: One A–F Rating – Several risk signals arrive from different agents. The scoring agent weighs and consolidates them into a single A–F rating, which is simple enough for an analyst to act on immediately.

  3. Policy Agent with RAG – For elevated ratings, a policy agent retrieves the relevant sections of the firm's own internal policies from a vector index (PostgreSQL with pgvector), and an LLM turns them into a concrete recommendation with its justification: which policy applies, what to do, and why this transaction matches the risk pattern.

  4. Event-Driven Orchestration and API – An orchestrator coordinates the agents over AWS EventBridge, so each agent runs as an independent, scalable service. The results, the rating, the explanation and the recommendation, are exposed through a FastAPI endpoint integrated into the client's dashboard. Analysts' decisions on each case are captured as feedback.


Business Outcome

The client got a working, end-to-end prototype of its intelligence layer in 8 weeks: graph-based risk analysis of the institutions behind a transaction, one A–F rating instead of scattered signals, and a policy-backed recommendation for the analyst, all explainable and served to its dashboard. Analyst feedback is captured from day one, so the model has a path to improve from the people who use it. The prototype was handed over to the client's team.

The GNN at its core cleared the client's quality bar with 0.87 ROC-AUC and 0.83 macro F1 on the assessment network, while staying scalable through neighbour sampling and defensible through explanations.

Technologies

Graph Neural NetworksGraphSAGEPyTorch GeometricGNNExplainerMulti-Agent SystemsRAGpgvectorAWS EventBridgeFastAPIDockerKubernetes

Planning something similar?

Tell me about it on a short call. New projects can start within 2 weeks