UmairLari/ai-financial-advisor-backend
<div align="center">
<img src="https://img.shields.io/badge/Status-Live-brightgreen?style=for-the-badge" /> <img src="https://img.shields.io/badge/Frontend-Vercel-black?style=for-the-badge&logo=vercel" /> <img src="https://img.shields.io/badge/Backend-HuggingFace-yellow?style=for-the-badge&logo=huggingface" /> <img src="https://img.shields.io/badge/AI-Groq%20LLaMA--3-blueviolet?style=for-the-badge" /> <img src="https://img.shields.io/badge/DB-MongoDB%20Atlas-green?style=for-the-badge&logo=mongodb" />
FinPass AI
Your Personal AI Financial Advisor โ Built for India's Future Investors
[๐ Try Live App](https://ai-driven-invest-planner.vercel.app) ยท [๐ Full Docs](./docs/PRODUCT_DOCS.md) ยท [๐ผ Screenshots](./docs/SCREENSHOTS.md)
</div>
โ The Problem
Most Indians earn enough to build real wealth โ but never do.
Not because they don't try. But because the system is broken:
- ๐ธ No one explains where their money actually goes โ expenses, debt, and lifestyle creep silently consume every rupee of surplus
- ๐ Generic advice doesn't work โ "invest in SIPs" means nothing without knowing how much, in what, and for how long, tailored to your income
- ๐งฎ Planning tools are either too complex or too shallow โ spreadsheets intimidate beginners; generic apps give useless blanket advice
- ๐ฎ People invest blind โ no way to simulate outcomes, stress-test goals, or see if they're on track
- ๐ค AI tools exist โ but not for personal finance in India โ no product combines real financial math with conversational AI in a single accessible platform
The result? Millions of earning Indians leave their money idle in savings accounts, missing a decade of compounding returns.
โ The Solution โ FinPass AI
FinPass AI is a full-stack, AI-powered financial advisor built for Indian investors. It combines rigorous financial mathematics with Groq-powered LLaMA-3 AI to give you:
A personalized investment plan, goal probability forecast, and a conversational AI advisor โ all in one intelligent dashboard.
You input your financials once. FinPass AI tells you exactly:
- Where your money is going (visual cash flow breakdown)
- Whether you'll hit your goal (Monte Carlo probability with 1,000 simulations)
- How to allocate your investments (risk-adjusted asset allocation)
- What to do next (AI-generated, context-aware action plan)
No spreadsheets. No jargon. No guessing.
๐ฏ Who Is It For?
โก Key Features
๐ง AI Financial Intelligence
- Groq LLaMA-3 Analysis โ Sends your full financial profile to LLaMA-3.1-8b-instant and returns a personalized health score (0โ100), honest assessment, and 3 actionable recommendations
- Conversational AI Advisor โ Chat with an AI that knows your portfolio โ ask anything about your finances in plain English
- Graceful Fallback โ If AI is unavailable, a deterministic rule engine computes the same fields instantly
๐ Goal Intelligence Engine
- SIP Future Value Formula โ Calculates your projected corpus at goal maturity:
FV = P ร [(1 + r)^n โ 1] / r Where P = monthly surplus, r = monthly return rate, n = timeline in months
- Monte Carlo Simulation โ Runs 1,000 simulations with Gaussian noise to compute statistical goal probability
- Gap Analysis โ Shows exactly how far you are from your target and what it takes to close the gap
- Plain-English Verdicts โ "On Track ยท Slightly Behind ยท Needs Immediate Attention"
๐น Cash Flow Analysis
- Full visual breakdown of income โ Expenses ยท Debt ยท Investments ยท Surplus
- Live progress bars with โน values for every allocation category
- Key financial ratios: Savings Rate ยท Debt-to-Income ยท Expense Ratio
๐ Smart Asset Allocation (Risk-Based)
๐ฅ Personalized Dashboard
- Real-time stat cards: Monthly Income ยท Total Portfolio ยท Goal Target ยท Monthly Debt
- Interactive Chart.js donut for cash flow visualization
- Live goal probability progress bar (pulled from
/api/goal-intelligence) - AI Advisor chat panel embedded directly in the dashboard
- Dark / Light mode with glassmorphism UI
๐งโโ๏ธ Guided Onboarding Wizard
- 3-step guided setup: Financial Goal โ Monthly Financials โ Investment Preferences
- Session-saved โ resume exactly where you left off
- Completed in under 5 minutes
๐ How It Works
User Registers โ Onboarding Wizard (3 steps) โ Dashboard
โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
โผ โผ
Goal Intelligence Engine AI Advisor Chat
(SIP FV Math + Monte Carlo) (Groq LLaMA-3 Analysis)
โ โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โผ
Personalized Dashboard
(Stat Cards ยท Cash Flow ยท Goal Bar ยท Insights)Investment Route Logic
The system determines your investment recommendation by combining:
- Risk appetite (Low / Moderate / High) set during onboarding wizard
- Investable surplus = Monthly Income โ Expenses โ Debt EMI
- Goal timeline โ shorter timelines shift allocation toward safer debt instruments
- AI verdict (HOLD / BUY / REBALANCE) โ computed by the financial agent
๐ Tech Stack
๐ Live Deployment
๐ Project Structure
AI-Financial Advisor/
โโโ backend/
โ โโโ main.py โ Flask app + 21 API endpoints
โ โโโ groq_service.py โ Groq AI client + financial insights
โ โโโ ai/ โ LLaMA-3 client, prompts, response formatter
โ โโโ ml/ โ SIP math (goal_intelligence.py), Monte Carlo (goal_predictor.py)
โ โโโ analytics/ โ compute_financial_health()
โ โโโ core/ โ Rule engine, FinancialState, MarketState
โ โโโ agent/ โ AI decision agent, what-if analysis
โ โโโ routes/ โ /api/advisor/chat, /api/intelligence/insights
โ
โโโ frontend/
โ โโโ css/style.css โ Master stylesheet (dark/light CSS variables, 1300+ lines)
โ โโโ js/ โ dashboard.js ยท wizard.js ยท api.js ยท theme.js ยท login.js
โ โโโ static/ โ index.html ยท login.html ยท register.html ยท dashboard.html
โ
โโโ docs/
โโโ PRODUCT_DOCS.md โ Full product documentation
โโโ SCREENSHOTS.md โ Visual app walkthrough๐ Documentation
โ๏ธ Running Locally
Backend
cd backend
pip install -r requirements.txt
# Create .env with: MONGO_URI, GROQ_API_KEY, DB_NAME, COLLECTION_NAME, PORT
python main.py
# Runs on http://localhost:5000Frontend
npx serve frontend
# config.js automatically switches BACKEND_URL between localhost:5000 and prod๐ Environment Variables
MONGO_URI=mongodb+srv://... # MongoDB Atlas connection string
DB_NAME=mockDB # Database name
COLLECTION_NAME=userGoals # Collection name
GROQ_API_KEY=gsk_... # Groq API key (LLaMA-3 access)
PORT=5000 # Server portโ ๏ธ Disclaimer
FinPass AI is an educational and informational tool only. It does not execute trades, manage funds, or provide legally binding financial advice. All projections are illustrative. Please consult a SEBI-registered investment advisor before making significant financial decisions.
<div align="center">
Made with โค๏ธ by Umair Lari | ยฉ 2026 FinPass AI ยท All Rights Reserved
</div>
