Skip to content

ShashankGowni/Agentic_ChatBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° AI Financial Advisor Chatbot

An intelligent financial advisory chatbot powered by LangGraph with dual LLM support (Google Gemini & HuggingFace).

Python Streamlit LangGraph License: MIT


πŸ“¦ Table of Contents


πŸš€ Features

Specialized Financial Services:

  • πŸ† Gold Investment Planning - Calculate affordable gold purchases based on your income and expenses
  • πŸ’° Budget Analysis - Analyze your monthly budget using the 50-30-20 rule
  • πŸ“Š Investment Advice - Get personalized investment recommendations
  • πŸ“ˆ Financial Health Assessment - Track your savings rate and financial goals
  • πŸ€– General Financial Q&A - Ask any finance-related questions

Technical Features:

  • πŸ”· Dual LLM Support - Choose between Google Gemini (fast) or HuggingFace (unlimited)
  • ⚑ Dynamic Responses - AI-generated, context-aware advice (not templates)
  • πŸ“‹ Structured Outputs - Point-wise, easy-to-read financial analysis
  • πŸ”„ Intelligent Routing - Automatically routes queries to specialized agents
  • πŸ’Ύ Session Persistence - Maintains conversation history
  • 🌐 100% Free - No credit card required for either LLM provider


⚠️ Disclaimer

IMPORTANT: This chatbot provides general financial information for educational purposes only.

  • ❌ NOT a substitute for professional financial advice
  • ❌ NOT certified financial planning
  • ❌ NOT responsible for financial decisions made based on this tool

Always consult certified financial advisors before making important financial decisions.


πŸ“· Screenshots

Home Page

Home Page Screenshot

AI Provider Selection

Model Selection Screenshot

Chatbot Functionality

Chatbot Functionality Screenshot

Gold Investment Analysis

Gold Analysis Screenshot

Budget Analysis

Budget Analysis Screenshot


πŸ“₯ Installation

Prerequisites

  • Python 3.10 or higher
  • pip package manager
  • Internet connection (for cloud LLMs)

Step-by-Step Setup:

# 1. Clone the repository
git clone https://github.com/ShashankGowni/Agentic_ChatBot.git
cd Agentic_ChatBot

# 2. Create virtual environment
python -m venv venv

# 3. Activate virtual environment
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate

# 4. Install dependencies
pip install -r requirements.txt

πŸ”‘ API Keys Setup

You need at least ONE of these API keys (both are 100% FREE):

  • Option 1: Google Gemini (Recommended - Faster ⚑)
  • Go to Google AI Studio
  • Sign in with your Google account
  • Click "Create API Key"
  • Click "Create API key in new project"
  • Copy the key (starts with AIzaSy...)

Free Tier:

  • βœ… 60 requests per minute
  • βœ… 1,500 requests per day
  • βœ… No credit card required

Option 2: HuggingFace (Unlimited Requests πŸš€)

Go to HuggingFace

  • Sign up (completely free, no credit card)
  • Go to Settings β†’ Access Tokens
  • Click "New token"
  • Select "Read" access
  • Copy the token (starts with hf_...)

Free Tier:

  • βœ… Unlimited requests
  • βœ… No credit card required

Set Up Your Keys:

Create a .env file in the project root directory (same level as app.py):

env

Google Gemini API Key (get from: https://aistudio.google.com/app/apikey)

GEMINI_API_KEY=your_gemini_api_key_here

HuggingFace API Token (get from: https://huggingface.co/settings/tokens)

HUGGINGFACE_API_TOKEN=your_huggingface_token_here

⚠️ Important:

  • Never commit the .env file to GitHub (it's already in .gitignore)
  • You can use either or both keys

πŸ’‘ Usage

Run the Application:

streamlit run app.py

In Your Browser:

  • Open: http://localhost:8501
  • Select AI Provider: Choose between πŸ”· Gemini (fast) or πŸ€— HuggingFace (unlimited)
  • Select Model: Pick from available models in the dropdown
  • Enter API Key: Paste your key in the sidebar (or it auto-loads from .env)
  • Choose Use Case:
  • Financial Advisor
  • Gold Investment Advisor
  • Budget Analyzer
  • Basic Chatbot
  • Start Chatting! πŸ’¬

πŸ’¬ Example Queries

Gold Investment Planning:

I want to buy gold. My salary is 60k and expenses are 35k. 
How much can I buy in 4 months?

Expected Response:

πŸ† Gold Investment Analysis

πŸ’° Your Financial Summary:
β€’ Monthly Salary: β‚Ή60,000
β€’ Monthly Expenses: β‚Ή35,000
β€’ Monthly Savings: β‚Ή25,000
...

Budget Analysis:

Analyze my budget: income 80k, expenses 60k

Expected Response:

πŸ“Š Budget Analysis Report

πŸ’΅ Current Financial Status:
β€’ Monthly Income: β‚Ή80,000
β€’ Monthly Expenses: β‚Ή60,000
...

βš™οΈ Configuration

[DEFAULT]
PAGE_TITLE = Financial Advisor ChatBot

LLM_OPTIONS = gemini, huggingface

USECASE_OPTIONS = Financial Advisor, Gold Investment Advisor, Budget Analyzer, Basic Chatbot

# Available Gemini models (FREE)
Gemini_MODEL_OPTIONS = gemini-2.5-flash, gemini-flash-latest, gemini-2.0-flash

# Available HuggingFace models (FREE)
HuggingFace_MODEL_OPTIONS = mistralai/Mistral-7B-Instruct-v0.2, HuggingFaceH4/zephyr-7b-beta

πŸ“‚ Project Structure:

Agentic_ChatBot/
β”œβ”€β”€ app.py                          
β”œβ”€β”€ requirements.txt                
β”œβ”€β”€ .env                            
β”œβ”€β”€ .env.example                    
β”œβ”€β”€ .gitignore                      
β”œβ”€β”€ README.md                       
β”œβ”€β”€ images/                         
β”‚   β”œβ”€β”€ HomePage_Screenshot.png
β”‚   β”œβ”€β”€ ModelSelection_Screenshot.png
β”‚   β”œβ”€β”€ ChatbotFunctionality_Screenshot.png
β”‚   β”œβ”€β”€ GoldAnalysis_Screenshot.png
β”‚   └── BudgetAnalysis_Screenshot.png
└── src/
    └── lang_graph_chatbot/
        β”œβ”€β”€ main.py                 # Core chatbot logic
        β”œβ”€β”€ LLMS/                   # LLM integrations
        β”‚   β”œβ”€β”€ gemini_llm.py       # Google Gemini wrapper
        β”‚   β”œβ”€β”€ huggingface.py      # HuggingFace wrapper
        β”‚   β”œβ”€β”€ ollama.py           # (Optional) Ollama support
        β”‚   └── groq_llm.py         # (Deprecated)
        β”œβ”€β”€ nodes/                  # Specialized AI agents
        β”‚   β”œβ”€β”€ classifier_node.py          # Routes queries
        β”‚   β”œβ”€β”€ gold_advisor_node.py        # Gold expert
        β”‚   β”œβ”€β”€ budget_analyzer_node.py     # Budget expert
        β”‚   β”œβ”€β”€ basic_chatbot_node.py       # General Q&A
        β”‚   └── document_qa_node.py         # Document analysis
        β”œβ”€β”€ graph/                  # LangGraph workflow
        β”‚   └── graph_builder.py    # Builds agent workflow
        β”œβ”€β”€ state/                  # State management
        β”‚   └── state.py            # Conversation state
        β”œβ”€β”€ tools/                  # Financial calculators
        β”‚   β”œβ”€β”€ gold_advisor.py
        β”‚   β”œβ”€β”€ budget_calculator.py
        β”‚   └── financial_analyzer.py
        └── ui/                     # Streamlit UI
            β”œβ”€β”€ uiconfig.ini        # UI configuration
            β”œβ”€β”€ uiconfigfile.py     # Config parser
            └── streamlitui/
                β”œβ”€β”€ loadui.py       # UI loader
                └── display_result.py

πŸ› οΈ Tech Stack

Frameworks & Libraries:

  • Streamlit - Interactive web UI
  • LangGraph - Agent orchestration and workflow
  • LangChain - LLM integration framework
  • Python 3.10+ - Core programming language

LLM Providers (Cloud-Based):

Google Gemini AI πŸ”·

  • Models: gemini-2.5-flash, gemini-2.0-flash
  • Speed: ⚑⚑⚑⚑⚑ Very Fast
  • Limit: 1,500 requests/day (FREE)

HuggingFace Inference API πŸ€—

  • Models: Mistral-7B-Instruct, Zephyr-7B-beta
  • Speed: ⚑⚑⚑ Good
  • Limit: Unlimited (FREE)

Key Dependencies:

  • streamlit>=1.28.0
  • langgraph>=0.0.20
  • langchain>=0.1.0
  • langchain-core>=0.1.0
  • google-generativeai>=0.3.0
  • huggingface-hub>=0.19.0
  • python-dotenv>=1.0.0

πŸ”§ Troubleshooting

Issue: API Key not working

  • Verify key is correct in .env
  • Check key has proper permissions

Issue: Rate limit exceeded

  • Switch to HuggingFace (unlimited)
  • Wait for rate limit reset

⚠️ Known Limitations

  • Gemini: 1,500 requests/day limit
  • HuggingFace: Slower response times
  • Requires internet connection
  • Does not provide certified financial advice

πŸ“§ Contact

Maintainer: Shashank Gowni


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

What this means:

  • βœ… Free to use for personal and commercial projects
  • βœ… Free to modify and distribute
  • βœ… Just keep the copyright notice
  • ❌ No warranty provided

Acknowledgments

  • Built with LangGraph
  • Powered by Google Gemini AI and HuggingFace
  • UI built with Streamlit

🀝 Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

🌟 Show Your Support

If this project helped you, please ⭐ star the repository!

Made with ❀️ by Shashank Gowni

About

πŸ’° AI Financial Advisor – Streamlit app powered by LangGraph, Gemini, and HuggingFace for personalized financial insights.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages