Skip to content

Repository files navigation

# πŸš€ AI-Native Event-Driven Digital Banking Platform & Core AML Engine

License: MIT

MSc Artificial Intelligence β€” University of Liverpool

A production-grade, event-driven Digital Banking ecosystem featuring a cooperative multi-agent reinforcement learning core for end-to-end transaction monitoring and compliance.


πŸ“– Overview

This platform is a comprehensive AI-Native Digital Banking Backend and Core Engine built from scratch to address the industry's most critical compliance bottlenecks. Traditional AML systems rely on static rules with false-positive rates exceeding 95 %, costing billions in manual review while sophisticated laundering schemes go undetected.

This project replaces legacy rule engines with an intelligent core workflow: a fully functional, event-driven banking environment integrated with three specialised ML agents that learn to cooperate through Multi-Agent Deep Deterministic Policy Gradient (MADDPG). The result is a next-generation core banking architecture capable of producing a single, fully auditable, and explainable compliance decision for every payment in real time.

The platform is designed to be:

  • Production-Grade & Scalable: Driven by event-sourcing and ultra-high-performance financial ledgering concepts.
  • Adaptive: Agents learn directly from compliance officer feedback (Human-in-the-Loop) at runtime.
  • Collaborative: Multi-agent framework ensures independent neural networks cover different fraud dimensions simultaneously.
  • Explainable & Regulatory-Compliant: Powered by TreeSHAP and Integrated Gradients to guarantee dual-layer decision attribution.

πŸ—οΈ System Architecture

The enterprise platform runs as 22 Docker containers β€” 10 Java core banking microservices, 3 Python ML agents, 1 MADDPG orchestrator, and supporting infrastructure β€” communicating exclusively through Apache Kafka with Avro schemas (zero synchronous coupling, high-throughput streaming architecture).

High-Level System Design
Figure 1 β€” High-Level System Design: 22 containers across three Docker Compose stacks implementing an autonomous Core Banking infrastructure.

Core Digital Banking Framework

Every simulated payment traverses a strict, deterministic financial workflow managed by Axon Framework's saga pattern. The core architecture enforces CQRS and Event Sourcing across the banking cluster, producing over 300,000 immutable domain events in a single simulation run, establishing a zero-tamper audit trail for financial regulators.

Simulated Banking Environment
Figure 2 β€” Simulated Digital Banking Environment: 10 decoupled Java microservices connected via high-performance Kafka pipelines.

Payment Processing Lifecycle

The lifecycle demonstrates how a modern Neobank processes payments alongside real-time AI intervention. Ledger state updates, account risk validations, and beneficiary checks are entirely decoupled from the heavy AI-inference pipelines.

Payment Processing Lifecycle
Figure 3 β€” Payment Processing Lifecycle: End-to-end banking saga orchestrating microservice state transitions, MARL agent analysis, and instantaneous compliance decisioning.

Agent Decomposition

Three specialised agents each analyse fraud from a different dimension:

Agent Model Key Features Port
Transaction Pattern Agent XGBoost 57 features (after one-hot), trained on 9.5M+ transactions 1001
Customer Risk Agent XGBoost + SMOTE 19 behavioural features aggregated over 30-day sliding window 1002
Network Analysis Agent CatBoost 11 graph-topology features (PageRank, centrality, clustering) β€” deliberately volume-free 1003

Agent Decomposition
Figure 4 β€” Agent Decomposition: each agent covers a distinct fraud dimension and exposes a FastAPI endpoint.

MADDPG Orchestrator

A centralised-training, decentralised-execution (CTDE) architecture: three Actor networks (one per agent) + one shared Critic (~415 K parameters total). Training uses a three-tier reward function β€” automated heuristics, officer review, and decision overrides β€” with configurable multipliers hot-reloadable at runtime.

MADDPG Training Loop
Figure 5 β€” MADDPG Training Loop: centralised Critic trains on joint state-action pairs; Actors execute decentralised.

Reward Calculation Design
Figure 6 β€” Three-Tier Reward Calculation: automated heuristics β†’ officer review β†’ decision override.


πŸ“Š Evaluation Results

Evaluated on 10,000 synthetic payments across five money-laundering typologies:

Metric Value
System Recall 97.3 %
Smurfing 99.3 %
Fan-out 100 %
Layering 99.6 %
High-value 100 %
Round-trip 76 % (hardest typology)
Precision 11 % (by design β€” missed fraud carries regulatory risk; false alerts route to human review)
Training Convergence 18 episodes, 99.5 % critic-loss reduction
Median Latency 779 ms per decision

