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.
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.
- ✓ 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.)
pip install tradingagentsgit clone https://github.com/TauricResearch/TradingAgents cd
TradingAgents pip install -e .
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)
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.
# .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