How sanmarcsoft/tradingagents works
TradingAgents is a multi-agent financial research and decision framework. Its principal workflow gathers market, company, news, and sentiment evidence; produces analyst reports; debates bullish and bearish cases; then forms a trade proposal, evaluates risk, and reaches a portfolio decision. The CLI and package entry point initiate analysis through the trading graph. README-described features are included where the tree supports a subsystem path; unsampled wiring is omitted where it cannot be established from the excerpts.
Main entry points: setup.py Graph Setup · trading_graph.py Trading Graph · main.py Interactive CLI · analyst_execution.py Analyst Execution
Components 22
User Entry
- Interactive CLI
cli/main.py - Package Entry
main.py
Workflow Graph
- Trading Graph
tradingagents/graph/trading_graph.py - Graph Setup
tradingagents/graph/setup.py - Analyst Execution
tradingagents/graph/analyst_execution.py
Analysis and Debate
- Analyst Team
tradingagents/agents/analysts - Bull/Bear Debate
tradingagents/agents/researchers - Research Manager
tradingagents/agents/managers/research_manager.py - Trader
tradingagents/agents/trader/trader.py - Risk Debate
tradingagents/agents/risk_mgmt - Portfolio Manager
tradingagents/agents/managers/portfolio_manager.py
Data and Models
- Research Tools
tradingagents/agents/utils - Data Providers
tradingagents/dataflows - LLM Factory
tradingagents/llm_clients/factory.py - LLM Clients
tradingagents/llm_clients
Decision and State
- Final Decision
- Decision Memory
tradingagents/agents/utils/memory.py - Graph Checkpoint
tradingagents/graph/checkpointer.py - Report Rendering
tradingagents/reporting.py
Other components
- Researcher
- Market Data APIs
- LLM Services
Connections 23
- Researcher → Interactive CLI: configures run
- Interactive CLI → Trading Graph: starts analysis
- Package Entry → Trading Graph: starts analysis
- Trading Graph → Graph Setup: builds workflow
- Graph Setup → Analyst Execution: dispatches analysts
- Analyst Execution → Analyst Team: invokes
- Analyst Team → Research Tools: requests evidence
- Research Tools → Data Providers: fetches data
- Data Providers → Market Data APIs: queries providers
- Graph Setup → Bull/Bear Debate: dispatches debate
- Graph Setup → Research Manager: dispatches synthesis
- Graph Setup → Trader: dispatches proposal
- Graph Setup → Risk Debate: dispatches risk debate
- Graph Setup → Portfolio Manager: dispatches decision
- Research Manager → Bull/Bear Debate: uses debate state
- Portfolio Manager → Final Decision: produces decision
- Trading Graph → LLM Factory: creates models
- LLM Factory → LLM Clients: selects client
- LLM Clients → LLM Services: invokes model
- Trading Graph → Decision Memory: uses prior decisions
- Trading Graph → Graph Checkpoint: persists graph state
- Interactive CLI → Report Rendering: renders results
- Trading Graph → Final Decision: returns result