📊 Portfolio Analyst Agent
An AI-powered portfolio analysis tool that helps you understand your investments using real market data and large language models.
Upload your holdings (CSV) or paste them manually and receive:
Portfolio insights
Risk and concentration analysis
Performance snapshot
Correlation analysis
An AI-generated narrative report
✨ Features
Upload a CSV portfolio (symbol, shares, avg_price)
Or manually paste holdings
Live market data via yfinance
Portfolio metrics:
Total value
Allocation by holding
Sector exposure
Correlation matrix
Estimated volatility
Lookback return
AI-generated portfolio report (using OpenAI)
Interactive charts (Streamlit)
Optional local report memory (portfolio_memory.json)
📸 Demo (optional)
You can add screenshots here later:
/screenshots/portfolio-report.png
🧠 Example Use Case
Input portfolio:
Symbol Shares Avg Price AAPL 50 145 NVDA 10 720 TSLA 20 230
Output:
Portfolio value
Concentration risk (e.g., too much tech exposure)
High correlation warning between NVDA / AAPL / MSFT
AI-written explanation of portfolio strengths & risks
What to watch next week (macro + earnings themes)
🛠 Tech Stack
Python
Streamlit (UI)
OpenAI API (analysis + report generation)
yfinance (market data)
pandas / numpy (data analysis)
📂 Project Structure portfolio-analyst-agent/ │ ├── app.py ├── requirements.txt ├── README.md ├── .gitignore └── portfolio_memory.json # (ignored by git)
📄 CSV Format
Upload a CSV like this:
symbol,shares,avg_price AAPL,50,145 NVDA,10,720 TSLA,20,230 MSFT,15,310
avg_price is optional but recommended for P/L calculations.
🚀 Installation
Clone the repo:
git clone https://github.com/yourusername/portfolio-analyst-agent.git cd portfolio-analyst-agent
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # macOS/Linux venv\Scripts\activate # Windows
Install dependencies:
pip install -r requirements.txt
Run the app:
python -m streamlit run app.py
Then open:
🔑 API Key
You will need an OpenAI API key.
When the app runs, enter your key in the sidebar.
Your key is not stored anywhere.
📌 Roadmap
Planned future agents in this project series:
✅ Insider Intelligence Agent
✅ Portfolio Analyst Agent
⏳ Trade Journal Coach Agent
⏳ Watchlist + Alert Agent
⏳ Market Regime Detector
⏳ Earnings Reaction Analyzer
This project is for educational and research purposes only. It does not constitute financial advice. Always do your own research.
👤 Author
Built by Sai Vamsy Palakollu Learning-focused AI + finance projects.