resham-dilawari

🤖 AI Portfolio Advisor - Multi-Agent System

Python 3.8+ Streamlit License: MIT

A sophisticated multi-agent AI system for portfolio management and investment advisory
Designed to showcase advanced Product Management skills for Fintech roles


🎯 Quick Start

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

# 2. Set up API key
cp .env.example .env
# Edit .env and add your GEMINI_API_KEY

# 3. Test the system
python demo_agents.py

# 4. Run the application
streamlit run app_multiagent.py

Visit http://localhost:8501 in your browser.


🌟 What Makes This Special?

For Product Manager Roles

This project demonstrates critical PM skills:

✅ Product Thinking - Modular multi-agent architecture
✅ Technical Depth - AI/ML system design and implementation
✅ Domain Expertise - Finance, risk, tax, and regulatory knowledge
✅ User Focus - Personalization, risk profiling, actionable insights
✅ Documentation - PRDs, user stories, technical specs
✅ Execution - Working prototype with real-world data

For Technical Roles

✅ Advanced AI - Multi-agent orchestration, LLM coordination
✅ Clean Code - OOP, modular design, maintainable architecture
✅ Real-time Data - Yahoo Finance API integration
✅ Production Ready - Error handling, logging, scalability


🏗️ System Architecture

🎭 Orchestrator Agent (Master Coordinator)
     │
     ├─── 🔍 Fundamental Analysis Agent
     │    └─ Company financials, valuation, business models
     │
     ├─── 📈 Technical Analysis Agent
     │    └─ Price patterns, trends, momentum indicators
     │
     ├─── 📰 News Sentiment Agent
     │    └─ News analysis, market psychology
     │
     ├─── ⚠️ Risk Assessment Agent
     │    └─ Portfolio risk, diversification, stress tests
     │
     ├─── 🎯 Portfolio Optimizer Agent
     │    └─ Asset allocation, rebalancing strategies
     │
     ├─── 🔬 Market Research Agent
     │    └─ Sector trends, macro analysis
     │
     └─── 💰 Tax Optimization Agent
          └─ Tax-efficient strategies (STCG/LTCG)

Key Innovation: Unlike single-model approaches, this system employs specialized agents that work collaboratively, mimicking how a team of financial experts would analyze a portfolio.


🚀 Features

Core Capabilities

Feature Description Status
Multi-Agent Analysis 7+ specialized AI agents working in parallel ✅ Complete
Portfolio Analysis Comprehensive analysis of current holdings ✅ Complete
Investment Recommendations Personalized stock suggestions ✅ Complete
Risk Assessment Beta, volatility, VaR, Sharpe ratio ✅ Complete
Technical Indicators RSI, MACD, Moving Averages ✅ Complete
News Sentiment Real-time news analysis ✅ Complete
Tax Optimization STCG/LTCG strategies ✅ Complete
Portfolio Optimization Asset allocation recommendations ✅ Complete
Execution Transparency Full agent logs and decision tracking ✅ Complete
Report Download Export analysis as JSON ✅ Complete

Advanced Features (Roadmap)

Feature Description Status
Portfolio Tracking Track performance over time 🔄 Planned
Backtesting Historical performance simulation 🔄 Planned
Alerts System Price/news alerts 🔄 Planned
Mobile App iOS/Android applications 🔄 Future
Broker Integration Direct trade execution 🔄 Future

📊 How It Works

1. User Input

2. Multi-Agent Processing

Data Fetching → Agent Activation → Parallel Analysis → Synthesis → Output
     ↓                 ↓                  ↓              ↓          ↓
  Yahoo Finance   7+ Agents        Specialized      Orchestrator  Report
                  Initialize         Analysis       Combines     to User

3. Intelligent Synthesis

The Orchestrator doesn’t just concatenate agent outputs:


🎓 For Your PM Interview

Key Talking Points

1. Problem Definition

“Individual investors in India face information overload and lack expertise across fundamental, technical, and risk analysis. Professional advisory costs ₹5K-25K per consultation. Our multi-agent system provides institutional-grade analysis at consumer price point.”

2. Solution Architecture

“We employ 7 specialized AI agents - each an expert in one domain. The orchestrator coordinates them, resolves conflicts, and synthesizes insights. It’s like having a team of analysts working on your portfolio simultaneously.”

3. Product Differentiation

“Unlike single-model competitors, our multi-agent approach provides:

4. Business Model

“Freemium: Basic analysis free, advanced features (backtesting, alerts, tax optimization) paid. B2C for retail investors, B2B2C for financial advisors (white-label).”

5. Success Metrics


📁 Project Structure

