AI Hedge Fund: The Open-Source Project That Simulates 13 Legendary Investors as AI Agents to Make Trading Decisions
AI Hedge Fund is a trending open-source project that uses multiple AI agents — each modeled after legendary investors like Warren Buffett, Charlie Munger, and Cathie Wood — to collaboratively analyze stocks and generate trading signals. With 13+ investor personas, a built-in backtester, and support for local LLMs via Ollama, this project demonstrates how multi-agent AI systems can democratize financial analysis.
AI Hedge Fund is an open-source Python project that simulates a team of 13 AI agents — each modeled after legendary investors like Warren Buffett, Charlie Munger, Michael Burry, and Cathie Wood — to collaboratively analyze stocks and generate buy/sell/hold signals. It supports backtesting, local LLMs via Ollama, and multiple LLM providers (OpenAI, Anthropic, Groq, DeepSeek). With a web UI and CLI interface, developers can explore how multi-agent AI systems approach financial decision-making — all for educational purposes.
What if you could assemble a boardroom of the world's greatest investors — Buffett, Munger, Burry, Druckenmiller — and have them debate a stock pick in real time? That's exactly what AI Hedge Fund does, except every seat at the table is occupied by an AI agent.
The project has been trending on GitHub for months, accumulating tens of thousands of stars, and for good reason: it's one of the most compelling demonstrations of multi-agent AI collaboration applied to a domain that affects everyone — financial markets.
In this deep dive, we'll explore how the AI Hedge Fund works under the hood, why its architecture matters for the future of AI-powered tools, and how you can run it locally today.
How AI Hedge Fund Works: 13 Agents, One Portfolio
The core idea is elegantly simple: each AI agent is given a specific investment philosophy modeled after a real-world legendary investor. When you ask the system to analyze a stock ticker (say, AAPL or NVDA), every agent evaluates the data through their unique lens.
The Investor Agents
Here's the full roster of AI agents, each with a distinct personality and analytical approach:
- Warren Buffett Agent — Seeks wonderful companies at fair prices. Focuses on competitive moats and long-term value.
- Charlie Munger Agent — Buffett's partner. Applies mental models and inversion thinking to avoid bad investments.
- Ben Graham Agent — The godfather of value investing. Only buys hidden gems with a margin of safety.
- Aswath Damodaran Agent — The Dean of Valuation. Focuses on story, numbers, and disciplined DCF analysis.
- Bill Ackman Agent — Activist investor. Takes bold, concentrated positions and pushes for change.
- Cathie Wood Agent — The queen of growth investing. Believes in disruptive innovation and exponential curves.
- Michael Burry Agent — The contrarian from "The Big Short." Hunts for deep value where others see disaster.
- Peter Lynch Agent — Practical investor who seeks "ten-baggers" in everyday businesses he understands.
- Phil Fisher Agent — Meticulous growth investor who uses deep "scuttlebutt" research methodology.
- Mohnish Pabrai Agent — The Dhandho investor. Looks for low-risk, high-reward doubles.
- Nassim Taleb Agent — The Black Swan risk analyst. Focuses on tail risk, antifragility, and asymmetric payoffs.
- Stanley Druckenmiller Agent — Macro legend who hunts asymmetric opportunities with growth potential.
- Rakesh Jhunjhunwala Agent — The Big Bull of India. Growth-oriented with a keen eye for emerging markets.
Supporting Agents
Beyond the investor personas, the system runs specialized analytical agents:
- Valuation Agent — Calculates intrinsic value using DCF, comparable analysis, and other models.
- Sentiment Agent — Analyzes market sentiment from news, social media, and market data.
- Fundamentals Agent — Processes financial statements, ratios, and key metrics.
- Technicals Agent — Analyzes price action, moving averages, RSI, MACD, and other indicators.
- Risk Manager — Calculates risk metrics (VaR, Sharpe ratio) and sets position limits.
- Portfolio Manager — Synthesizes all agent signals and makes the final trading decision.
The architecture follows a multi-agent debate pattern: each agent independently analyzes the stock, then the Portfolio Manager weighs their conflicting opinions to produce a final recommendation. This mirrors how real hedge funds operate — diverse analysts with different frameworks, reporting to a portfolio manager who synthesizes the signals.
The Multi-Agent Architecture: Why It Matters
Most AI applications today use a single LLM call — send a prompt, get a response. AI Hedge Fund takes a fundamentally different approach that's worth studying because it points toward the future of AI system design.
Debate-Driven Decision Making
When you run poetry run python src/main.py --ticker NVDA, here's what happens:
- Data Collection — Financial data, technical indicators, and sentiment signals are gathered.
- Parallel Analysis — Each investor agent independently processes the data through their philosophical lens.
- Signal Generation — Each agent produces a buy/sell/hold signal with a confidence level and reasoning.
- Risk Assessment — The Risk Manager agent calculates position limits based on volatility and correlation.
- Portfolio Decision — The Portfolio Manager synthesizes all signals, weighing conviction levels and disagreements.
- Final Output — A comprehensive recommendation with per-agent breakdowns.
This is significant because it introduces structured disagreement into AI outputs. Instead of one model giving you one answer, you get 13+ perspectives — and the reasoning behind each one. The disagreements themselves are often the most informative signal.
# Run analysis on multiple stocks
poetry run python src/main.py --ticker AAPL,MSFT,NVDA
# Use local LLMs with Ollama (no API keys needed)
poetry run python src/main.py --ticker AAPL --ollama
# Backtest over a specific time period
poetry run python src/main.py --ticker NVDA --start-date 2024-01-01 --end-date 2024-06-01
The Backtesting Engine
One of the project's most powerful features is the built-in backtester. It runs the multi-agent system against historical data and measures how the AI team would have performed:
# Run backtesting
poetry run python src/backtester.py --ticker AAPL,MSFT,NVDA
# Backtest with local LLMs
poetry run python src/backtester.py --ticker TSLA --start-date 2023-01-01 --end-date 2024-01-01 --ollama
The backtester produces metrics like total return, Sharpe ratio, maximum drawdown, and a per-agent accuracy breakdown. This lets you evaluate not just the overall system but which "investment philosophies" perform best in different market conditions.
Real-World Example: Analyzing NVIDIA With AI Hedge Fund
Let's walk through what happens when you analyze NVDA with the full agent team:
Cathie Wood Agent sees NVIDIA's AI dominance and GPU monopoly. "This is the quintessential disruptive innovator. The data center revenue curve is exponential. Strong buy — this is a generational platform shift."
Michael Burry Agent looks at the same data differently. "The valuation assumes perfect execution for years. At 30x forward earnings with cyclical semiconductor exposure, the margin of safety is negative. This is a hold at best — possibly a short if the AI capex cycle peaks."
Warren Buffett Agent weighs in: "The competitive moat is real — CUDA lock-in is formidable. But I need to understand the durability of margins. The company has pricing power today, but AMD and custom silicon are coming. I'll hold and watch for the moat to widen or narrow."
Nassim Taleb Agent adds: "The tail risk is asymmetric. If AI adoption accelerates beyond current estimates, the upside is massive. If a black swan hits the supply chain (export controls, TSMC disruption), the downside is catastrophic. Position size should reflect this convexity."
The Portfolio Manager then synthesizes these conflicting views into a weighted recommendation, showing you exactly where agents agree and where they diverge — which is often the most actionable insight.
# How the multi-agent system is structured (simplified)
from langgraph.graph import StateGraph
# Each agent is a node in the graph
graph = StateGraph(HedgeFundState)
# Add investor agents
graph.add_node("warren_buffett", warren_buffett_agent)
graph.add_node("charlie_munger", charlie_munger_agent)
graph.add_node("cathie_wood", cathie_wood_agent)
graph.add_node("michael_burry", michael_burry_agent)
# ... 9 more investor agents
# Add analytical agents
graph.add_node("valuation", valuation_agent)
graph.add_node("sentiment", sentiment_agent)
graph.add_node("fundamentals", fundamentals_agent)
graph.add_node("technicals", technicals_agent)
graph.add_node("risk_manager", risk_manager)
# Portfolio manager synthesizes all signals
graph.add_node("portfolio_manager", portfolio_manager)
# Run agents in parallel, then converge
graph.add_edge(START, "warren_buffett")
graph.add_edge(START, "cathie_wood")
# ... parallel edges to all agents
graph.add_edge("warren_buffett", "portfolio_manager")
# ... all agents converge to portfolio manager
graph.add_edge("portfolio_manager", END)
Key Benefits of the Multi-Agent Hedge Fund Approach
- Diverse Perspectives — 13 different investment philosophies prevent groupthink and single-model blind spots.
- Transparent Reasoning — Every agent explains its decision, so you understand why a recommendation was made.
- Backtesting Built-In — Validate agent performance against historical data before trusting signals.
- Local LLM Support — Run entirely on your machine with Ollama — no API keys, no costs, full privacy.
- Educational Goldmine — Learn investment philosophies by watching AI agents apply them in real time.
- Extensible Architecture — Add your own agent with a custom investment philosophy using LangGraph.
- Web UI & CLI — Choose between a visual web interface or scriptable command-line tool.
- Multiple LLM Providers — Works with OpenAI, Anthropic, Groq, DeepSeek, or local Ollama models.
Getting Started in 5 Minutes
# 1. Clone the repository
git clone https://github.com/virattt/ai-hedge-fund.git
cd ai-hedge-fund
# 2. Set up your API keys
cp .env.example .env
# Edit .env with your OPENAI_API_KEY (or ANTHROPIC_API_KEY, GROQ_API_KEY, etc.)
# Also add your FINANCIAL_DATASETS_API_KEY for market data
# 3. Install dependencies with Poetry
curl -sSL https://install.python-poetry.org | python3 -
poetry install
# 4. Run your first analysis
poetry run python src/main.py --ticker AAPL
# 5. Or try the backtester
poetry run python src/backtester.py --ticker AAPL,MSFT,NVDA
For local-only operation with no API costs:
# Install Ollama and pull a model
ollama pull llama3
# Run with local LLMs
poetry run python src/main.py --ticker AAPL --ollama
What's Next: The Vision
The team is rebuilding AI Hedge Fund into a persistent, always-on system where investor agents become pluggable "alpha models" you can backtest, paper-trade, and optionally run live. The roadmap includes:
- Persistent Fund Entity — A fund that maintains state, positions, and P&L over time.
- Pluggable Alpha Models — Replace or extend investor agents with custom strategies.
- Paper Trading — Run the fund in simulation with real-time market data.
- Live Trading (Opt-in) — For those who want to put real capital behind the AI team.
Frequently Asked Questions
Is AI Hedge Fund real trading software?
No. The project is explicitly for educational and research purposes only. It does not execute real trades and should not be used for actual investment decisions. Always consult a financial advisor for investment advice.
Which LLM providers are supported?
AI Hedge Fund supports OpenAI (GPT-4o), Anthropic (Claude), Groq (Llama, Mixtral), DeepSeek, and local models via Ollama. You need at least one LLM API key configured, or you can use Ollama for fully local operation.
Can I add my own investor agent?
Yes. The architecture uses LangGraph, making it straightforward to add custom agents. You define the agent's investment philosophy as a system prompt, wire it into the graph, and it participates in the multi-agent debate alongside the built-in agents.
How accurate are the AI agents' predictions?
The backtester provides per-agent accuracy metrics over historical data. Results vary significantly by agent, time period, and market conditions. This is an educational tool — past backtest performance does not predict future results.
What financial data does it use?
The system uses the Financial Datasets API for fundamental data, technical indicators, and market sentiment. You'll need a Financial Datasets API key (free tier available) to provide the data that powers the agents' analysis.
Can I run AI Hedge Fund without any API keys?
You need at least an LLM provider key (OpenAI, Anthropic, Groq, or DeepSeek) OR a local Ollama installation. The financial data also requires a Financial Datasets API key. With Ollama + free financial data tier, you can run everything locally at zero cost.
How does the backtester work?
The backtester runs the multi-agent system against historical stock data for a specified date range. It simulates what decisions the AI team would have made at each point and tracks the hypothetical portfolio performance, including returns, drawdown, and per-agent accuracy.