AI Hedge Fund is a proof of concept that explores how language-model agents can make trading decisions. It exists for educational and research use only: the system never places trades, gives no investment advice, and offers no performance guarantees.
You run it as a terminal application. In interactive mode you build a fund by picking stocks, strategies, and a rebalance cadence, then backtest a saved fund and watch its equity curve plotted against a benchmark. Funds are saved as mandate files: a mandate describes the desk (strategies, staff, risk, capital, and cadence) without naming tickers, and you supply the tickers for each run.
Market data comes from the Financial Datasets API (prices, fundamentals, and earnings), and the investor-style alpha models run on an LLM from Anthropic, OpenAI, DeepSeek, Google, xAI, or Kimi. The project is being rebuilt around a persistent, always-on fund entity that you can backtest, paper-trade, and optionally run live, with the investor agents reworked as pluggable, backtestable alpha models.
Features
- Interactive fund builder: choose stocks, strategies, and rebalance cadence from a terminal UI and save the result as a mandate file
- Backtesting: replay a mandate over history at its rebalance cadence and compare the equity curve with a benchmark
- Non-interactive runs: execute one fund cycle from a mandate file, with the full cycle record printed as JSON on stdout and a short summary on stderr
- Mandate model: the mandate defines the desk while --tickers selects what it trades on a given run
- LLM-driven alpha models: investor-agent signals generated by a model from Anthropic, OpenAI, DeepSeek, Google, xAI, or Kimi
- Market data: prices, fundamentals, and earnings pulled from the Financial Datasets API
- Key handling: API keys are requested on first use and stored in ~/.hedge-fund/.env, with shell-exported keys taking precedence
