A comprehensive AI-powered financial crime detection and monitoring system built with Google ADK agents, featuring synthetic transaction data generation and real-time risk assessment for Singapore banking operations.
This system is specifically designed as a prototype for Bank of Singapore, providing intelligent financial crime monitoring with:
- AI-Powered Analysis: Multi-agent system using Google ADK for sophisticated transaction analysis
- Synthetic Data Generation: Realistic SGD transaction data using Python Faker
- Real-time Monitoring: Live transaction risk assessment and flagging
- Singapore Context: All amounts in SGD, calibrated for Singapore banking market
- Modern Web Interface: React + TypeScript frontend with shadcn/ui components
βββββββββββββββββββ HTTP/REST API ββββββββββββββββββββ
β React Frontend β βββββββββββββββββββΊ β FastAPI Backend β
β (TypeScript) β β (Python) β
β β β β
β β’ Dashboard β β β’ ADK Agents β
β β’ Search/Filter β β β’ Data Generator β
β β’ Transaction β β β’ Risk Analysis β
β Details β β β’ API Endpoints β
β β’ AI Analysis β β β
βββββββββββββββββββ ββββββββββββββββββββ
- Node.js (v18+) with pnpm
- Python (v3.11+)
- uv (Python package manager)
git clone <repository-url>
cd adk-fcc# Navigate to backend directory
cd backend
# Install Python dependencies
uv pip install -r requirements.txt
# Start the FastAPI server
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reloadThe backend will be available at: http://localhost:8000
# Navigate back to project root
cd ..
# Install frontend dependencies
pnpm install
# Start the development server
pnpm devThe frontend will be available at: http://localhost:5173 (or http://localhost:5174 if 5173 is in use)
Open your browser and navigate to the frontend URL. The system will automatically connect to the backend and start displaying synthetic transaction data.
adk-fcc/
βββ backend/ # Python FastAPI backend
β βββ agents/ # Google ADK agents
β β βββ __init__.py
β β βββ financial_crime_coordinator.py
β β βββ prompts.py
β β βββ sub_agents/ # Specialized sub-agents
β β βββ compliance_checker.py
β β βββ pattern_detector.py
β β βββ risk_assessor.py
β β βββ transaction_analyzer.py
β βββ data_generator.py # Synthetic data generation
β βββ main.py # FastAPI application
β βββ requirements.txt # Python dependencies
β βββ start.sh # Startup script
βββ src/ # React frontend
β βββ components/ # React components
β β βββ ui/ # shadcn/ui components
β β βββ Dashboard.tsx # Main dashboard
β β βββ TransactionTable.tsx
β β βββ TransactionDetails.tsx
β β βββ AIAnalysis.tsx
β β βββ SearchBar.tsx
β βββ services/
β β βββ api.ts # API service layer
β βββ types/
β β βββ transaction.ts # TypeScript interfaces
β βββ hooks/ # Custom React hooks
βββ package.json # Frontend dependencies
βββ README.md # This file
-
π€ Multi-Agent AI System: Coordinated agents for comprehensive analysis
- Transaction Analyzer
- Risk Assessor
- Compliance Checker
- Pattern Detector
-
π² Synthetic Data Generation: Realistic SGD transactions with:
- Risk-based distribution (30% high-risk, 70% normal)
- Geographic diversity (32+ countries)
- Realistic amount ranges for Singapore market
- Customer profiles and merchant information
-
π Risk Analysis: AI-generated analysis including:
- Multi-factor risk scoring
- Detailed risk factors and reasoning
- Compliance screening results
- Pattern detection indicators
- π Interactive Dashboard: Real-time transaction monitoring
- π Advanced Search & Filtering: Filter by risk level, status, transaction ID
- π Transaction Details: Comprehensive transaction information
- π§ AI Analysis Viewer: Detailed risk assessment results
- β‘ Real-time Updates: Live data refresh and status updates
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/api/transactions/flagged |
GET | Get synthetic transactions |
/api/transactions/{id} |
GET | Get specific transaction |
/api/analysis/{id} |
GET | Get AI analysis for transaction |
/api/transactions/{id}/status |
PATCH | Update transaction status |
/api/agents/status |
GET | Get agent status |
# Get 10 synthetic transactions
curl "http://localhost:8000/api/transactions/flagged?count=10"
# Get high-risk transactions only
curl "http://localhost:8000/api/transactions/flagged?risk_indicator=High"
# Get AI analysis for a transaction
curl "http://localhost:8000/api/analysis/TXN-12345678"
# Update transaction status
curl -X PATCH "http://localhost:8000/api/transactions/TXN-12345678/status" \
-H "Content-Type: application/json" \
-d '{"status": "reviewed"}'The system generates realistic SGD amounts appropriate for Singapore banking:
| Transaction Type | Normal Range | High-Risk Range |
|---|---|---|
| Transfers | SGD 500 - 50,000 | SGD 50,000 - 2,000,000 |
| Deposits | SGD 200 - 25,000 | SGD 25,000 - 800,000 |
| Withdrawals | SGD 100 - 15,000 | SGD 15,000 - 200,000 |
| Payments | SGD 50 - 5,000 | SGD 5,000 - 150,000 |
cd backend
# Run data generator test
uv run python data_generator.py
# Start with auto-reload for development
uv run uvicorn main:app --reload --host 0.0.0.0 --port 8000# Start with hot reload
pnpm dev
# Type checking
pnpm type-check
# Linting
pnpm lint
# Build for production
pnpm buildCreate a .env file in the backend/ directory based on .env.example:
cp backend/.env.example backend/.envcd backend
# Test data generation
uv run python data_generator.py
# Test API endpoints
curl http://localhost:8000/health
curl "http://localhost:8000/api/transactions/flagged?count=5"# Install dependencies and start
pnpm install
pnpm dev
# Open browser to http://localhost:5173cd backend
# Install production dependencies
uv pip install -r requirements.txt
# Start production server
uv run uvicorn main:app --host 0.0.0.0 --port 8000# Build for production
pnpm build
# Preview production build
pnpm preview
# Deploy dist/ folder to your hosting service- Port: Default 8000 (configurable in
main.py) - CORS: Configured for localhost:5173, localhost:3000
- Data Generation: Configurable transaction counts and risk percentages
- API Base URL:
http://localhost:8000/api(configurable insrc/services/api.ts) - Timeout: 15 seconds for API calls
- Fallback Data: Available when backend is unreachable
- Synthetic Data Implementation: Detailed guide on data generation
- Backend API Documentation: Available at
http://localhost:8000/docswhen running - Component Documentation: See individual component files in
src/components/
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Create a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
This prototype is specifically designed for Bank of Singapore with:
- SGD Currency: All transactions in Singapore Dollar
- Local Market Calibration: Amount ranges appropriate for Singapore banking
- Regulatory Alignment: Risk factors aligned with MAS (Monetary Authority of Singapore) guidelines
- Regional Risk Assessment: Geographic risk categories relevant to Singapore's position
Built with β€οΈ for Bank of Singapore
For support or questions, please contact the development team.