
AI Hedge Fund
CLIMulti-agent simulated hedge fund: agents modeled on investors like Buffett and Munger work with quant and risk modules to analyze stocks, with backtesting. Good for teaching investment frameworks. Needs Financial Datasets and model API keys; no real trading, not investment advice.
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.
Note: the system does not actually make any trades.
Disclaimer
This project is for educational and research purposes only.
- Not intended for real trading or investment
- No investment advice or guarantees provided
- Creator assumes no liability for financial losses
- Consult a financial advisor for investment decisions
- Past performance does not indicate future results
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:
- A Financial Datasets API key, for prices, fundamentals, and earnings.
- One model API key for the investor agents. Supported providers: Anthropic, OpenAI, DeepSeek, Google, xAI, Kimi, TypeSafe (Jev).
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. It has two modes:
- Paper trading — your funds, each with a ledger of real market days and fake money. Highlight a fund to see what its next run will do; press enter to run it through the next completed session (an approval step shows the exact decision about to execute before anything trades),
sfor its full session history,h/rfor the kill switch. Build a new fund from the same list: strategies, capital, cadence, tickers, and it is live. Every session is appended to a hash-chained ledger in~/.hedge-fund/paper/<name>/, so NAV is a track record, not a reset. - Backtesting — replay a fund over history and watch its equity curve draw against its benchmark. Results are saved to
~/.hedge-fund/research/. Fund definitions live in~/.hedge-fund/mandates/and carry no tickers; you pick the universe per backtest.
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
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- 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.
Ressources associées

TradingAgents
CLIMulti-agent investment research framework where fundamental, sentiment, news and technical analysts, bull and bear researchers, a trader and risk managers debate a stock and produce a report and rating. Covers US, Hong Kong and A-shares. Needs Python and an LLM API key; not investment advice.
TauricResearch/TradingAgents111k
Dexter
CLIFinancial research terminal agent, like Claude Code for finance: breaks company research questions into steps, pulls financial statements and market data, and self-checks before answering. Needs Bun, a model API key and a Financial Datasets API key; for learning and research only.
virattt/dexter27.7k
Longbridge Terminal
CLILongbridge's official CLI: real-time HK and US quotes, candles, options and warrants, news and filings, positions and cash, and order placement (previewed by default, executed only on confirmation). All commands output JSON for agents. Needs a Longbridge account and browser login.
longbridge/longbridge-terminal1k
FRED MCP Server
MCPConnects to the St. Louis Fed's FRED database: search and pull 800,000+ macroeconomic time series (GDP, unemployment, inflation, interest rates) with built-in year-over-year and period-over-period changes. For macro research, investing and teaching. Needs a free FRED API key and Node.js.
stefanoamorelli/fred-mcp-server125
Qlib
CLIMicrosoft's open-source AI quant investment research platform: the qrun command runs dataset building, model training, backtesting and evaluation from a YAML config, with many benchmark models. The official dataset is paused, so prepare market data per the README first.
microsoft/qlib49.4k
Vibe-Trading
MCPTrading research agent from HKU's HKUDS whose MCP server offers 70+ tools for quotes, financials, backtesting and research across A-shares, Hong Kong and US stocks and crypto. Needs local Python; HK, US and crypto research need no API key. For research only; not investment advice.
HKUDS/Vibe-Trading35.6k