An end-to-end AI fraud detection platform combining machine learning, explainable AI, LLM-powered investigation, and a real-time monitoring dashboard.
This project demonstrates how modern financial institutions detect and investigate suspicious transactions using multi-agent AI systems.
- Machine Learning Fraud Detection Model (XGBoost)
- Explainable AI using SHAP
- LLM-powered Investigation Agent
- Multi-Agent Architecture
- FastAPI Fraud Detection API
- Real-time Monitoring Dashboard (Streamlit)
The system automatically:
- Detects suspicious transactions
- Explains why they are suspicious
- Generates investigation summaries
- Displays alerts in a monitoring dashboard
Transaction
│
▼
Detection Agent (XGBoost ML Model)
│
▼
Explainability Engine (SHAP)
│
▼
Investigation Agent (LLM)
│
▼
Decision Agent (Fraud Policy Engine)
│
▼
Fraud Monitoring Dashboard
| Layer | Technology |
|---|---|
| ML Model | XGBoost |
| Explainability | SHAP |
| API | FastAPI |
| Dashboard | Streamlit |
| LLM Agent | OpenAI |
| Data Processing | Pandas / NumPy |
| Deployment | Uvicorn |
This project implements 3 cooperating AI agents.
- Predicts fraud probability using XGBoost
- Uses behavioral features such as velocity and spending patterns
- Uses LLM reasoning to explain suspicious transactions
- Converts SHAP signals into analyst-friendly explanations
Example:
Transaction flagged because the transaction amount is significantly higher than the user's typical spending behavior and multiple transactions occurred within a short time window.
Applies fraud policy rules:
score > 0.7 → BLOCK
0.4–0.7 → INVESTIGATE
< 0.4 → APPROVE
The Streamlit dashboard allows fraud analysts to:
- Input transaction details
- View fraud risk scores
- See automated investigation summaries
- Visualize risk features
Example output:
Fraud Probability: 0.82
Decision: BLOCK
Reason: Unusual transaction amount and abnormal transaction velocity
The model uses behavioral features such as:
TransactionAmt
txn_count_1h
txn_count_24h
txn_count_7d
avg_amt_1h
avg_amt_24h
avg_amt_7d
max_amt_24h
amount_zscore_24h
velocity_risk
is_night_txn
These capture transaction velocity, spending deviation, and behavioral anomalies .
POST /predict_fraud
Request:
{
"TransactionAmt": 500,
"txn_count_1h": 5,
"txn_count_24h": 20,
"txn_count_7d": 40,
"avg_amt_1h": 30,
"avg_amt_24h": 35,
"avg_amt_7d": 28,
"max_amt_24h": 70,
"amount_zscore_24h": 4.5,
"velocity_risk": 0.85,
"is_night_txn": 1
}
Response:
{
"fraud_probability": 0.83,
"decision": "BLOCK",
"investigation_summary": "The transaction amount is significantly higher than the user's normal spending pattern and multiple transactions occurred within a short time window."
}
pip install -r requirements.txt
uvicorn api.app:app --reload
streamlit run dashboard/dashboard.py
Open:
http://localhost:8501
- Real-time streaming fraud detection
- Fraud graph network analysis
- Reinforcement learning fraud policies
- Automated case management system
Kirti Sinha
Data AI Professional
Passionate about building AI systems that solve real business problems in finance and banking.




