Inspiration:

Financial fraud costs billions annually and affects millions worldwide. I wanted to create a real-time fraud detection system that not only identifies fraudulent transactions but also explains why they are suspicious. My goal was to build a production-ready, explainable AI system that enables financial institutions to protect customers while maintaining transparency.

What it does:

FRED is a real-time fraud detection web app that processes financial transactions using a Logistic Regression model built with scikit-learn. It evaluates 18 engineered features — including transaction velocity, amount deviation, merchant behavior, and spending anomalies — to assign a fraud risk level (low, medium, high, critical). Transactions and risk metadata are stored in PostgreSQL for analytics. The dashboard displays real-time alerts, trend charts, and AI-generated fraud explanations using local LLM summarization (Gemma 3 + Ollama + LangChain). Users can toggle between demo placeholders and real-time LLM reasoning.

How it’s built:

I used FastAPI for the backend, Next.js + Tailwind CSS for the frontend, PostgreSQL for persistent storage, and Redis for real-time communication. The LLM explainability module uses LangChain connected to Ollama, running Gemma 3 locally for privacy and low latency. PostgreSQL and pgAdmin were containerized with Docker Compose, and a Go-based transaction generator simulates realistic fraud data.

Challenges & learnings:

I learned to design efficient ML schemas, integrate async communication, and manage concurrent local LLM summarization tasks. Debugging database consistency, port conflicts, and Pydantic warnings improved my full-stack problem-solving skills.

Next steps:

Future plans include adding user authentication, automated retraining pipelines, analyst case management, multi-currency support, and WebSocket-based live updates. I aim to deploy FRED on Kubernetes with Prometheus + Grafana for monitoring and enterprise scalability.

Built With

Share this project:

Updates