Skip to content

Devguru-codes/AI-Money-Mentor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

63 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฐ AI Money Mentor

India's First Multi-Agent Personal Finance Platform
9 specialized AI agents orchestrated by OpenClaw for tax planning, FIRE retirement, stock analysis, and couple's financial management.

Next.js FastAPI Prisma Python OpenClaw Agents


๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        Next.js Frontend                         โ”‚
โ”‚            Landing โ€ข 9 Agent Pages โ€ข Auth โ€ข Profile             โ”‚
โ”‚                          (Port 3000)                            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚  BFF Proxy (/api/*)
                        โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   FastAPI Backend (Port 8000)                   โ”‚
โ”‚                                                                 โ”‚
โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”‚
โ”‚     โ”‚           DhanSarthi (Coordinator)              โ”‚         โ”‚
โ”‚     โ”‚     "The Brain" - routes every user query       โ”‚         โ”‚
โ”‚     โ”‚         to the right specialist agent           โ”‚         โ”‚
โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”‚
โ”‚            โ”‚      โ”‚      โ”‚      โ”‚      โ”‚      โ”‚                 โ”‚
โ”‚       โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”โ”Œโ”€โ”€โ–ผโ”€โ”€โ”€โ”โ”Œโ”€โ–ผโ”€โ”€โ”€โ”€โ”โ”Œโ–ผโ”€โ”€โ”€โ”€โ”€โ”โ”Œโ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”‚
โ”‚       โ”‚KarVidโ”‚โ”‚Yojanaโ”‚โ”‚Bazaarโ”‚โ”‚ Dhan โ”‚โ”‚Niveshโ”‚โ”‚ Vidhi โ”‚         โ”‚
โ”‚       โ”‚ Tax  โ”‚โ”‚ FIRE โ”‚โ”‚Stock โ”‚โ”‚Healthโ”‚โ”‚  MF  โ”‚โ”‚ Legal โ”‚         โ”‚
โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”‚
โ”‚                                                                 โ”‚
โ”‚       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚       โ”‚   Life Event     โ”‚      โ”‚  Couple Planner  โ”‚            โ”‚
โ”‚       โ”‚ Marriage, Baby   โ”‚      โ”‚  Joint Finance   โ”‚            โ”‚
โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ”‚                                                                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ”‚  OpenClaw Gateway   โ”‚
             โ”‚   (Agent Swarm)     โ”‚
             โ”‚                     โ”‚
             โ”‚   Ollama / GLM-5    โ”‚
             โ”‚   (LLM Inference)   โ”‚
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

How it works: User sends a query โ†’ DhanSarthi analyzes intent โ†’ delegates to the right specialist agent (e.g., tax question โ†’ KarVid, retirement โ†’ Yojana) โ†’ returns the combined response. All delegation is handled via the OpenClaw multi-agent swarm protocol.


๐Ÿค– The 9 Agents

# Agent Role Key Features
1 KarVid ๐Ÿงพ Tax Wizard Old vs New regime comparison, 80C/80D deductions, capital gains, Indian Tax Laws DB
2 YojanaKarta ๐ŸŽฏ FIRE Planner FIRE number calculation, SIP recommendations, retirement planning
3 BazaarGuru ๐Ÿ“ˆ Market Analyst NSE/BSE stock quotes, top gainers, NIFTY 50 data
4 DhanRaksha ๐Ÿ’ช Health Scorer 8-factor financial health score with personalized suggestions
5 Niveshak ๐Ÿ“Š Portfolio Advisor Dynamic XIRR iteration arrays, Sharpe Ratio, Risk matrices
6 Vidhi โš–๏ธ Compliance Officer SEBI regulations, legal disclaimers, financial law lookup
7 DhanSarthi ๐Ÿง  Coordinator Routes queries to the right agent via OpenClaw multi-agent swarm
8 Life Event Advisor ๐ŸŽ‰ Life Planner Marriage, child birth, education โ€” goal-based SIP planning
9 Couple's Planner ๐Ÿ’‘ Joint Finance Combined budgets, expense splitting, joint debt payoff strategies

๐Ÿ› ๏ธ Tech Stack

Layer Technology Purpose
Frontend Next.js 16, React 19, TypeScript App Router, SSR/SSG
State Zustand + useLocalStorage Persistent Form Caching
Styling Tailwind CSS v4, shadcn/ui Responsive UI components
Backend FastAPI, Python 3.12 REST API with 20+ endpoints
Database Prisma 5, SQLite User profiles, portfolios, chat history
AI Orchestration OpenClaw 2026.3 Multi-agent swarm coordination
LLM Backend Ollama (local), GLM-5 Cloud AI inference for agent responses
Bots python-telegram-bot Telegram integration
Testing Jest, E2E Python tests 26 deep + 25 routing = 51/51 tests passing

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Python 3.11+ (3.12 recommended)

1. Clone

git clone https://github.com/Devguru-codes/AI-Money-Mentor.git
cd AI-Money-Mentor

2. Backend Setup

cd backend
python -m venv venv

# Linux/Mac
source venv/bin/activate

# Windows
.\venv\Scripts\activate

pip install -r requirements.txt
uvicorn api_server:app --host 0.0.0.0 --port 8000

3. Frontend Setup

cd frontend
npm install
npx prisma generate
npx prisma db push
npm run dev

4. Open in Browser

Online Deployment:

Local Deployment:


๐Ÿ”— API Endpoints

Frontend BFF Proxy Routes

Route Method Backend Target
/api/karvid POST /karvid/calculate-tax
/api/yojana POST /yojana/fire-number
/api/bazaar POST /bazaar/stock-quote
/api/dhan POST /dhan/health-score
/api/niveshak POST /niveshak/analyze
/api/vidhi GET /vidhi/disclaimers
/api/dhan-sarthi POST /dhan-sarthi/route
/api/life-event POST/GET /life-event/plan, /life-event/types
/api/couple-planner POST /couple/finances, /couple/budget, /couple/debt-payoff

Backend Direct Endpoints (20+)

Click to expand full endpoint list
Endpoint Method Description
/ GET Service info + all 9 agents
/health GET Health check
KarVid
/karvid/calculate-tax POST Calculate tax (old/new regime)
/karvid/compare-regimes POST Compare old vs new regime
/karvid/80c POST Calculate 80C deductions
/karvid/capital-gains POST STCG/LTCG tax
/karvid/section/{section} GET Tax law lookup
YojanaKarta
/yojana/fire-number POST Calculate FIRE number
/yojana/sip-recommendation POST SIP recommendation
/yojana/retirement-plan POST Full retirement plan
BazaarGuru
/bazaar/stock-quote POST Stock quote from NSE
/bazaar/top-gainers GET Top gaining stocks
/bazaar/nifty50 GET NIFTY 50 list
DhanRaksha
/dhan/health-score POST 8-factor health score
Niveshak
/niveshak/analyze POST Portfolio analysis
/niveshak/risk-metrics POST Risk metrics
Vidhi
/vidhi/disclaimers GET SEBI disclaimers
/vidhi/regulations GET SEBI regulations
Life Event
/life-event/types GET Supported event types
/life-event/plan POST Event financial plan
/life-event/comprehensive POST Full event analysis
Couple Planner
/couple/finances POST Combined finances
/couple/plan POST Joint financial plan
/couple/budget POST 50/30/20 budget
/couple/split-expense POST Expense splitting
/couple/debt-payoff POST Joint debt strategy

โš™๏ธ Environment Variables

Create .env in the project root:

# Database
DATABASE_URL="file:./frontend/prisma/dev.db"

# Backend URL (for frontend BFF proxy)
BACKEND_URL=http://localhost:8000

# OpenClaw Agent Swarm (configured via openclaw CLI on the server)
# Uses Ollama for local inference or GLM-5 Cloud for hosted AI
# No API key needed in .env โ€” managed by OpenClaw gateway

# Telegram Bots (optional, get from @BotFather)
DHANSARTHI_BOT_TOKEN=your_token
KARVID_BOT_TOKEN=your_token

๐Ÿงช Testing

# Deep Agent Tests โ€” 26/26
cd backend
python3 tests/deep_agent_test.py

# Greeting & Routing Tests โ€” 25/25
python3 tests/greeting_test.py

# Build Verification
cd frontend
npx next build

๐Ÿ“ Project Structure

AI-Money-Mentor/
โ”œโ”€โ”€ frontend/                    # Next.js 16 + React 19
โ”‚   โ”œโ”€โ”€ src/app/
โ”‚   โ”‚   โ”œโ”€โ”€ agents/              # 9 agent UI pages
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ karvid/          # Tax Wizard
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ yojana/          # FIRE Planner
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ bazaar/          # Market Analyst
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dhan/            # Health Scorer
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ niveshak/        # Portfolio Advisor
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ vidhi/           # Compliance Officer
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dhan-sarthi/     # Coordinator (Swarm Hub)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ life-event/      # Life Event Planner
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ couple-planner/  # Joint Finance Manager
โ”‚   โ”‚   โ””โ”€โ”€ api/                 # 14 BFF proxy routes
โ”‚   โ”œโ”€โ”€ prisma/schema.prisma     # DB models
โ”‚   โ””โ”€โ”€ __tests__/               # Jest test suite
โ”‚
โ”œโ”€โ”€ backend/                     # FastAPI + Python 3.12
โ”‚   โ”œโ”€โ”€ agents/
โ”‚   โ”‚   โ”œโ”€โ”€ karvid/              # Indian tax engine
โ”‚   โ”‚   โ”œโ”€โ”€ yojana/              # FIRE calculator
โ”‚   โ”‚   โ”œโ”€โ”€ bazaar/              # NSE stock data
โ”‚   โ”‚   โ”œโ”€โ”€ dhan/                # Health score (8-factor)
โ”‚   โ”‚   โ”œโ”€โ”€ niveshak/            # Portfolio analyzer
โ”‚   โ”‚   โ”œโ”€โ”€ vidhi/               # SEBI compliance
โ”‚   โ”‚   โ”œโ”€โ”€ dhan_sarthi/         # Query coordinator
โ”‚   โ”‚   โ”œโ”€โ”€ life_event/          # Life event planner
โ”‚   โ”‚   โ””โ”€โ”€ couple_planner/      # Couple finance planner
โ”‚   โ”œโ”€โ”€ bots/                    # Telegram bot integrations
โ”‚   โ”œโ”€โ”€ api_server.py            # FastAPI app (20+ endpoints)
โ”‚   โ”œโ”€โ”€ chat_bridge.py           # OpenClaw โ†” SQLite bridge
โ”‚   โ””โ”€โ”€ tests/e2e_test.py        # Integration tests
โ”‚
โ””โ”€โ”€ .openclaw/                   # Agent swarm configuration
    โ”œโ”€โ”€ agents/                  # 9 agent definitions
    โ””โ”€โ”€ SKILL.md                 # Swarm coordination rules

๐Ÿšข Deployment (EC2)

The project runs on an AWS EC2 instance:

# SSH into the instance
ssh -i your-key.pem ubuntu@your-ip

# Pull latest code
cd ~/ai-money-mentor
git pull origin main

# Start backend
cd backend
source venv/bin/activate
nohup uvicorn api_server:app --host 0.0.0.0 --port 8000 &

# Build & start frontend (production)
cd ../frontend
npm run build
npm run start -- -p 3000 &

# Or use PM2 (recommended โ€” auto-restart on crash):
pm2 restart all

Note: Ensure ports 3000 and 8000 are open in your AWS Security Group. The production instance uses PM2 for process management with 3 services: frontend, backend, and openclaw-node.


๐Ÿ“„ License

MIT License โ€” See LICENSE


๐Ÿ‘ค Author

Devguru Tiwari


๐Ÿ‡ฎ๐Ÿ‡ณ Built for India's Financial Future
Empowering every Indian with AI-driven personal finance

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors