{"id":50310437,"url":"https://github.com/chhitij/fin-advise-app","last_synced_at":"2026-05-28T20:30:58.687Z","repository":{"id":324595305,"uuid":"1097756166","full_name":"chhitij/fin-advise-app","owner":"chhitij","description":" FinAdvise - AI-Powered Personal Finance Assistant","archived":false,"fork":false,"pushed_at":"2025-11-16T20:27:06.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-16T21:18:18.335Z","etag":null,"topics":["genai-chatbot","langchain","langgraph","multiagent"],"latest_commit_sha":null,"homepage":"https://fin-advise-app.onrender.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chhitij.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-16T19:11:21.000Z","updated_at":"2025-11-16T20:27:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chhitij/fin-advise-app","commit_stats":null,"previous_names":["chhitij/fin-advise-app"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chhitij/fin-advise-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chhitij%2Ffin-advise-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chhitij%2Ffin-advise-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chhitij%2Ffin-advise-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chhitij%2Ffin-advise-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chhitij","download_url":"https://codeload.github.com/chhitij/fin-advise-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chhitij%2Ffin-advise-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33626136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["genai-chatbot","langchain","langgraph","multiagent"],"created_at":"2026-05-28T20:30:58.504Z","updated_at":"2026-05-28T20:30:58.665Z","avatar_url":"https://github.com/chhitij.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"💰 FinAdvise - AI-Powered Personal Finance Assistant\n\nAn intelligent financial advisor chatbot built with **LangGraph**, **LangChain**, and **OpenAI GPT** that helps users manage their finances, track expenses, analyze stocks, and receive personalized financial advice.\n\n\u003cimg width=\"997\" height=\"581\" alt=\"Screenshot 2025-11-17 004311\" src=\"https://github.com/user-attachments/assets/e9d30e23-efe1-4cb0-b197-4bc111ac18ff\" /\u003e\n\n\n## LangSMith https://smith.langchain.com\n\n## 🎯 Purpose\n\nFinAdvise is designed to democratize financial literacy by providing:\n- **Real-time stock price information** using Yahoo Finance\n- **Expense tracking and budgeting** with automatic categorization\n- **Personalized financial advice** based on user profiles\n- **Context-aware conversations** that remember previous discussions\n- **Human-in-the-loop safety** for high-risk financial decisions\n- **LangSmith tracing** for monitoring and debugging AI interactions\n\n## ✨ Key Features\n\n### 1. **Stock Analysis**\n- Get real-time stock prices for any US company\n- Contextual follow-up questions (e.g., \"Should I buy it?\")\n- Personalized investment advice based on risk tolerance and age\n\n### 2. **Expense Tracking**\n- Add expenses with natural language (e.g., \"Add $50 for groceries\")\n- Automatic categorization (Housing, Food, Transportation, etc.)\n- Track spending patterns over time\n\n### 3. **Budget Management**\n- View spending breakdown by category\n- Compare income vs. expenses\n- Get alerts when over budget\n- See recent transaction history\n\n### 4. **Financial Advice**\n- Personalized recommendations based on your profile\n- Risk-appropriate investment strategies\n- Budget optimization tips\n- Savings goal planning\n\n### 5. **Smart Memory System**\n- **Short-term memory**: Remembers context within conversation\n- **Long-term memory**: Stores user profile and financial goals\n- **Expense history**: Tracks all transactions\n\n### 6. **Safety Features**\n- **Human-in-the-Loop (HITL)**: Flags high-risk queries like \"liquidate retirement\"\n- **Risk assessment**: Provides advice based on user's risk tolerance\n- **Transparent tracking**: All AI interactions logged in LangSmith\n\n## 🚀 Quick Start\n\n### Prerequisites\n- Python 3.8+\n- OpenAI API key\n- LangSmith API key (optional, for tracking)\n\n### Installation\n\n1. **Clone the repository:**\n```bash\ncd d:\\genrative-ai-repo\\stock-analysis\n```\n\n2. **Create conda environment:**\n```bash\nconda create -n finapp python=3.10\nconda activate finapp\n```\n\n3. **Install dependencies:**\n```bash\npip install -r requirements.txt\n```\n\n4. **Create `.env` file:**\n```env\nOPENAI_API_KEY=sk-your-openai-key-here\nLANGSMITH_API_KEY=lsv2_pt_your-langsmith-key-here\nLANGCHAIN_TRACING_V2=true\nLANGCHAIN_PROJECT=finadvise-app\n```\n\n5. **Run the app:**\n```bash\npython app.py\n```\n\n6. **Open in browser:**\n- Local: http://127.0.0.1:7860\n- Public: Check terminal for Gradio share link\n\n## 📊 Sample Questions\n\n### Stock Analysis\n```\n✅ \"What's Apple stock price?\"\n✅ \"How much is TSLA trading at?\"\n✅ \"Tell me about Microsoft stock\"\n✅ \"Should I buy AAPL?\" (after asking about Apple)\n✅ \"Is that a good price?\" (follow-up question)\n```\n\n### Expense Tracking\n```\n✅ \"Add $50 for groceries\"\n✅ \"I spent $1200 on rent\"\n✅ \"Spent $100 on utilities yesterday\"\n✅ \"Add $45.99 for dinner\"\n✅ \"I paid $80 for gas\"\n```\n\n### Budget Summary\n```\n✅ \"Show me a budget summary\"\n✅ \"What's my spending breakdown?\"\n✅ \"How much have I spent this month?\"\n✅ \"Am I over budget?\"\n```\n\n### Financial Advice\n```\n✅ \"Should I invest in stocks or bonds?\"\n✅ \"How much should I save each month?\"\n✅ \"What's a good emergency fund amount?\"\n✅ \"Is it a good time to invest?\"\n✅ \"Should I pay off debt or invest?\"\n```\n\n### User Profile\n```\n✅ \"I'm 30 years old\"\n✅ \"My income is $60,000 per year\"\n✅ \"My goal is to save for retirement\"\n✅ \"I have moderate risk tolerance\"\n✅ \"I want to buy a house in 5 years\"\n```\n\n### Follow-up Questions (Context Awareness)\n```\n✅ \"What's Google stock?\" → \"Should I buy it?\"\n✅ \"Add $200 for groceries\" → \"Show me my food expenses\"\n✅ \"Tell me about Tesla\" → \"Is it worth investing in?\"\n```\n\n### High-Risk Queries (HITL Triggers)\n```\n⚠️ \"Should I liquidate my retirement account?\"\n⚠️ \"I want to invest all my savings in crypto\"\n⚠️ \"Should I sell everything?\"\n⚠️ \"I want to use my entire portfolio for one stock\"\n```\n\n## 🏗️ Architecture\n\n### LangGraph Workflow\n```\nUser Input\n    ↓\n[Intent Detection] ──→ Classifies: profile/stock/expense/budget/advice\n    ↓\n[Routing Logic] ──→ Selects appropriate node\n    ↓\n[Action Node] ──→ Executes task (fetch stock, track expense, etc.)\n    ↓\n[Response] ──→ Returns to user\n```\n\n### State Management\n```python\nFinanceState = {\n    \"user_input\": str,              # Current message\n    \"intent\": str,                  # Detected intent\n    \"data\": dict,                   # Response data\n    \"user_profile\": dict,           # Age, income, risk tolerance\n    \"short_term_memory\": dict,      # Last stock, previous intent\n    \"long_term_memory\": dict,       # Historical advice\n    \"hitl_flag\": bool,              # Safety trigger\n    \"expenses\": list                # Tracked expenses\n}\n```\n\n## 🛠️ Technology Stack\n\n| Component | Technology |\n|-----------|-----------|\n| **AI Framework** | LangChain, LangGraph |\n| **LLM** | OpenAI GPT-4o-mini (fallback: gpt-5-nano) |\n| **Stock Data** | yfinance |\n| **UI** | Gradio (ChatInterface) |\n| **Monitoring** | LangSmith |\n| **Environment** | python-dotenv |\n\n## 📈 LangSmith Tracking\n\nView all AI interactions, prompts, and responses:\n1. Go to https://smith.langchain.com\n2. Select project: **finadvise-app**\n3. View traces for:\n   - All LLM calls\n   - State transitions\n   - Token usage\n   - Latency metrics\n\n## 🎨 Customization\n\n### Change Theme\n```python\n# In app.py, line 437\ndark_theme = gr.themes.Soft()  # Options: Monochrome, Soft, Glass, Base\n```\n\n### Adjust LLM Temperature\n```python\n# In app.py, line 56\nllm = ChatOpenAI(\n    temperature=0.3  # Lower = more consistent, Higher = more creative\n)\n```\n\n### Add New Intent\n1. Update `detect_intent()` prompt\n2. Add new node function\n3. Update routing in `get_next_node()`\n4. Add conditional edge in graph builder\n\n## 🔒 Security\n\n- ✅ API keys stored in `.env` (never committed)\n- ✅ High-risk queries flagged for human review\n- ✅ User data stored in memory only (not persisted)\n- ✅ All AI calls logged for audit trail\n\n## 🐛 Troubleshooting\n\n### \"OPENAI_API_KEY not found\"\n- Check `.env` file exists in project root\n- Verify key format: `OPENAI_API_KEY=sk-...`\n\n### \"Module not found\" errors\n```bash\npip install -r requirements.txt\n```\n\n### Stock data errors\n- Yahoo Finance may rate-limit requests\n- Use valid stock symbols (AAPL, TSLA, GOOGL, etc.)\n\n### LangSmith not tracking\n- Verify `LANGCHAIN_TRACING_V2=true` in `.env`\n- Check API key is valid\n- Ensure internet connection\n\n## 📝 License\n\nMIT License - feel free to use and modify!\n\n## 🤝 Contributing\n\nContributions welcome! Areas for improvement:\n- Add more financial indicators (P/E ratio, dividends)\n- Persistent storage (database integration)\n- Multi-language support\n- Voice input/output\n- Portfolio optimization algorithms\n\n## 📧 Contact\n\nFor questions or support, open an issue on GitHub.\n\n---\n\n**Built with ❤️ using LangChain and LangGraph**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchhitij%2Ffin-advise-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchhitij%2Ffin-advise-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchhitij%2Ffin-advise-app/lists"}