File size: 3,276 Bytes
75797ff
 
 
 
 
 
 
 
 
 
7d391cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
title: AML Shield
emoji: ๐Ÿ›ก๏ธ
colorFrom: blue
colorTo: red
sdk: streamlit
sdk_version: "1.32.0"
app_file: app.py
pinned: false
---
# AML Shield ๐Ÿ›ก๏ธ

**AI-Powered Anti-Money Laundering Transaction Intelligence Platform**

A production-grade, full-stack web application for financial transaction intelligence. AML Shield allows users to upload transaction records and receive real-time anomaly detection, interactive visualizations, KYC risk profiling, and AI-generated compliance reports via LangChain + Bytez utilizing LLaMa 3.1. 

All analyses are natively persisted to a Supabase PostgreSQL backend, displaying dynamic real-time insights globally.

---

## ๐Ÿš€ Live Demo
Access the live application hosted on Hugging Face Spaces:  
๐Ÿ‘‰ **[AML Shield Live Space](https://huggingface.co/spaces/AJAYKASU/AML_Shield)**

## โš™๏ธ Core Architecture & Features

This platform employs a Two-Layer Detection System utilizing rule-based flagging and Machine Learning models to score unverified transactions.

1. **Upload & ETL Engine**: Rigorous CSV validation routines parse structure variables and engineer critical analytical features natively.
2. **Two-Layer Threat Detection**: Applies known heuristics (Structuring, Dormant Account Spikes, etc.) and scikit-learn `IsolationForest` anomaly algorithms. 
3. **Advanced Risk Profiling**: Consolidates activity for all accounts tracking behavioral metadata to derive accurate KYC tiering (`KMeans`).
4. **LangChain AI Compliance Integration**: Streams professional regulatory reports via `langchain_bytez` mapping direct analysis metrics to executive summaries in real-time. 
5. **Report Generation Pipeline**: Leverages `ReportLab` building formal, fully-styled PDF analytics documents dynamically available for analyst download. 
6. **Persistence & Data Aggregation**: Syncs outputs to `Supabase` capturing global macro-risk signals to identify organizational trend metrics.

## ๐Ÿ›  Tech Stack
- Frontend Dashboard: **Streamlit**
- Data Modules: **Pandas, NumPy**
- Machine Learning models: **Scikit-learn**
- Analytical Storytelling: **Plotly**
- AI LLM Generation: **LangChain, Bytez (`meta-llama/Llama-3.1-8B-Instruct`)**
- Persisted Memory Layers: **Supabase DB (`supabase-py`)**
- Artifact Generation: **ReportLab PDF renderer**

## ๐Ÿ”ง Installation & Local Setup

**1. Clone the repository:**
```bash
git clone https://github.com/AJAYKASU/aml-shield.git
cd aml-shield
```

**2. Setup Virtual Environment & Dependencies:**
```bash
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```

**3. Configure Environment Variables:**
You will need API keys for Bytez and your Supabase PostgreSQL cluster. Add the following inside a `.env` file at the root:
```env
BYTEZ_API_KEY=your_key_here
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_anon_key
```

**4. Run Project:**
```bash
streamlit run app.py
```

## ๐Ÿ” Compliance Methodologies

The rules modeled directly reference core regulatory operations monitored by US analysts covering entities under the **BSA (Bank Secrecy Act)**, **FinCEN SAR requirements**, and the **FATF Recommendation 16** for wire transfer rules.

*Built to demonstrate robust AML compliance analytics skills for data-driven financial services roles.*