From d9acda1cfefb5e7d03d6ef21f90f6559dfdb150c Mon Sep 17 00:00:00 2001 From: bobby abbott Date: Sun, 1 Feb 2026 15:40:38 -0800 Subject: [PATCH] Run Tavily web search in parallel with Tako searches Use the research question as the web search query when coming from GenerateDataQuestions, so web results augment Tako chart data. Co-Authored-By: Claude Opus 4.5 --- agents/python/src/lib/search.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/agents/python/src/lib/search.py b/agents/python/src/lib/search.py index 2333ec6..7dd8c31 100644 --- a/agents/python/src/lib/search.py +++ b/agents/python/src/lib/search.py @@ -63,7 +63,7 @@ async def async_tavily_search(query: str) -> Dict[str, Any]: query=query, search_depth="advanced", include_answer=True, - max_results=10, + max_results=5, ), ) except Exception as e: @@ -99,7 +99,10 @@ async def search_node(state: AgentState, config: RunnableConfig): if ai_message.tool_calls and ai_message.tool_calls[0]["name"] == "Search": queries = ai_message.tool_calls[0]["args"].get("queries", [])[:MAX_WEB_SEARCHES] else: - queries = [] # No web search queries when coming from GenerateDataQuestions + # Use research question for web search when coming from GenerateDataQuestions + research_question = state.get("research_question", "") + queries = [research_question] if research_question else [] + queries = queries[:MAX_WEB_SEARCHES] data_questions = state.get("data_questions", [])