Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
5.49.0
metadata
title: Enhanced Fraud Detector Agent
emoji: π
colorFrom: red
colorTo: red
sdk: gradio
sdk_version: 5.42.0
app_file: app.py
pinned: false
license: apache-2.0
python_version: 3.12
suggested_hardware: cpu-upgrade
tags:
- fraud-detection
- langchain
- machine-learning
- finance
- security
short_description: AI-powered fraud detection with multi-model & RAG.
π Enhanced Fraud Detection Agent
A production-ready fraud detection system built with LangChain, Hugging Face models, and advanced ML techniques.
Features
- Multi-Model Analysis: Uses Ministral-8B for analysis and Qwen2.5-Coder for coding tasks
- Velocity Detection: Identifies suspicious transaction patterns in time windows
- Amount Anomaly Detection: Statistical analysis for unusual transaction amounts
- RAG System: Historical pattern matching using vector embeddings
- User Authentication: Secure login system with per-user data isolation
- Report Generation: Professional PDF and CSV reports
- Email Alerts: Automated notifications for suspicious activities
Quick Start
- Upload Transaction Data: CSV file with columns:
timestamp
,amount
,description
,merchant
(optional) - Login/Register: Create an account or login to access the system
- Analyze: Upload your CSV and optionally provide a RAG query
- Review Results: Get detailed analysis, flagged transactions, and downloadable reports
Sample CSV Format
timestamp,amount,description,merchant,category
2024-01-15 10:30:00,25.99,Coffee Shop Purchase,Starbucks,Food
2024-01-15 10:31:00,1500.00,Gift Card Purchase,Amazon,Shopping
2024-01-15 10:32:00,2000.00,Wire Transfer,Bank,Transfer
Configuration
The system uses the following models:
- Analysis Model:
mistralai/Ministral-8B-Instruct-2410
- Code Model:
Qwen/Qwen2.5-Coder-32B-Instruct
- Embeddings:
sentence-transformers/all-MiniLM-L6-v2
Security Features
- Password hashing with SHA-256
- Per-user data isolation
- Session management
- SQL injection protection through parameterized queries
Technical Stack
- LangChain: Agent orchestration and tool management
- Hugging Face: Model inference and embeddings
- FAISS: Vector storage for RAG
- Gradio: Web interface
- SQLite: User and transaction data storage
- ReportLab: PDF report generation
License
Apache 2.0