Overview
AI Hedge Fund employs multiple AI agents working together, each representing a different investment philosophy (Warren Buffett, Cathie Wood, Charlie Munger, and others), to analyze stocks and make portfolio decisions. Features analytical agents for valuation, sentiment, fundamentals, and technicals with a risk manager and portfolio manager.
Features
- ✓19 specialized investor agent personas
- ✓Analytical agents for valuation and sentiment
- ✓Risk Manager with position limits
- ✓Portfolio Manager for final decisions
- ✓Built-in backtesting engine
- ✓Web dashboard interface
- ✓Local LLM support via Ollama
Installation
poetry install && poetry run python run.py --ticker AAPLPros
- +Excellent educational framework for multi-agent finance
- +19 diverse agent personalities provide unique perspectives
- +Built-in backtesting and historical performance evaluation
- +Local LLM support via Ollama
Cons
- −Not designed for real trading
- −Requires multiple API keys
- −Quality depends on underlying LLM performance
Alternatives
Documentation
AI Hedge Fund
Overview
AI Hedge Fund is an open-source proof of concept for an AI-powered hedge fund that explores using AI to make trading decisions. Created by Virat T. Thakkar (virattt), it employs multiple AI agents working together, each representing a different investment philosophy, to analyze stocks and make portfolio decisions.
The project has become one of the most popular AI agent demonstrations on GitHub, with over 61,000 stars, thanks to its creative approach to multi-agent financial analysis. It is designed for educational and research purposes only — it does not execute real trades.
The system is evolving into a persistent, always-on AI hedge fund with pluggable, backtestable alpha models, making it an excellent framework for studying how different AI personalities and analytical approaches converge on trading decisions.
Features
- 19 Specialized Agents: Each agent represents a different investment philosophy (Warren Buffett, Cathie Wood, Charlie Munger, Ben Graham, and others)
- Analytical Agents: Valuation, Sentiment, Fundamentals, and Technicals agents provide quantitative analysis
- Risk Manager: Calculates risk metrics and sets position limits
- Portfolio Manager: Makes final trading decisions and generates orders
- Backtesting Engine: Built-in backtester to evaluate historical performance
- Command Line Interface: Granular control for automation and scripting
- Web Application: User-friendly visual interface for easier access
- Date Range Support: Specify start and end dates for analysis
- Local LLM Option: Run with Ollama for local large language models
- Pluggable Alpha Models: Extensible framework for adding custom investment strategies
Installation
# Clone the repository
git clone https://github.com/virattt/ai-hedge-fund.git
cd ai-hedge-fund
# Create a .env file with API keys
cp .env.example .env
# Add your API keys: OpenAI, Financial Datasets, or alternatives like Groq, Anthropic, DeepSeek
# Install dependencies via Poetry
poetry install
Set up your .env file with the necessary API keys:
OPENAI_API_KEY=your-openai-key
FINANCIAL_DATASETS_API_KEY=your-financial-datasets-key
# Optional: GROQ_API_KEY, ANTHROPIC_API_KEY, DEEPSEEK_API_KEY
Quick Start
# Run a multi-agent analysis on a single stock
poetry run python run.py --ticker AAPL
# Run with a date range for backtesting
poetry run python run.py --ticker TSLA --start-date 2023-01-01 --end-date 2023-12-31
# Run with a local LLM via Ollama
poetry run python run.py --ticker NVDA --llm ollama
Core Concepts
The system employs a multi-agent architecture with clear role separation:
- Investor Personas: Agents like Warren Buffett (value), Cathie Wood (innovation), Charlie Munger (rationality), and Ben Graham (deep value) each provide analysis through their investment lens
- Analytical Agents: Valuation, Sentiment, Fundamentals, and Technicals agents provide data-driven insights
- Risk Manager: Synthesizes risk metrics across all signals and sets conservative position limits
- Portfolio Manager: Aggregates all agent recommendations into final trading decisions and generates order output
The agents work collaboratively, with each providing a unique perspective that the Portfolio Manager synthesizes into a cohesive recommendation.
Advanced Features
Pluggable Alpha Models
The framework is designed to accept custom alpha models, making it extensible for research into new investment strategies. Users can implement their own analytical agents and integrate them into the existing pipeline.
Always-On Persistence
The project is evolving toward a persistent, always-on AI hedge fund that continuously monitors markets and adjusts positions based on real-time data and agent consensus.
Web Dashboard
A web application provides a visual interface for monitoring agent performance, viewing analysis history, and tracking portfolio decisions over time.
Examples
Full Portfolio Analysis
# Analyze a basket of tech stocks
poetry run python run.py --tickers AAPL,MSFT,GOOGL,NVDA --start-date 2024-01-01 --end-date 2024-06-30
Historical Backtest
# Run a full-year backtest with detailed reporting
poetry run python run.py --ticker META --start-date 2023-01-01 --end-date 2023-12-31 --verbose
Local LLM Research
# Run analysis using a locally-hosted LLM
poetry run python run.py --ticker AMD --llm ollama --model llama3
Pros
- ✅ Excellent educational framework for learning multi-agent financial analysis
- ✅ 19 diverse agent personalities provide unique investment perspectives
- ✅ Built-in backtesting and historical performance evaluation
- ✅ Active development with expanding feature set
- ✅ Flexible API key support (OpenAI, Groq, Anthropic, DeepSeek)
- ✅ Local LLM support via Ollama for privacy-focused deployments
Cons
- ❌ Not designed for real trading — no execution capabilities
- ❌ Requires multiple API keys for full functionality
- ❌ Quality of analysis depends on underlying LLM performance
- ❌ Limited to public market data through supported providers
When to Use
- Education: Learn how multi-agent AI systems approach investment analysis and portfolio construction
- Research: Study how different AI investment philosophies converge or diverge
- Backtesting: Evaluate hypothetical strategies against historical market data
- Framework Development: Use as inspiration for building real trading systems with proper risk management
