How tiangehuang/tradingagents works
TradingAgents is a multi-agent financial research and decision-support framework, exposed through a CLI or Python API. A user supplies an asset and date; the graph gathers market, fundamental, news, and sentiment evidence, coordinates analyst reports and bull/bear research, then produces a trader proposal and portfolio decision. Provider clients and dataflows connect the analysis to configurable LLMs and financial data sources. The README documents simulated order execution, while sampled code shows decision synthesis rather than an execution adapter. Graph wiring beyond the sampled entry points is represented only where documented.
Main entry points: trading_graph.py Trading graph · main.py Interactive CLI · analysts Analyst team · analyst_execution.py Analyst execution
Components 22
User entry
- Interactive CLI
cli/main.py - Python entry
tradingagents/graph/trading_graph.py - Decision reports
tradingagents/reporting.py
Analysis orchestration
- Trading graph
tradingagents/graph/trading_graph.py - Graph setup
tradingagents/graph/setup.py - Analyst team
tradingagents/agents/analysts - Analyst execution
tradingagents/graph/analyst_execution.py
Research and decisions
- Bull-bear debate
tradingagents/agents/researchers - Research manager
tradingagents/agents/managers/research_manager.py - Trader proposal
tradingagents/agents/trader/trader.py - Risk debate
tradingagents/agents/risk_mgmt - Portfolio decision
tradingagents/agents/managers/portfolio_manager.py
Data access
- Agent data tools
tradingagents/agents/utils - Provider dataflows
tradingagents/dataflows
Model and state
- LLM factory
tradingagents/llm_clients/factory.py - Provider clients
tradingagents/llm_clients - Graph checkpoint
tradingagents/graph/checkpointer.py - Decision memory
tradingagents/agents/utils/memory.py - Decision reflection
tradingagents/graph/reflection.py
Other components
- Research user
- Market data services
- LLM providers
Connections 23
- Research user → Interactive CLI: configures run
- Research user → Python entry: submits analysis
- Interactive CLI → Trading graph: runs analysis
- Python entry → Trading graph: propagates input
- Trading graph → Graph setup: builds workflow
- Trading graph → Analyst execution: dispatches stages
- Analyst execution → Analyst team: runs analysts
- Analyst team → Agent data tools: requests evidence
- Agent data tools → Provider dataflows: fetches data
- Provider dataflows → Market data services: queries providers
- Analyst team → Bull-bear debate: provides reports
- Bull-bear debate → Research manager: debate history
- Research manager → Trader proposal: investment plan
- Trader proposal → Risk debate: trade proposal
- Risk debate → Portfolio decision: risk assessment
- Trading graph → LLM factory: selects model
- LLM factory → Provider clients: creates client
- Provider clients → LLM providers: invokes model
- Trading graph → Graph checkpoint: saves workflow state
- Trading graph → Decision memory: uses prior context
- Decision reflection → Decision memory: records lessons
- Interactive CLI → Decision reports: renders decision
- Portfolio decision → Decision reports: supplies decision