Gowthamsai/Financial-risk-engine
0
Financial Risk Engine using ML and RAG
An AI-powered financial monitoring platform designed to parse bank statement PDFs, categorize transactions using ML, detect recurring payments, and provide personalized risk assessments with a real-time RAG (Retrieval-Augmented Generation) chatbot.
<img width="1918" height="906" alt="image" src="https://github.com/user-attachments/assets/51fb8e25-6f0a-4a03-a94d-590d48612db7" />
๐ Key Features
๐ฆ Intelligent PDF Parsing
- Transaction Normalization: Automatically handles
(Dr)and(Cr)suffixes and normalized date formats. - Batch Processing: Upload multiple years of PDFs to build a deep financial profile.
๐ง ML-Driven Analytics
- Smart Categorization: Uses a Hybrid Keyword + ML (Naive Bayes) model to categorize UPI, ATM, and Merchant transactions.
- Recurring Payment Detection: Identifies subscriptions (Netflix, Spotify), Autopays, and regular bills.
- Debt Trap Analysis: Flags high EMI-to-income ratios and multiple BNPL payments.
- FY Prediction: Forecasts next fiscal year spending trends based on historic data.
๐ฌ Risk Assistant (RAG Chatbot)
- Data-Grounded AI: A Chatbot powered by Google Gemini that answers questions specifically about your transactions and risk profile.
- Privacy First: Data is retrieved dynamically from your secure Supabase storage and injected into the LLM context only for your session.
๐ง Automated Risk Reports
- Instant Insights: Recieve a sleek HTML report via email immediately after PDF analysis is complete.
- Performance: Summarizes top spending categories and top-level risk metrics.
๐ ๏ธ Security & Tech Stack
- Frontend: React, Vite, Tailwind CSS, Shadcn UI, Recharts, Framer Motion.
- Backend: Flask (Python 3.10+), Pandas, Scikit-learn, PDFPlumber.
- Database: Supabase (PostgreSQL with RLS), Auth, and Storage.
- Security: MFA Authentication, 2-minute inactivity auto-logout, JWT session protection.
โ๏ธ Installation & Setup
- Clone the repository
git clone https://github.com/your-username/risk-dashboard-ui.git
cd risk-dashboard-ui- Frontend Setup
npm install- Backend Setup
cd backend
python -m venv venv
source venv/bin/activate # Or venv\Scripts\activate on Windows
pip install -r requirements.txt- Environment Variables Create a
.envfile in the root directory (use.env.exampleas a template):
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_anon_key
GEMINI_API_KEY=your_google_ai_key
SMTP_USER=your_email@gmail.com
SMTP_PASS=your_app_password- Run the Application
- Frontend:
npm run dev - Backend:
cd backend && python app.py
๐ก๏ธ License
Distributed under the MIT License. See LICENSE for more information.
Built for advanced financial risk monitoring.
