--- 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.*