From 15b8276b92993fd2f848efcce4e35c5dfbcc9951 Mon Sep 17 00:00:00 2001 From: Yijia-Xiao Date: Wed, 23 Sep 2026 21:14:08 +0000 Subject: [PATCH] fix(agents): give the fundamentals analyst the insider transactions tool - the tool sat in the news tool node, which no analyst offered it from, so no run used insider data - the full-graph test now requires it --- tests/test_graph_end_to_end.py | 3 ++- tradingagents/agents/analysts/fundamentals_analyst.py | 4 +++- tradingagents/graph/trading_graph.py | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_graph_end_to_end.py b/tests/test_graph_end_to_end.py index 1a3f50a15..865af0d73 100644 --- a/tests/test_graph_end_to_end.py +++ b/tests/test_graph_end_to_end.py @@ -132,7 +132,8 @@ def test_a_full_run_reaches_a_logged_decision(tmp_path, monkeypatch, offline, st assert state[key].strip(), key tool_methods = {"get_stock_data", "get_indicators", "get_news", "get_global_news", "get_macro_indicators", "get_prediction_markets", "get_fundamentals", - "get_balance_sheet", "get_cashflow", "get_income_statement", "ohlcv"} + "get_balance_sheet", "get_cashflow", "get_income_statement", + "get_insider_transactions", "ohlcv"} assert offline == tool_methods assert [e["rating"] for e in graph.memory_log.load_entries()] == ["Overweight"] diff --git a/tradingagents/agents/analysts/fundamentals_analyst.py b/tradingagents/agents/analysts/fundamentals_analyst.py index 7b2b0ebf7..0e46f0fff 100644 --- a/tradingagents/agents/analysts/fundamentals_analyst.py +++ b/tradingagents/agents/analysts/fundamentals_analyst.py @@ -5,6 +5,7 @@ from tradingagents.agents.utils.agent_utils import ( get_cashflow, get_fundamentals, get_income_statement, + get_insider_transactions, get_instrument_context_from_state, get_language_instruction, ) @@ -20,12 +21,13 @@ def create_fundamentals_analyst(llm): get_balance_sheet, get_cashflow, get_income_statement, + get_insider_transactions, ] system_message = ( "You are a researcher tasked with analyzing fundamental information over the past week about a company. Please write a comprehensive report of the company's fundamental information such as financial documents, company profile, basic company financials, and company financial history to gain a full view of the company's fundamental information to inform traders. Make sure to include as much detail as possible. Provide specific, actionable insights with supporting evidence to help traders make informed decisions." + " Make sure to append a Markdown table at the end of the report to organize key points in the report, organized and easy to read." - + " Use the available tools: `get_fundamentals` for comprehensive company analysis, `get_balance_sheet`, `get_cashflow`, and `get_income_statement` for specific financial statements." + + " Use the available tools: `get_fundamentals` for comprehensive company analysis, `get_balance_sheet`, `get_cashflow`, and `get_income_statement` for specific financial statements, and `get_insider_transactions` for recent insider buying and selling." + get_language_instruction() ) diff --git a/tradingagents/graph/trading_graph.py b/tradingagents/graph/trading_graph.py index 75a14661b..b4a90d995 100644 --- a/tradingagents/graph/trading_graph.py +++ b/tradingagents/graph/trading_graph.py @@ -242,10 +242,8 @@ class TradingAgentsGraph: ), "news": ToolNode( [ - # News and insider information get_news, get_global_news, - get_insider_transactions, get_macro_indicators, get_prediction_markets, ] @@ -257,6 +255,7 @@ class TradingAgentsGraph: get_balance_sheet, get_cashflow, get_income_statement, + get_insider_transactions, ] ), }