AI-driven fraud detection and risk intelligence platform
AEGIS combines real-time transaction analysis, risk scoring, and graph-based anomaly detection with a modern analyst dashboard. It is designed to surface high-risk activity early, explain why it is risky, and streamline investigation workflows.
- Overview
- Highlights
- Visual overview
- Architecture
- Repo structure
- Getting started
- Configuration
- API surface
- Testing and quality
- Docker and deployment
- Contributing, security, and license
AEGIS is a full-stack fraud detection platform with a FastAPI backend and a React-based analyst experience. It blends ML scoring, graph intelligence, and alert workflows to provide a clear, explainable picture of risk across accounts and transactions.
- Real-time fraud analysis with ML-powered confidence scoring
- Risk profiling and automated status classification
- Graph intelligence for ring detection and network anomalies
- Alerting and case workflows for investigations
- Metrics dashboard for fraud KPIs and system health
flowchart LR
Analyst[Analyst Dashboard] -->|HTTPS| Nginx
Nginx --> Frontend[React/Vite SPA]
Frontend -->|/api/v1| API[FastAPI API]
API --> DB[(Postgres)]
API --> ML[ML Models: Fraud Detector, Risk Scorer, Graph GNN]
API --> Logs[(Logs)]
api/: FastAPI API, ML models, database layer, and tests — see api/README.md.frontend/: React/Vite frontend for dashboards and monitoring — see frontend/README.md.
- Python 3.11
- Node.js 20
- Docker (optional)
cd apicp .env.example .envpython -m venv .venv && source .venv/bin/activatepip install -r requirements-dev.txtuvicorn app.main:app --reload
cd frontendnpm installnpm run dev
docker compose up --build- Frontend:
http://localhost:3000 - API:
http://localhost:8000
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build- Frontend (Vite dev):
http://localhost:3000 - API (reload):
http://localhost:8000
- API settings live in
api/.env(seeapi/.env.example). - Key variables:
DATABASE_URL,SECRET_KEY,API_KEY,MODEL_PATH,FRAUD_DETECTION_THRESHOLD. - Frontend can override the API base URL with
VITE_API_URL(defaults to/api/v1). - For local dev, set
VITE_API_KEYto matchAPI_KEY.
GET /healthGET /api/v1/dashboard/metricsGET /api/v1/fraud/alertsPOST /api/v1/fraud/analyzeGET /api/v1/accounts/monitoredGET /api/v1/compliance/frameworks
- Backend:
pytest(runs against a throwaway SQLite database),ruff check .,ruff format --check .— all fromapi/. - Frontend:
npm run lint,npm test(Vitest),npm run build— all fromfrontend/. - CI (
.github/workflows/ci.yml) runs the same checks on every push and pull request; Docker images are published only after CI passes onmain.
- Dev uses
docker-compose.dev.ymloverrides (bind mounts, hot reload, Vite dev server). - Prod uses
docker-compose.ymlordocker-compose.prod.yml(immutable images + Nginx). - Config moves via env vars and CI/CD (local
.envfiles for dev, real secrets in prod).
- Build and tag images:
docker build -t <dockerhub_user>/aegis-api:1.0.0 -f api/Dockerfile .
docker build -t <dockerhub_user>/aegis-frontend:1.0.0 -f frontend/Dockerfile frontend
- Push images:
docker push <dockerhub_user>/aegis-api:1.0.0
docker push <dockerhub_user>/aegis-frontend:1.0.0
- In prod, run with Docker Hub images:
DOCKERHUB_USERNAME=<dockerhub_user> IMAGE_TAG=1.0.0 \
docker compose -f docker-compose.prod.yml up -d
This repo includes .github/workflows/dockerhub.yml to build and push images on main.
Required secrets:
DOCKERHUB_USERNAMEDOCKERHUB_TOKEN(a Docker Hub access token)
- Model training pipeline with real datasets, scheduled evaluations, and drift alerts (the bundled fraud detector currently falls back to an untrained placeholder model when no artifact exists in
MODEL_PATH) - Rate limiting and per-client API key management
- Redis-backed caching (currently in-memory per process)
- Streaming ingest (Kafka/PubSub) for near-real-time decisioning
- Pluggable rules engine for policy-based overrides
- Analyst case timeline with evidence attachments and notes
- Contributions are welcome — see CONTRIBUTING.md for setup, conventions, and the PR checklist.
- To report a vulnerability, see SECURITY.md. Please do not open public issues for security reports.
- Licensed under the MIT License.