How jaspalkahlon/tradingagents works
TradingAgents is a multi-agent financial research and decision framework. A user starts an analysis from the CLI; the run builds and executes a trading graph, which coordinates parallel analysts, research and risk debate, and a portfolio decision. Dataflows route market, company, news, and optional macro or prediction-market requests to vendors; provider clients supply LLMs. The framework also supports backtests, checkpoint resume, decision memory, and reports. Several links reflect README-documented behavior; unsampled implementation details are not inferred as direct calls.
Main entry points: trading_graph.py Trading graph · router.py Data router · run.py Run interface · analysts Analyst team
Components 20
Run interface
- CLI
cli/main.py - Run interface
cli/run.py
Analysis workflow
- Trading graph
tradingagents/graph/trading_graph.py - Analyst team
tradingagents/agents/analysts - Research debate
tradingagents/agents/researchers - Risk debate
tradingagents/agents/risk_mgmt - Trader
tradingagents/agents/trader/trader.py - Portfolio decision
tradingagents/agents/managers/portfolio_manager.py
Data access
- Data router
tradingagents/dataflows/router.py - Market and fundamentals
tradingagents/dataflows/vendors/yahoo/market.py - Yahoo fundamentals
tradingagents/dataflows/vendors/yahoo/fundamentals.py - Other data vendors
tradingagents/dataflows/vendors
Model access
- LLM providers
tradingagents/llm_clients - Run configuration
tradingagents/default_config.py
Results and history
- Backtesting
tradingagents/backtest.py - Decision memory
tradingagents/memory/log.py - Outcome settlement
tradingagents/memory/settlement.py - Reports
tradingagents/reporting.py - Checkpoints
tradingagents/graph/checkpointer.py
Other components
- Analyst user
Connections 19
- Analyst user → CLI: starts run
cli/main.py - CLI → Run interface: invokes
cli/main.py - Run interface → Trading graph: runs analysis
- Trading graph → Analyst team: coordinates
- Analyst team → Research debate: reports inform
- Research debate → Trader: informs decision
- Trader → Risk debate: enters debate
- Risk debate → Portfolio decision: informs decision
tradingagents/agents/managers/portfolio_manager.py - Data router → Market and fundamentals: dispatches calls
tradingagents/dataflows/router.py - Data router → Yahoo fundamentals: dispatches calls
tradingagents/dataflows/router.py - Data router → Other data vendors: dispatches calls
tradingagents/dataflows/router.py - Analyst team → Data router: requests data
- Trading graph → LLM providers: uses providers
tradingagents/graph/trading_graph.py - Run configuration → LLM providers: configures models
tradingagents/llm_clients/chatgpt_auth.py - Run interface → Backtesting: offers backtest
cli/main.py - Trading graph → Decision memory: stores decisions
tradingagents/graph/trading_graph.py - Trading graph → Outcome settlement: settles outcomes
tradingagents/graph/trading_graph.py - Trading graph → Reports: creates reports
tradingagents/graph/trading_graph.py - Trading graph → Checkpoints: resumes runs
tradingagents/graph/trading_graph.py