Best GitHub Repos for Building AI Trading Agents
The open-source projects worth your time if you want to build, backtest, and run trading agents — curated and sanity-checked from a trader's seat.
LLM & multi-agent frameworks
Start here if you want agents that reason — reading news, fundamentals and price action and arguing their way to a decision.
TradingAgents
Multi-agent LLM · PythonA full "trading firm" built from LLM agents — fundamental, sentiment, news and technical analysts plus trader and risk-management roles that debate to a decision. The best reference for how multi-agent trading architectures fit together.
ai-hedge-fund
Multi-agent LLM · PythonAgents modeled on famous investors that collaborate to evaluate stocks and produce recommendations — explicitly educational, and it does not place real trades. The most approachable codebase for seeing multi-agent reasoning end to end.
FinRobot
LLM agent platform · PythonAn AI4Finance agent platform aimed at financial analysis and automated equity-research reports. Useful if your "agent" is more analyst than trader — generating research rather than firing orders.
FinGPT
Open financial LLMs · PythonOpen financial large language models and fine-tuning recipes — the model layer many finance agents sit on top of, especially for sentiment and news understanding.
Reinforcement-learning agents
For agents that learn a policy from market data rather than follow hand-written rules.
FinRL
Deep RL · PythonThe first widely-used framework for financial reinforcement learning — a "train → backtest → trade" pipeline with ready-made market environments and DRL agents. The standard starting point for the RL approach, with a live-trading layer (FinRL-Trading / FinRL-X) that adds Alpaca broker integration.
Backtesting frameworks
An agent is only as trustworthy as its backtest. Test the strategy here before you let an agent trade it.
NautilusTrader
Event-driven platform · Python/RustA production-grade platform with a Rust core, built to reproduce real execution faithfully — and the same strategy code runs in backtest and live. The serious choice when you intend to actually deploy.
vectorbt
Vectorized research · PythonBlazingly fast, vectorized backtesting — sweep thousands of parameter combinations in seconds. Ideal for research and hypothesis testing before you commit a strategy to an agent.
Backtesting.py
Lightweight · PythonThe simplest way to get a first backtest running. Small API, clean charts — perfect for learning and quick one-off tests of a strategy idea.
Zipline-reloaded
Factor research · PythonThe community-maintained continuation of Quantopian's Zipline — a clean pipeline that separates data, strategy and risk, with tear-sheet analytics. Strong for factor-based research.
QuantConnect / LEAN
Multi-asset engine · C#/PythonAn institutional-grade, open-source engine behind the QuantConnect platform — multi-asset, with a huge data ecosystem and cloud or local execution. The most "batteries-included" option.
Backtrader
Event-driven classic · PythonFor years the go-to event-driven backtester, with excellent docs and a gentle learning curve. Honest note: active development largely stalled around 2021 — it still works well, but don't expect new features.
How these fit together — a build path
- Read an agent codebase to learn the pattern — start with ai-hedge-fund, then TradingAgents for the full multi-agent picture.
- Pin down a strategy and backtest it honestly with vectorbt or Backtesting.py before any agent touches it. (Our strategy guides each show how to wire the rules into an agent.)
- Choose your agent style — rules-plus-LLM (TradingAgents) or learned policy (FinRL).
- Paper-trade through a broker API before risking real money — walk through it in Build Your First AI Trading Agent.
This page is for educational purposes only and is not financial advice. Open-source software is provided "as is" — review the licence and code before use. Automated trading carries substantial risk; backtest and paper-trade thoroughly before risking real capital.