Detection by Typology
Figure 7 β€” Detection Recall by Typology: five laundering patterns across 10,000 payments.

Training Convergence
Figure 8 β€” Training Convergence: critic loss and reward trajectory over 18 episodes.


πŸ–₯️ Backoffice UI

The React backoffice provides compliance officers with a single pane of glass over customers, accounts, payments, MARL training, and system configuration. Every screen is backed by the backoffice-gateway aggregating data from the 10 Java microservices and the MADDPG orchestrator.

Home & Dashboard

Backoffice Home Page
Figure 9 β€” Home Page: landing view with quick navigation to all operational areas.

Backoffice Dashboard
Figure 10 β€” Dashboard: real-time KPIs across payments, alerts, and agent performance.

Customers & Accounts

Customers Page
Figure 11 β€” Customers Page: customer registry with risk profiles aggregated from the Customer Profile Service.

Accounts Page
Figure 12 β€” Accounts Page: account inventory linked to customers and payment activity.

Payments

Payments Page
Figure 13 β€” Payments Page: searchable ledger of every payment with compliance decision and agent verdicts.

Payment Detail β€” Overview
Figure 14 β€” Payment Detail (Overview): saga timeline, risk score, and MADDPG ensemble decision.

Payment Detail β€” Agent Breakdown
Figure 15 β€” Payment Detail (Agent Breakdown): per-agent scores with SHAP / Integrated Gradients attributions.

Payment Detail β€” Officer Review
Figure 16 β€” Payment Detail (Officer Review): approve / override workflow that feeds the three-tier reward function.

MARL Training & Replay Buffer

MARL Training Page
Figure 17 β€” MARL Training Page: episode control, critic loss, and reward trajectories for the MADDPG orchestrator.

Replay Buffer Page
Figure 18 β€” Replay Buffer Page: inspection of stored (state, action, reward, next-state) transitions used for training.

Configuration, Exchange Rates & Audit

Configurations Page
Figure 19 β€” Configurations Page: hot-reloadable reward multipliers, thresholds, and feature flags served by the Configuration Service.

Exchange Rate Page
Figure 20 β€” Exchange Rate Page: multi-currency rate management used during payment normalisation.

Audit Log Page
Figure 21 β€” Audit Log Page: immutable event trail aggregated from all 300K+ domain events for regulatory traceability.


πŸ”­ Observability β€” Distributed Tracing

Every request is traced end-to-end across the Java microservices and the Python AI services, over HTTP, Kafka, and Feign hops, using OpenTelemetry. Traces are viewed in Grafana Tempo and correlated with logs in Loki. A single payment becomes one trace β€” from the gateway, through the payment saga and risk engine, into the MADDPG orchestrator and the three detection agents, and back.

End-to-end distributed trace in Grafana Tempo
Figure 22 β€” End-to-end trace of a single payment (35 spans) across the gateway, payment, risk-engine, MADDPG orchestrator, and the transaction/customer/network agents.


πŸ› οΈ Tech Stack

Layer Technology
Backend Java 25, Spring Boot 4.0, Axon Framework 4.12 (saga pattern)
ML Agents Python 3.11, FastAPI, XGBoost, CatBoost
MARL PyTorch 2.5.1, MADDPG (custom implementation)
Explainability SHAP 0.51, Integrated Gradients
Messaging Apache Kafka 7.5, Confluent Schema Registry, Avro
Databases PostgreSQL 16.2, Neo4j 5.26
Frontend React 18, TypeScript, Tailwind CSS, Vite
Infrastructure Docker, Docker Compose

πŸ“‚ Repository Structure

β”œβ”€β”€ ai-services/
β”‚   β”œβ”€β”€ agents/
β”‚   β”‚   β”œβ”€β”€ transaction_pattern_agent/   # XGBoost β€” port 1001
β”‚   β”‚   β”œβ”€β”€ customer_risk_agent/         # XGBoost β€” port 1002
β”‚   β”‚   └── network_analysis_agent/      # CatBoost β€” port 1003
β”‚   └── marl_orchestrator/               # MADDPG orchestrator β€” port 1004
β”œβ”€β”€ bank-solution-backend/
β”‚   β”œβ”€β”€ account-service/
β”‚   β”œβ”€β”€ customer-service/
β”‚   β”œβ”€β”€ customer-profile-service/
β”‚   β”œβ”€β”€ configuration-service/
β”‚   β”œβ”€β”€ payment-service/
β”‚   β”œβ”€β”€ payment-engine-service/
β”‚   β”œβ”€β”€ payment-history-service/
β”‚   β”œβ”€β”€ risk-engine-service/
β”‚   β”œβ”€β”€ network-topology-service/
β”‚   └── backoffice-gateway/
β”œβ”€β”€ bank-solution-backoffice/            # React backoffice UI
β”œβ”€β”€ libraries/
β”‚   └── avro-schema-library/             # Kafka, Zookeeper, Schema Registry & Avro schemas
β”œβ”€β”€ simulation_tests/                    # 10K-payment evaluation suite
β”œβ”€β”€ data/                                # SAML-D dataset (9.5M+ rows)
└── docs/design/                         # Architecture diagrams