AI Portfolio Advisor/
│
├── agents/                      # Multi-agent system
│   ├── __init__.py
│   ├── base_agent.py           # Base agent class
│   ├── orchestrator.py         # Master coordinator
│   ├── fundamental_agent.py    # Fundamental analysis
│   ├── technical_agent.py      # Technical analysis
│   ├── sentiment_agent.py      # News sentiment
│   ├── risk_agent.py           # Risk assessment
│   ├── optimizer_agent.py      # Portfolio optimization
│   ├── research_agent.py       # Market research
│   └── tax_agent.py            # Tax optimization
│
├── docs/                        # Documentation
│   └── PRD_MultiAgent_Portfolio_Advisor.md
│
├── app.py                       # Simple version (original)
├── app_multiagent.py           # Multi-agent version (NEW)
├── ai_agent.py                 # Legacy agent code
├── financial_data.py           # Basic data fetching
├── financial_data_enhanced.py  # Enhanced data provider (NEW)
├── demo_agents.py              # Test script (NEW)
│
├── requirements.txt            # Dependencies
├── .env.example                # Environment template
├── .gitignore
├── README.md                   # This file
└── README_MULTIAGENT.md        # Detailed multi-agent docs

🛠️ Technical Stack

Component Technology Purpose
Frontend Streamlit Web UI
AI/ML Google Gemini 2.0 Flash LLM for agents
Data yfinance Market data
Processing Pandas, NumPy Data analysis
Architecture Multi-Agent System Agent coordination
Language Python 3.8+ Implementation

📖 Documentation

For Product Managers

For Developers


🚦 Usage Examples

Example 1: Analyze Existing Portfolio

# Input
tickers = ["RELIANCE.NS", "TCS.NS", "INFY.NS"]
risk_tolerance = "Moderate"

# Output
# ✅ Multi-dimensional analysis
# ✅ Buy/Hold/Sell recommendations
# ✅ Risk assessment
# ✅ Rebalancing suggestions

Example 2: Get Investment Suggestions

# Input
corpus = 100000  # ₹1 lakh
goals = ["Wealth Creation", "Tax Saving"]
preferences = "Focus on IT and Banking sector"

# Output
# ✅ 3-5 stock recommendations
# ✅ Allocation percentages
# ✅ Tax implications
# ✅ Risk-reward analysis

🎯 Roadmap

Phase 1: MVP ✅ (Current)

Phase 2: Enhancement 🔄 (Next 4 weeks)

Phase 3: Scale 📅 (Months 2-3)

Phase 4: Enterprise 🚀 (Months 4-6)


💡 Key Innovations

1. Agent Specialization

Each agent focuses on one domain, providing deeper, more accurate analysis than generalist models.

2. Conflict Resolution

Orchestrator intelligently resolves disagreements (e.g., fundamental says BUY, technical says SELL).

3. Explainable AI

Full transparency with execution logs, confidence levels, and reasoning for every recommendation.

4. Parallel Execution

Independent agents run concurrently, reducing analysis time from 3-4 minutes to under 60 seconds.

5. Context-Aware Synthesis

Orchestrator weighs agent inputs based on context (e.g., technical analysis matters more for short-term trades).


🧪 Testing

# Run system test
python demo_agents.py

# Expected output:
# ✅ Data Provider - PASS
# ✅ Fundamental Agent - PASS
# ✅ Technical Agent - PASS
# ✅ Sentiment Agent - PASS
# ✅ Risk Agent - PASS
# ✅ Orchestrator - PASS
# ✅ Full Workflow - PASS
# 
# 🎉 All systems operational!

🤝 Contributing

This is a portfolio project, but suggestions are welcome!

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

📝 License

MIT License - See LICENSE for details


🙏 Acknowledgments


📧 Contact

Built by: [Your Name]
LinkedIn: [Your LinkedIn]
Email: [Your Email]
Portfolio: [Your Portfolio Site]


🎉 Why This Project Stands Out

For Fintech PM Roles

✅ Domain Knowledge: Finance, risk, tax, regulations
✅ AI Product Experience: Multi-agent systems, LLM orchestration
✅ Technical Credibility: Working code, not just slides
✅ Product Thinking: Clear problem → solution → metrics
✅ Documentation: PRDs, user stories, roadmaps
✅ Execution: Shipped a functional prototype

Differentiation from Other Projects

❌ Other Projects: Single chatbot answering finance questions
✅ This Project: Sophisticated multi-agent system with specialized experts

❌ Other Projects: Generic stock screeners
✅ This Project: Personalized, multi-dimensional AI advisory

❌ Other Projects: No clear product strategy
✅ This Project: Complete PRD, roadmap, business model


**⭐ Star this repo if you find it useful!** **Built with ❤️ for Product Management opportunities in Fintech**