π 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.