A multi-asset portfolio management system powered by LLMs (Large Language Models) that provides intelligent asset allocation recommendations across multiple asset classes.
PortfolioAgent is a framework that combines traditional financial models with AI-powered insights to optimize investment portfolios. The system integrates data from various financial markets and uses LLMs to analyze this data and produce investment recommendations.
-
Multi-asset Class Coverage:
- Equities (Sector ETFs)
- Fixed Income (Treasury and Credit ETFs)
- Commodities
- Foreign Exchange
-
Intelligent Analysis:
- Uses OpenAI's GPT models to analyze market data
- Combines traditional financial metrics with AI insights
- Produces structured recommendations with confidence scores
-
Advanced Backtesting:
- Black-Litterman model integration
- Performance evaluation over historical data
├── src/ # Source code
│ ├── agent/ # Agent implementations
│ │ ├── DataCollector.py # Data collection utilities
│ │ ├── PortfolioAgent.py # Base agent class
│ │ ├── equity_agent.py # Equity-specific agent
│ │ ├── fixedIncome_agent.py # Fixed income agent
│ │ ├── fx_agent.py # Foreign exchange agent
│ │ ├── commodity_agent.py # Commodity agent
│ │ └── manager_agent.py # Manager agent coordinating other agents
│ ├── backtest/ # Backtesting framework
│ │ └── blackLitterman_test.py # Black-Litterman model implementation
│ ├── config/ # Configuration settings
│ │ └── settings.py # Portfolio definitions and settings
│ ├── evaluator/ # Performance evaluation tools
│ └── util/ # Utility functions
├── data/ # Data storage directory
├── report/ # Analysis reports
├── slides/ # Presentation materials
└── literature/ # Research papers and references
- Python 3.8+
- OpenAI API Key
- FRED API Key (for macroeconomic data)
- WRDS Login
- Dependencies listed in requirements.txt
- Clone the repository
- Create a
.envfile with your API keys:OPENAI_API_KEY=your_openai_api_key FRED_API_KEY=your_fred_api_key WRDS_USERNAME=your_wrds_username - Install required dependencies:
pip install -r requirements.txt
The system operates through specialized agents for each asset class that:
- Collect relevant market data via
DataCollectorclasses - Process and prepare data for LLM analysis
- Generate investment recommendations using structured LLM prompts
- Combine recommendations across asset classes via the
manager_agent
This project builds on research in portfolio optimization, specifically the Black-Litterman model, and leverages large language models for financial analysis.