ai-hedge-fund README

The project's README from github.com/virattt/ai-hedge-fund. As one markdown file: README.md.

AI Hedge Fund

This is a proof of concept for an AI-powered hedge fund. The goal of this project is to explore the use of AI to make trading decisions. This project is for educational purposes only and is not intended for real trading or investment.

🚧 The project is evolving. We're rebuilding it into a persistent, always-on AI hedge fund — a fund as a first-class entity you can backtest, paper-trade, and (opt-in) run live, with the investor agents reimagined as pluggable, backtestable "alpha models." Read the Vision → and the Roadmap →.

Note: the system does not actually make any trades.

Twitter Follow

Disclaimer

This project is for educational and research purposes only.

By using this software, you agree to use it solely for learning purposes.

How to Install

pipx install aihf

(or uv tool install aihf, or pip install aihf into an environment of your choice)

Then run it from anywhere:

aihf

API keys

The app asks for keys the first time it needs them and saves them to ~/.hedge-fund/.env — nothing to configure up front. It needs:

Keys exported in your shell always win over the saved file.

How to Run

Interactive app

aihf

With no arguments, this launches the interactive terminal app. Build a fund — pick stocks, strategies, rebalance cadence — or backtest a saved fund and watch its equity curve draw against its benchmark. Funds you build are saved as mandate files in ~/.hedge-fund/mandates/.

Non-interactive

Run one fund cycle from a mandate file. The full cycle record prints to stdout as JSON; a short human summary goes to stderr:

aihf ~/.hedge-fund/mandates/example.yaml --tickers AAPL,MSFT

Backtest the mandate over history at its rebalance cadence:

aihf ~/.hedge-fund/mandates/example.yaml --tickers AAPL,MSFT --backtest

A mandate is the desk — strategies, staff, risk, capital, cadence — and never names tickers; --tickers says what to point it at for this run.

Development

git clone https://github.com/virattt/ai-hedge-fund.git
cd ai-hedge-fund
poetry install
poetry run aihf
poetry run pytest hedge_fund

How to Contribute

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Important: Please keep your pull requests small and focused. This will make it easier to review and merge.

Feature Requests

If you have a feature request, please open an issue and make sure it is tagged with enhancement.

License

This project is licensed under the MIT License - see the LICENSE file for details.

ai-hedge-fund (virattt/ai-hedge-fund)

Searching Database…

What is this?An AI-powered hedge fund proof of concept that uses AI (LLM-driven 'alpha models') to make simulated trading decisions. It's explicitly for educational and research purposes, not real trading or investment.
Is this a trading bot or a terminal app I run myself?It's a Python command-line tool you install and run locally. With no arguments it launches an interactive terminal app for building and backtesting a fund.
How do I install and run it?Install with 'uv tool install aihf' or 'pip install aihf' into your environment, then run it from anywhere; the default run opens the interactive terminal app.
What API keys do I need?A Financial Datasets API key for prices, fundamentals, and earnings, plus one LLM key from Anthropic, OpenAI, DeepSeek, Google, xAI, or Kimi to power the alpha models. The app asks for them on first use and saves them to ~/.hedge-fund/.env.
Does it ever execute real trades?No, the system never places real orders — it only simulates and backtests decisions, and the project disclaims any use for real investing.
What is a 'mandate' in this project?A mandate is a saved fund definition — its strategies, staff, risk settings, capital, and rebalance cadence — stored as a file in ~/.hedge-fund/mandates/. It never hardcodes tickers; you pass --tickers at run time to point it at specific stocks.
What's next for the project?The team is rebuilding it into a persistent, always-on AI hedge fund where the investor agents become pluggable, backtestable 'alpha models' that can be backtested, paper-traded, and optionally run live.
Can I run a single fund cycle without the interactive UI?Yes, non-interactively you can run one fund cycle from a mandate file; the full cycle record prints to stdout as JSON while a short human-readable summary goes to stderr.
Creator
virattt
Size
4.1 MB
Stars
64K
Age
1y
Commits · 90 Days