Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

test: regenerate golden master for langgraph_agent settings (#3336)

LearningCircuitae0a9e6f34bd
diff --git a/src/local_deep_research/advanced_search_system/strategies/langgraph_agent_strategy.py b/src/local_deep_research/advanced_search_system/strategies/langgraph_agent_strategy.py
index fde49a4bac..4b0bbd7372 100644
--- a/src/local_deep_research/advanced_search_system/strategies/langgraph_agent_strategy.py
+++ b/src/local_deep_research/advanced_search_system/strategies/langgraph_agent_strategy.py
@@ -31,7 +31,7 @@ from .base_strategy import BaseSearchStrategy
# ---------------------------------------------------------------------------
DEFAULT_MAX_ITERATIONS = (
- 15 # agent needs many more cycles than pipeline strategies
+ 50 # agent needs many more cycles than pipeline strategies
)
MIN_ITERATIONS = 10 # below this the agent can barely do anything useful
SUBAGENT_TIMEOUT_SECONDS = 300 # 5 minutes per subagent
@@ -369,7 +369,7 @@ class LangGraphAgentStrategy(BaseSearchStrategy):
model: BaseChatModel,
search,
citation_handler=None,
- max_iterations: int = 15,
+ max_iterations: int = 50,
max_sub_iterations: int = 8,
include_sub_research: bool = True,
all_links_of_system: list | None = None,
diff --git a/src/local_deep_research/defaults/default_settings.json b/src/local_deep_research/defaults/default_settings.json
index 65524cd6a4..17dc84e23d 100644
--- a/src/local_deep_research/defaults/default_settings.json
+++ b/src/local_deep_research/defaults/default_settings.json
@@ -883,6 +883,48 @@
"value": 30,
"visible": true
},
+ "langgraph_agent.max_iterations": {
+ "category": "langgraph_agent",
+ "description": "Maximum number of agent reasoning cycles (each cycle = one LLM call + one tool call). Higher values let the agent search more thoroughly but use more tokens. The agent typically needs 10-20 cycles for simple queries and 30-50 for complex multi-faceted research.",
+ "editable": true,
+ "max_value": 100,
+ "min_value": 10,
+ "name": "Max Agent Iterations",
+ "options": null,
+ "step": 5,
+ "type": "SEARCH",
+ "ui_element": "number",
+ "value": 50,
+ "visible": true
+ },
+ "langgraph_agent.max_sub_iterations": {
+ "category": "langgraph_agent",
+ "description": "Maximum reasoning cycles per subagent when researching subtopics in parallel. Each subagent investigates one aspect of the question independently.",
+ "editable": true,
+ "max_value": 30,
+ "min_value": 3,
+ "name": "Max Subagent Iterations",
+ "options": null,
+ "step": 1,
+ "type": "SEARCH",
+ "ui_element": "number",
+ "value": 8,
+ "visible": true
+ },
+ "langgraph_agent.include_sub_research": {
+ "category": "langgraph_agent",
+ "description": "Enable parallel subagent research. When enabled, the agent can decompose complex questions into subtopics and research them simultaneously using separate subagents.",
+ "editable": true,
+ "max_value": null,
+ "min_value": null,
+ "name": "Enable Parallel Subagents",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "checkbox",
+ "value": true,
+ "visible": true
+ },
"focused_iteration.adaptive_questions": {
"category": "focused_iteration",
"description": "When enabled (1), the system monitors recent search success and warns the LLM to broaden queries if 3+ searches in a recent window returned no results. When disabled (0), queries are generated without feedback from previous result counts.",
diff --git a/src/local_deep_research/search_system_factory.py b/src/local_deep_research/search_system_factory.py
index 8f7c2aaf20..0922fb7d35 100644
--- a/src/local_deep_research/search_system_factory.py
+++ b/src/local_deep_research/search_system_factory.py
@@ -901,9 +901,26 @@ def create_strategy(
return LangGraphAgentStrategy(
model=model,
search=search,
- max_iterations=kwargs.get("max_iterations", 15),
- max_sub_iterations=kwargs.get("max_sub_iterations", 8),
- include_sub_research=kwargs.get("include_sub_research", True),
+ max_iterations=kwargs.get(
+ "max_iterations",
+ _get_setting(
+ settings_snapshot, "langgraph_agent.max_iterations", 50
+ ),
+ ),
+ max_sub_iterations=kwargs.get(
+ "max_sub_iterations",
+ _get_setting(
+ settings_snapshot, "langgraph_agent.max_sub_iterations", 8
+ ),
+ ),
+ include_sub_research=kwargs.get(
+ "include_sub_research",
+ _get_setting(
+ settings_snapshot,
+ "langgraph_agent.include_sub_research",
+ True,
+ ),
+ ),
all_links_of_system=all_links_of_system,
settings_snapshot=settings_snapshot,
)
diff --git a/tests/settings/golden_master_settings.json b/tests/settings/golden_master_settings.json
index b46433f349..cd57c962e0 100644
--- a/tests/settings/golden_master_settings.json
+++ b/tests/settings/golden_master_settings.json
@@ -823,6 +823,48 @@
"value": "",
"visible": true
},
+ "langgraph_agent.include_sub_research": {
+ "category": "langgraph_agent",
+ "description": "Enable parallel subagent research. When enabled, the agent can decompose complex questions into subtopics and research them simultaneously using separate subagents.",
+ "editable": true,
+ "max_value": null,
+ "min_value": null,
+ "name": "Enable Parallel Subagents",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "checkbox",
+ "value": true,
+ "visible": true
+ },
+ "langgraph_agent.max_iterations": {
+ "category": "langgraph_agent",
+ "description": "Maximum number of agent reasoning cycles (each cycle = one LLM call + one tool call). Higher values let the agent search more thoroughly but use more tokens. The agent typically needs 10-20 cycles for simple queries and 30-50 for complex multi-faceted research.",
+ "editable": true,
+ "max_value": 100,
+ "min_value": 10,
+ "name": "Max Agent Iterations",
+ "options": null,
+ "step": 5,
+ "type": "SEARCH",
+ "ui_element": "number",
+ "value": 50,
+ "visible": true
+ },
+ "langgraph_agent.max_sub_iterations": {
+ "category": "langgraph_agent",
+ "description": "Maximum reasoning cycles per subagent when researching subtopics in parallel. Each subagent investigates one aspect of the question independently.",
+ "editable": true,
+ "max_value": 30,
+ "min_value": 3,
+ "name": "Max Subagent Iterations",
+ "options": null,
+ "step": 1,
+ "type": "SEARCH",
+ "ui_element": "number",
+ "value": 8,
+ "visible": true
+ },
"llm.anthropic.api_key": {
"category": "llm_general",
"description": "Your Anthropic API key for Claude models. Get one at console.anthropic.com. Required when using the Anthropic provider.",
diff --git a/tests/strategies/test_langgraph_agent_strategy.py b/tests/strategies/test_langgraph_agent_strategy.py
index d7e85ddbf8..59c1623c10 100644
--- a/tests/strategies/test_langgraph_agent_strategy.py
+++ b/tests/strategies/test_langgraph_agent_strategy.py
@@ -243,15 +243,15 @@ class TestLangGraphAgentStrategy:
def test_default_params(self):
strategy = self._make_strategy()
- assert strategy.max_iterations == 15
+ assert strategy.max_iterations == 50
assert strategy.max_sub_iterations == 8
assert strategy.include_sub_research is True
def test_custom_params(self):
strategy = self._make_strategy(
- max_iterations=20, max_sub_iterations=3, include_sub_research=False
+ max_iterations=50, max_sub_iterations=3, include_sub_research=False
)
- assert strategy.max_iterations == 20
+ assert strategy.max_iterations == 50
assert strategy.max_sub_iterations == 3
assert strategy.include_sub_research is False
@@ -259,7 +259,7 @@ class TestLangGraphAgentStrategy:
"""Pipeline-style low values (e.g. search.iterations=3) should not
constrain the agent — it needs many more ReAct cycles."""
strategy = self._make_strategy(max_iterations=3)
- assert strategy.max_iterations == 15 # DEFAULT_MAX_ITERATIONS
+ assert strategy.max_iterations == 50 # DEFAULT_MAX_ITERATIONS
def test_super_init_called_with_kwargs(self):
"""Verify base class attributes are set correctly."""