FinanceAI is a full-stack Indian personal finance assistant that combines a FastAPI backend, an AI-driven advisory engine, and a client-side web dashboard. It is built to help users manage savings, investments, insurance, tax planning, financial health, stock analysis, and fraud detection through conversational guidance.
FinanceAI includes two primary execution modes:
- Web application:
app/main.pyexposes a FastAPI server with static UI assets instatic/and API endpoints for profile, chat, stock analysis, savings, tax, insurance, goals, portfolio, health score, and fraud protection. - CLI mode:
main.pylaunches a terminal-based chat agent powered by the Groq LLM API.
The project stores user state in a local SQLite database at financeai.db and persists profiles, conversations, snapshots, goals, and portfolio items.
- Personalized financial advice using a live profile context
- Fraud scan integration for suspicious investment requests
- Stock analysis and quick market price lookup via
yfinance - Savings plan generation and insurance need assessment
- Tax optimization support and investment roadmap creation
- Financial health score with actionable breakdowns
- Goals tracking, portfolio management, daily tips, and education modules
- Clean static web dashboard without a separate frontend build step
app/main.py- FastAPI server entrypointapp/agent.py- AI prompt builder and Groq chat integrationapp/models.py- request/response models through Pydanticapp/db_manager.py- SQLite schema and persistence operationsapp/database.py- lightweight DB access wrapperapp/stock_routes.py- API routes for analysis and utility actionsstatic/- browser UI includingindex.html,app.js, andstyles.cssrequirements.txt- required Python packages
- Python 3.11+ recommended
GROQ_API_KEYenvironment variable for Groq API access- Optional
.envfile support viapython-dotenv
Example .env:
GROQ_API_KEY=your_groq_api_key_here
From the project root:
python -m pip install -r requirements.txtpython -m uvicorn app.main:app --reloadThen open the browser at:
http://127.0.0.1:8000/
python main.pyThis command starts a simple terminal chat interface powered by the same Groq-backed AI model.
The FastAPI backend provides the following endpoints:
GET /- Serve the UI atstatic/index.htmlPOST /profile- Save or update user profile dataGET /profile/{session_id}- Get saved profile by sessionPOST /chat- AI chat interaction with profile-aware contextPOST /analyze-stock- Perform stock analysis + AI commentaryGET /quick-price/{symbol}- Fetch live price for market symbolsPOST /savings-analysis- Savings plan report and AI summaryPOST /tax-analysis- Tax savings guidancePOST /investment-roadmap- Personalized roadmap generationPOST /insurance-analysis- Insurance need assessmentPOST /spending-leaks- Detect spending leaks and alertsPOST /learn- Education content based on topicPOST /daily-tips- Daily finance tip + AI commentaryPOST /health-score- Financial health score with snapshot
The app automatically initializes a SQLite database named financeai.db when the server starts. The schema includes tables for:
profilesconversationsfinancial_snapshotsgoalsportfolio
The database is created by app/db_manager.py using init_db().
This project can be hosted on any Python-capable platform that supports FastAPI, such as:
- Railway
- Render
- Fly.io
- Azure App Service
- AWS Elastic Beanstalk
Recommended deployment steps:
- Ensure the environment variable
GROQ_API_KEYis configured in the hosting platform. - Install dependencies from
requirements.txt. - Start the app with
uvicorn app.main:app --host 0.0.0.0 --port 8000. - Expose port
8000or the platform-specific runtime port.
For a live demo experience, make sure the static UI is available and the API can be reached from the browser.
After verifying your changes locally, push to your repository:
git add .
git commit -m "Add README and document FinanceAI"
git push origin mainIf your branch is different, replace main with the active branch name.
- If the app fails to start, confirm
GROQ_API_KEYis set and valid. - If the web UI does not load, verify
uvicornis running and openhttp://127.0.0.1:8000/. - If the database cannot connect, confirm the process has write permission in the project folder.
The current implementation is ready for production polishing, including:
- stronger input validation on the frontend and backend
- rate limiting or API key protection for public hosting
- migrating SQLite to a managed database for scale
- adding formal unit tests and CI checks
- securing
/staticand production logging
- Fork the repository.
- Create a feature branch.
- Add or update code and tests.
- Commit with clear messages.
- Open a pull request for review.
FinanceAI is designed to be a fast, practical smart finance assistant for Indian users with a modern API-driven frontend and AI-backed advisory capabilities.