Skip to content

AI Hedge Fund

Educational AI project that simulates a team of AI investor agents making trading decisions.

Stars
64.4k
Forks
11.3k
Licence
MIT
Language
Python
Last update
4 days ago
Type
AI model / agent

What it is

AI Hedge Fund is a proof-of-concept that uses AI agents, modeled on different investor styles, to explore how AI might make trading decisions. It is for educational purposes only and the README states the system does not actually make any trades. It includes an interactive terminal app with paper trading (simulated funds with a ledger) and backtesting against historical data.

  • Run the interactive app and build a simulated fund using chosen strategies, capital, and tickers
  • Backtest a fund over a historical period and compare its equity curve to a benchmark
  • Review saved session history and backtest results stored in your home directory
  • Study the source code and run its test suite with pytest

Great for

  • Students learning how AI agents can be applied to investment analysis
  • Developers who want a Python codebase to study multi-agent trading workflows
  • Researchers wanting to replay simulated funds over historical market data
  • Hobbyists comfortable with a terminal who want to experiment with paper trading

Not ideal for

  • Anyone expecting real investment returns or financial advice, since the README says it is not intended for real trading or investment
  • Users who need a no-code tool, because it runs from the terminal
  • Users without API keys for a market data provider and a supported AI model provider, since the app needs them to function
Step-by-step guide: how to use AI Hedge FundInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Python · pipx, uv, or pip

    Install with pipx

    pipx install aihf

    Run the app

    aihf
  2. 2

    Run it

    • Install the package with pipx, uv, or pip.
    • Run aihf from any terminal.
    • Enter your Financial Datasets API key and a model provider key when the app asks for them.
    • Create a paper-trading fund or start a backtest from the interactive menu.
  3. 3

    Get the most out of it

    • Export API keys in your shell if you want them to override the saved file in ~/.hedge-fund/.env
    • Use backtesting to replay a fund over history and compare it to its benchmark
    • Review the session history of paper-trading funds to see the track record
    • Set up a development environment with poetry install to modify and run the code

Downloads

Strengths

  • Clear educational framing and explicit disclaimers about its limits
  • Simple install via pipx, uv, or pip, with API keys requested on first use
  • Paper trading keeps a hash-chained ledger of each session

Trade-offs

  • Explicitly a proof of concept for education, not a validated trading system
  • Depends on third-party API keys for market data and AI models
  • README is brief on how the agents make decisions, so the internals are unclear from it alone

How it compares

ProjectStarsTypeLevelUpdatedBest for
ai-hedge-fund (this)64.4kAI model / agentintermediate4 days agoStudents learning how AI agents can be applied to investment analysis
FinRL17kLibraryintermediate11 days agoStudents learning how reinforcement learning is applied to financial markets
qlib49.9kLibraryadvanced7 days agoQuant researchers who want a structured ML workflow for stock data

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.