TauricResearch / TradingAgents

TradingAgents

Multi-Agent LLM Trading Framework — 7 specialized agents collaborating like a real trading firm

GitHub Stars
45.6K
Agents
7
Forks
8.3K
License
MIT
What is TradingAgents?

TradingAgents is a multi-agent framework that mirrors the structure of a real-world trading firm. Seven specialized LLM-powered agents each own a distinct domain — fundamentals, sentiment, news, technical analysis, research, execution, and risk — and collaborate in a structured pipeline to evaluate market conditions and inform trading decisions.

Built on LangGraph and Python, the framework is provider-agnostic: you can plug in OpenAI, Anthropic, Google Gemini, xAI Grok, OpenRouter, or local Ollama models at each agent node.

Multi-Agent LLM Trading Python LangGraph Financial AI
Quick Verdict
Best suited for crypto and equity alpha research workflows. Python-native with multi-provider LLM support — swap models per agent node without touching core logic. Not a live trading bot; outputs are decision-support signals, not automated order execution.
◈
TradingAgents is a research framework, not a live brokerage integration. Always backtest and paper-trade before deploying signals in a live environment.
Agent Role Data Source Output
Fundamentals Analyst Evaluate financial health & valuation metrics SEC filings, earnings, balance sheets Fundamental score + commentary
Sentiment Analyst Gauge market mood and social signals Reddit, Twitter/X, StockTwits, news sentiment Sentiment polarity + crowd signal
News Analyst Summarize and weight recent news events Financial news APIs, press releases News impact summary + risk flags
Technical Analyst Interpret price action and technical patterns OHLCV price/volume data, indicators Technical bias + entry/exit levels
Researcher Synthesize all analyst outputs into a thesis Outputs of all 4 analyst agents Investment thesis + conviction level
Trader Propose a trade action based on the thesis Researcher thesis + market context Trade recommendation (buy/sell/hold)
Risk Manager Evaluate and gate the trade for risk exposure Trader recommendation + portfolio state Approved / rejected decision + rationale
Pipeline Architecture Flow
Fundamentals Analyst + Sentiment Analyst + News Analyst + Technical Analyst → Researcher → Trader → Risk Manager → Fund Manager

The four analyst agents run in parallel. Their outputs converge at the Researcher, which synthesizes a thesis that flows downstream through Trader → Risk Manager → Fund Manager.

Requirements
  • ✓ Python 3.10 or newer
  • ✓ pip (standard Python package manager)
  • ✓ API key for at least one supported LLM provider
  • ✓ Optional: financial data API key (Alpha Vantage, Yahoo Finance, etc.)
Install
Option A — pip
pip install tradingagents
Option B — clone from source
git clone https://github.com/TauricResearch/TradingAgents cd TradingAgents pip install -e .
Quick Start
from tradingagents.graph.trading_graph import TradingAgentsGraph from tradingagents.default_config import DEFAULT_CONFIG # Configure your LLM provider config = DEFAULT_CONFIG.copy() config["llm_provider"] = "openai" config["deep_think_llm"] = "gpt-4o" config["quick_think_llm"] = "gpt-4o-mini" config["max_debate_rounds"] = 2 # Initialize and run ta = TradingAgentsGraph(debug=True, config=config) state, decision = ta.propagate("NVDA", "2024-11-15") print(decision)
Supported LLM Providers
Provider Config Key Notes
OpenAI openai GPT-4o, GPT-4o-mini recommended
Google Gemini google Gemini 1.5 Pro / Flash
Anthropic anthropic Claude 3.5 Sonnet / Haiku
xAI xai Grok-beta
OpenRouter openrouter Access 100+ models via one key
Ollama ollama Local inference, no API key needed
System Diagram
Analysts Team
Fundamentals
SEC · Earnings
Sentiment
Reddit · X
News
Financial APIs
Technical
OHLCV · Indicators
▼
Researcher
Synthesizes bull & bear thesis
▼
Trader
Trade recommendation
▼
Risk Manager
Approve · Reject · Resize
▼
Fund Manager
Final portfolio decision
Multi-Provider LLM Chain

Each agent node in the LangGraph pipeline can be configured independently. You can run cheap/fast models (e.g., GPT-4o-mini, Gemini Flash, Claude Haiku) on the analyst ingestion nodes and reserve expensive reasoning models for the Researcher, Trader, and Risk Manager decision nodes.

Quick LLM → Analysts · Deep LLM → Researcher / Trader / Risk
⚠
Designed primarily for equities and macroeconomic analysis. Crypto assets require prompt-level tuning — on-chain signals and tokenomics context are not included by default.
Provider × Model Matrix
Provider Recommended Models Notes
OpenAI gpt-4o / gpt-4o-mini Best default choice; strong tool-use and reasoning
Google Gemini gemini-1.5-pro / gemini-flash Large context window; Flash is cost-efficient for analysts
Anthropic claude-3-5-sonnet / claude-haiku Excellent for nuanced risk and sentiment reasoning
xAI grok-beta Real-time X/Twitter data affinity; strong news analyst
OpenRouter Any model in the catalog Mix models across providers via one unified API key
Ollama llama3 / mistral / qwen2 Fully local, no cost per call — lower reasoning ceiling
⚠
Cost heads-up: Running the full 7-agent pipeline on a single ticker = multiple LLM calls per query. On GPT-4o across all nodes, a single run can cost $0.05–$0.30+. Budget accordingly — use fast/cheap models on analyst nodes and reserve deep models for decision nodes.
Provider Config Example
# .env or config dict OPENAI_API_KEY=sk-... ANTHROPIC_API_KEY=sk-ant-... GOOGLE_API_KEY=... XAI_API_KEY=... OPENROUTER_API_KEY=... # In config dict config["llm_provider"] = "openai" # primary provider config["deep_think_llm"] = "gpt-4o" # Researcher / Trader / Risk config["quick_think_llm"] = "gpt-4o-mini" # all 4 Analyst nodes