πŸš€ Getting Started

Prerequisites

  • Docker & Docker Compose
  • Java 25+
  • Python 3.11+
  • Node.js 18+

Step 1 β€” Start Kafka Infrastructure

Kafka, Zookeeper, Schema Registry, and Kafka UI live in the avro-schema-library stack. This must come up first because every other component depends on it.

cd libraries/avro-schema-library
./scripts/start-infrastructure.sh

Once the Schema Registry is healthy, register the Avro schemas and create the Kafka topics:

./scripts/register-schemas.sh
./scripts/create-kafka-topics.sh

Alternatively, run everything in one go:

./scripts/setup-complete.sh

Step 2 β€” Start Backend Infrastructure (PostgreSQL, Neo4j) & Microservices

cd bank-solution-backend
docker compose up -d

This brings up PostgreSQL 16.2, Neo4j 5.26, all 10 Java microservices (with Liquibase migrations), and the backoffice gateway.

Step 3 β€” Start AI Agents & MADDPG Orchestrator

cd ai-services
docker compose up -d

Starts the three ML agents (ports 1001–1003), the MADDPG orchestrator (port 1004), and its PostgreSQL database.

Step 4 β€” Start Backoffice UI (optional, for compliance officer dashboard)

cd bank-solution-backoffice
npm install && npm run dev

The React UI will be available at http://localhost:5173.

Service URLs

Service URL Port
Infrastructure
PostgreSQL localhost:5433 5433
Neo4j Browser http://localhost:7474 7474
Neo4j Bolt localhost:7687 7687
Kafka Broker localhost:9092 9092
Schema Registry http://localhost:8081 8081
Kafka UI http://localhost:8080 8080
Backend Microservices
Customer Service http://localhost:5001 5001
Account Service http://localhost:5002 5002
Payment Service http://localhost:5003 5003
Payment Engine Service http://localhost:5004 5004
Payment History Service http://localhost:5005 5005
Risk Engine Service http://localhost:5006 5006
Network Topology Service http://localhost:5007 5007
Customer Profile Service http://localhost:5008 5008
Configuration Service http://localhost:5009 5009
Backoffice Gateway http://localhost:3030 3030
AI Services
Transaction Pattern Agent http://localhost:1001 1001
Customer Risk Agent http://localhost:1002 1002
Network Analysis Agent http://localhost:1003 1003
MADDPG Orchestrator http://localhost:1004 1004
MADDPG Orchestrator DB localhost:5438 5438
Observability
Grafana (logs + traces) http://localhost:3009 3009
Tempo (traces) http://localhost:3200 3200
Loki (logs) http://localhost:3100 3100
Frontend
Backoffice UI (Docker) http://localhost:6060 6060
Backoffice UI (dev) http://localhost:5173 5173

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.


πŸ“Š Dataset

This project uses the Synthetic AML Transaction Monitoring Dataset (SAML-D) β€” a typology-based AML dataset containing 9.5 M+ transactions across five laundering patterns (smurfing, fan-out, layering, high-value, round-trip).

Credit to Berkan Γ–ztaş for making this dataset publicly available on Kaggle.

B. Γ–ztaş, D. Γ‡etinkaya, F. Adedoyin, M. Budka, H. Doğan, and G. Aksu, "Enhancing Anti-Money Laundering: Development of a Synthetic Transaction Monitoring Dataset," 2023 IEEE International Conference on e-Business Engineering (ICEBE), Sydney, Australia, 2023, pp. 47–54, doi: 10.1109/ICEBE59045.2023.00028.


πŸ™ Acknowledgements

This dissertation was completed as part of the MSc in Computer Science at the University of Liverpool. Sincere gratitude to Dr. Chunyan Mu for her guidance and support throughout this research.

Releases

Packages

Used by

Contributors

Languages