This is an AI-powered Investment Planner built using Google Gemini (Generative AI API) and Streamlit for the UI. It helps users build a customized investment plan based on their financial goals, risk tolerance, income, and investment horizon.
- Personalized investment plans based on user input
- Secure API key input (supports
.streamlit/secrets.tomlor manual entry) - Uses Gemini (
gemini-proorgemini-1.5-pro) for generating financial advice - Stylish and responsive dark UI
- Investment allocation, important considerations, and disclaimers
- Safe error handling for API, JSON parsing, and model selection
- Streamlit - for the frontend
- Google Generative AI API - for generating investment advice
- Python 3.8+
- HTML/CSS for custom styling inside Streamlit
git clone https://github.com/Freya135/AI-investment-Assistant.gitpython -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windowspip install -r requirements.txtYou have two options:
Option A: Add to secrets.toml (recommended)
Create a file .streamlit/secrets.toml with:
GOOGLE_API_KEY = "your_google_api_key"Option B: Enter it manually in the app when prompted.
Running the App
streamlit run investment_planner.pyThen open http://localhost:8501 in your browser.
- You enter your financial details (goal, income, debt, risk appetite, etc.)
- The app formats this into a structured prompt.
- The Gemini API generates a JSON-formatted investment plan.
- The app parses the JSON and displays it beautifully using Streamlit components.
Example Output
{
"Understanding Your Situation": "...",
"Investment Options & Potential Allocation": "...",
"Important Considerations": "...",
"Disclaimer": "I'm an AI chatbot, not a financial advisor..."
}This tool is intended for educational purposes only. It does not replace professional financial advice. Always consult a certified financial planner for real investment decision