TradingAgents 如何協作研究股票並辯論投資決策
I Built an AI Team That Researches Stocks and Debates Investment Decisions 🤖
作者實測開源多智能體框架 TradingAgents,讓多個 AI 智能體分析 NVIDIA(NVDA)並辯論投資決策,最終投資組合經理給出 UNDERWEIGHT 建議。TradingAgents 由 Tauric Research 開發,設有市場、基本面、新聞和情緒分析員,並經看漲與看跌研究員辯論及風險評估後形成建議。作者指出,這次結果只反映該次模型研究與設定,不能證明建議具預測準確度。
What if you had an entire team of AI agents researching stocks for you?
Imagine one agent analyzing stock charts, another digging through financial reports, and another tracking the latest market news.
Now imagine two more AI agents arguing about whether you should buy or avoid a particular stock.
And instead of simply combining their opinions, the system makes them challenge each other’s conclusions before arriving at a final investment recommendation.
Sounds like something a hedge fund might build, right?
Well, there’s an open-source project that does exactly this.
It’s called TradingAgents, developed by I Built an AI Team That Researches Stocks and Debates Investment Decisions 🤖
, and it uses a multi-agent AI architecture to simulate how a financial research team collaborates.
I recently explored this project, studied its architecture, set it up, and put the agents to work analyzing one of the most talked-about companies in the stock market: NVIDIA (NVDA).
The result was interesting, but what fascinated me even more was how the agents worked together.
In this article, I’ll explain how TradingAgents works, walk through its architecture, show you how to get started, and share what happened during my experiment.
🎥 Full video walkthrough
💡 Why Use Multiple AI Agents for Stock Research?
If you’ve ever researched a stock before investing, you know how overwhelming the process can become.
You need to understand several things:
- Financial performance: Revenue, earnings, profitability, and cash flow.
- Valuation: Whether the stock is reasonably priced relative to its growth expectations.
- Technical indicators: Price movements, moving averages, RSI, and MACD.
- Market news: Earnings announcements, industry developments, and economic events.
- Investor sentiment: How the broader market perceives the company.
- Risk factors: Everything that could potentially go wrong.
And here’s something investors sometimes overlook:
A great company isn’t necessarily a great stock to buy at any price.
A business might be growing rapidly and dominating its industry, but if its stock price already reflects unrealistic growth expectations, investing could still be risky.
Now, you could ask ChatGPT or another LLM:
“Should I buy NVIDIA stock?”
But a single AI response might overlook important factors or lean too heavily toward one interpretation.
What if we approached this differently?
Instead of asking one AI model to handle everything, we could assign different research responsibilities to specialized AI agents.
One focuses on financial fundamentals. Another analyzes technical indicators. Another investigates risks.
Then we make them collaborate, debate, and challenge each other’s conclusions.
That’s the fundamental idea behind TradingAgents.
🏗️ What Is TradingAgents?
TradingAgents is an open-source multi-agent framework developed by Tauric Research.
It’s designed to simulate the collaborative decision-making process of a financial research and trading organization.
Rather than relying on a single LLM prompt, TradingAgents coordinates multiple specialized agents through a structured workflow.
The system includes:
- Financial research analysts
- Bullish and bearish researchers
- A research manager
- A trader agent
- Risk management agents
- A portfolio manager
Each agent has a specific responsibility, and information flows between them as the research progresses.
The interesting part is that the agents don’t simply generate independent reports.
They share findings, debate competing investment theses, evaluate risk, and eventually produce a consolidated recommendation.
Let’s understand how this works.
🔍 Step 1: Four AI Analysts Research the Stock
The workflow begins with four specialized research agents.
Each examines the company from a different perspective.
📊 1. Market Analyst
The Market Analyst focuses on technical analysis.
It examines information such as:
- Historical stock prices
- Moving averages
- Relative Strength Index (RSI)
- Moving Average Convergence Divergence (MACD)
- Recent price trends
For example, the RSI can help identify whether a stock has experienced unusually strong buying or selling momentum.
The analyst uses available technical indicators to understand what’s happening with the stock’s price behavior.
💰 2. Fundamental Analyst
The Fundamental Analyst investigates the underlying business.
It examines financial information such as revenue, earnings, profitability, and other available company data.
Its goal is to answer questions like:
Is this company financially strong?
What do its fundamentals suggest about its business performance?
Are there financial weaknesses investors should consider?
For a company like NVIDIA, this analysis might involve examining revenue growth, margins, profitability, and the sustainability of demand for its products.
📰 3. News Analyst
Financial performance alone doesn’t tell the entire story.
A company’s outlook can change significantly because of new developments.
The News Analyst investigates relevant information such as:
- Company announcements
- Earnings-related developments
- Industry news
- Economic events
- Broader market developments
For example, changes in semiconductor export restrictions or major AI infrastructure spending announcements could influence how investors evaluate NVIDIA.
🗣️ 4. Sentiment Analyst
The Sentiment Analyst examines available public discussions and sentiment-related information.
Its goal is to understand how investors and the broader market are discussing the company.
This can provide useful context about market expectations, enthusiasm, and concerns.
However, sentiment isn’t necessarily an indicator of whether a stock is fundamentally undervalued or overvalued.
It’s simply another perspective.
Why This Architecture Matters
The four analysts can gather information in parallel.
Rather than forcing a single AI agent to perform every research task, the system distributes responsibilities across specialized agents.
Their findings become the foundation for the next stage.
And this is where things get particularly interesting.
🐂 Step 2: Bull vs. Bear — AI Agents Debate the Investment
Once the analysts complete their research, their findings are passed to two additional agents.
The Bull Researcher and the Bear Researcher.
These agents have opposing responsibilities.
The Bull Researcher
The Bull Researcher builds the strongest possible argument for investing in the company.
For example, a bullish NVIDIA investment thesis might emphasize:
- Strong demand for AI computing infrastructure
- Revenue and earnings growth
- Competitive advantages
- Market leadership
- Long-term industry opportunities
The Bear Researcher
The Bear Researcher takes the opposite position.
Its responsibility is to challenge the bullish argument and identify potential weaknesses.
For example:
- Is the stock valuation too expensive?
- Are growth expectations unrealistic?
- Could competition increase?
- Are there regulatory or geopolitical risks?
- What happens if AI infrastructure spending slows?
But here’s the interesting part.
These agents actually debate each other.
The Bull presents an argument.
The Bear challenges it.
The Bull gets an opportunity to respond.
And the discussion can continue through multiple configurable rounds.
Instead of simply asking an LLM to list pros and cons, TradingAgents creates a structured exchange between competing investment perspectives.
After the debate, a Research Manager evaluates the arguments and produces an investment plan.
This approach doesn’t guarantee better investment decisions, but it provides a mechanism for examining competing interpretations before reaching a conclusion.
⚖️ Step 3: The Trader and Risk Management Agents
After the Research Manager produces an investment plan, the workflow moves to the Trader Agent.
Despite its name, the Trader Agent in my demonstration wasn’t executing any actual trades.
Instead, it translated the research into a more concrete investment proposal.
That proposal then went through another review process.
This time, three risk-focused agents evaluated it.
Aggressive Risk Analyst
Examines the investment proposal from a perspective that accepts greater risk in pursuit of potential returns.
Conservative Risk Analyst
Focuses on downside protection, uncertainty, and reasons to avoid excessive exposure.
Neutral Risk Analyst
Attempts to balance potential opportunities against the associated risks.
These perspectives are used to challenge the investment proposal.
Finally, the Portfolio Manager evaluates the research, proposed action, and risk discussion to produce the final recommendation.
So the overall workflow looks something like this:
STOCK / COMPANY
|
v
RESEARCH ANALYSTS
|
+------------+------------+
| | |
Market Fundamental News
Analyst Analyst Analyst
| | |
+------------+------------+
|
Sentiment Analyst
|
v
RESEARCH DEBATE
|
+------+------+
| |
Bull Agent Bear Agent
| |
+------+------+
|
v
Research Manager
|
v
Trader Agent
|
v
RISK ANALYSIS
|
+----------+----------+
| | |
Aggressive Conservative Neutral
| | |
+----------+----------+
|
v
Portfolio Manager
|
v
FINAL RECOMMENDATION
Simplified conceptual representation of the TradingAgents workflow. The analyst stage is designed to support parallel research.
This is what makes TradingAgents an interesting example of agentic AI and multi-agent orchestration.
It’s not just multiple LLM calls.
It’s a structured workflow in which different agents contribute information, challenge conclusions, and participate in a decision-making process.
🛠️ Step 4: Installing and Setting Up TradingAgents
Now that we understand the architecture, let’s look at how to run it.
TradingAgents is open source, so you can inspect the implementation, modify the agents, and experiment with different configurations.
1. Clone the GitHub Repository
Start by cloning the project:
git clone https://github.com/TauricResearch/TradingAgents.git
cd TradingAgents
Open the project in your preferred code editor.
I used VS Code for my demonstration.
2. Create a Python Virtual Environment
I used Python 3.13 and uv for environment management.
Create a virtual environment:
uv venv --python 3.13
Activate it on macOS or Linux:
source .venv/bin/activate
This keeps the project’s Python dependencies separate from other applications installed on your machine.
3. Install the Dependencies
Install the project using the dependency instructions provided in the repository.
For example, when installing from the project directory with uv:
uv pip install -e .
The exact installation steps may change between releases, so check the repository’s latest README before proceeding.
4. Configure Your AI Model Provider
TradingAgents supports configurable AI model providers.
Depending on the version and configuration, you can use supported providers such as OpenAI, Google, or Anthropic.
The repository includes an example environment configuration file.
You can copy it:
cp .env.example .env
Then configure the credentials required by your selected provider.
In my demonstration, I used the framework’s supported ChatGPT subscription authentication flow rather than manually configuring an API key.
For versions supporting this option, the login command is:
tradingagents login chatgpt
Follow the authentication instructions displayed in your terminal.
Note: Subscription-based authentication depends on the installed TradingAgents version and its supported integration. A ChatGPT subscription is not generally interchangeable with OpenAI API credits.
5. Launch TradingAgents
Once everything is configured, launch the CLI:
tradingagents
The interface guides you through several configuration options.
You can select:
- The stock ticker
- Analysis date
- Output language
- Research analysts
- Research depth
- AI model provider
- LLM models
- Reasoning effort
For my experiment, I selected NVIDIA (NVDA) and enabled all four research analysts.
I also chose the shallow research configuration to keep the demonstration relatively quick.
Research depth affects how many debate and discussion rounds the agents perform.
Once configured, the agents begin researching the company.
🚀 Step 5: I Asked the AI Team to Analyze NVIDIA
With everything running, I gave the system NVIDIA as the company to investigate.
The workflow started with the research analysts gathering information.
The Market Analyst examined technical indicators.
The Fundamental Analyst investigated the company’s financial position.
Meanwhile, the News and Sentiment Analysts collected information from their available data sources.
Once the initial research was complete, the system moved through the debate and risk evaluation stages.
Eventually, TradingAgents generated a detailed report containing the findings from the different agents.
The report included technical analysis, financial research, sentiment observations, news analysis, and the final investment thesis.
So, What Did the AI Agents Recommend?
After completing the analysis, the Portfolio Manager produced its final recommendation:
UNDERWEIGHT.
In portfolio terminology, an underweight position generally means maintaining less exposure to an asset than a relevant benchmark or reference allocation.
But I wouldn’t interpret this result as proof that NVIDIA is a bad investment.
The recommendation reflects the model-generated research, available information, and configuration used during this particular run.
I haven’t established whether this recommendation would outperform a benchmark or lead to better investment outcomes.
And that’s an important distinction.
Generating a convincing investment thesis is not the same as demonstrating predictive accuracy.
What I found useful was the structured research process.
Instead of receiving a short answer from a chatbot, I could examine the different research perspectives that contributed to the final decision.
That makes TradingAgents particularly interesting as an investment research assistant.
🧠 TradingAgents Also Has a Memory System
Another feature worth exploring is the framework’s built-in memory and historical evaluation capabilities.
After completing an analysis, TradingAgents can save information about the research decision in a local journal.
This can include:
- Stock ticker
- Analysis date
- Generated recommendation
- Evaluation status
Initially, the outcome is marked as pending.
That makes sense because the system doesn’t know what will happen to the stock after the recommendation.
Once sufficient trading sessions have passed, the framework can evaluate the stock’s subsequent performance against a benchmark.
In the configuration I explored, the default evaluation window was five trading days.
Based on the evaluation, an AI model can generate a reflection about the previous research.
For example:
What did the analysis get right?
What risks did it overlook?
Which assumptions turned out to be incorrect?
What lessons might be useful for future research?
Those reflections can then be retrieved as context for subsequent analyses.
This creates a basic feedback mechanism.
However, it’s important to understand that memory-based reflection is not the same as training or fine-tuning the underlying LLM.
The framework can reuse previous lessons as contextual information, but that doesn’t automatically mean its investment predictions improve over time.
Demonstrating that would require systematic evaluation.
🔮 What If We Took This Project Further?
After experimenting with TradingAgents, I started thinking about what else we could build using this architecture.
Because the project is open source, there are several interesting directions to explore.
1. Build an AI-Powered Stock Screener
Instead of analyzing one company at a time, imagine providing the system with a watchlist of 50 stocks.
The agents could research each company, evaluate its investment thesis, and produce a shortlist of opportunities worth investigating further.
You could then compare the companies using consistent research criteria.
2. Create a Financial Research Dashboard
Another possibility is building a dashboard that tracks the agents’ research over time.
For example, it could display:
- Companies being monitored
- Latest research recommendations
- Bullish and bearish arguments
- Risk assessments
- Historical recommendations
- Subsequent stock performance
This could make it easier to compare how investment theses evolve as new information becomes available.
3. Introduce Industry-Specific AI Agents
Different industries require different types of analysis.
For example, we could introduce specialist agents for:
Semiconductors: Manufacturing capacity, AI infrastructure demand, supply chains, and competitive positioning.
Healthcare: Clinical trials, regulatory approvals, product pipelines, and reimbursement risks.
Technology: Revenue growth, recurring revenue, customer retention, and competitive advantages.
These agents could supplement the general research team with more specialized domain knowledge.
4. Evaluate Whether Multi-Agent Research Actually Works
This is probably the most interesting direction from a research perspective.
We could systematically compare:
Single LLM vs. Multi-Agent Research vs. Traditional Financial Screening
And evaluate metrics such as:
- Research completeness
- Factual accuracy
- Recommendation consistency
- Risk identification
- Token usage and cost
- Latency
- Performance against relevant benchmarks
We could also run historical evaluations while carefully controlling for look-ahead bias and survivorship bias.
That would help answer a much more meaningful question:
Do multi-agent AI systems actually improve investment research quality, or do they simply generate more elaborate reports?
來源:DEV Community · dev.to