A sophisticated multi-agent AI system for portfolio management and investment advisory
Designed to showcase advanced Product Management skills for Fintech roles
# 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.
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
✅ 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
🎭 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.
| 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 |
| 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 |
Data Fetching → Agent Activation → Parallel Analysis → Synthesis → Output
↓ ↓ ↓ ↓ ↓
Yahoo Finance 7+ Agents Specialized Orchestrator Report
Initialize Analysis Combines to User
The Orchestrator doesn’t just concatenate agent outputs:
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:
- Deeper, specialized analysis
- Cross-validation of recommendations
- Transparency in decision-making
- Ability to resolve conflicting signals”
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
- Engagement: 5+ sessions/user/month
- Retention: 60% MAU
- NPS > 50
- Users report 15%+ better returns
- 10K active users in 6 months
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
| 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 |
# Input
tickers = ["RELIANCE.NS", "TCS.NS", "INFY.NS"]
risk_tolerance = "Moderate"
# Output
# ✅ Multi-dimensional analysis
# ✅ Buy/Hold/Sell recommendations
# ✅ Risk assessment
# ✅ Rebalancing 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
Each agent focuses on one domain, providing deeper, more accurate analysis than generalist models.
Orchestrator intelligently resolves disagreements (e.g., fundamental says BUY, technical says SELL).
Full transparency with execution logs, confidence levels, and reasoning for every recommendation.
Independent agents run concurrently, reducing analysis time from 3-4 minutes to under 60 seconds.
Orchestrator weighs agent inputs based on context (e.g., technical analysis matters more for short-term trades).
# 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!
This is a portfolio project, but suggestions are welcome!
git checkout -b feature/AmazingFeature)git commit -m 'Add AmazingFeature')git push origin feature/AmazingFeature)MIT License - See LICENSE for details
Built by: [Your Name]
LinkedIn: [Your LinkedIn]
Email: [Your Email]
Portfolio: [Your Portfolio Site]
✅ 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
❌ 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