Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configs/config_cli_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ functions:
exclude_tools:
- advanced_web_search_tool
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion configs/config_frontier_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ functions:
- web_search_tool
- knowledge_search
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion configs/config_mcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ functions:
exclude_tools:
- advanced_web_search_tool
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion configs/config_openshell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ functions:
- advanced_web_search_tool
verbose: true
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

# OpenShell configuration: skills + sandbox
deep_research_skills:
Expand Down
2 changes: 1 addition & 1 deletion configs/config_web_azure_ai_search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ functions:
- advanced_web_search_tool
verbose: true
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion configs/config_web_default_guardrails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ functions:
- advanced_web_search_tool
verbose: true
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion configs/config_web_default_llamaindex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ functions:
- advanced_web_search_tool
verbose: true
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion configs/config_web_frag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ functions:
exclude_tools:
- advanced_web_search_tool
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion configs/config_web_frag_mcp_auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ functions:
exclude_tools:
- advanced_web_search_tool
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion configs/config_web_opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ functions:
exclude_tools:
- advanced_web_search_tool
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
11 changes: 7 additions & 4 deletions docs/source/architecture/agents/shallow-researcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ with configurable iteration limits.
The shallow path is optimized for speed and cost:

- A single LLM with bound tools handles the full research cycle
- Tool calls are counted against a budget (`max_tool_iterations`)
- Tool calls are counted against a total budget (`max_tool_iterations`): one
initial search and, when needed, one rewritten-query retry. Values above two
remain loadable for compatibility but the runtime caps them at two.
- When the budget is exhausted, a synthesis anchor forces the LLM to produce
a final answer with citations instead of making more tool calls
- Context compaction keeps the message window manageable for long tool chains
Expand Down Expand Up @@ -99,7 +101,7 @@ Configured through `ShallowResearchAgentConfig` (NeMo Agent Toolkit type name: `
| `llm` | `LLMRef` | required | LLM to use for research |
| `tools` | `list[FunctionRef \| FunctionGroupRef]` | `[]` | Tools available for research (web search, document search, etc.) |
| `max_llm_turns` | `int` | `10` | Maximum LLM interaction turns |
| `max_tool_iterations` | `int` | `5` | Maximum tool calls before forcing synthesis |
| `max_tool_iterations` | `int` | `2` | Maximum total tool calls before synthesis; values above two are accepted but capped at two |
| `verbose` | `bool` | `false` | Enable verbose logging |

**Example YAML:**
Expand All @@ -112,7 +114,7 @@ functions:
tools:
- web_search_tool
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2
verbose: true
```

Expand Down Expand Up @@ -144,7 +146,8 @@ queries with the full context the user assumed but did not state.

### Synthesis Anchor

When `tool_iterations >= max_tool_iterations`, the agent appends a
When `tool_iterations` reaches the effective limit
(`min(max_tool_iterations, 2)`), the agent appends a
`HumanMessage` synthesis anchor after the conversation history:

> "You have exhausted your research budget. Synthesize the final answer now
Expand Down
6 changes: 3 additions & 3 deletions docs/source/customization/configuration-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ functions:
- web_search_tool
- knowledge_search
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2
verbose: true
```

Expand All @@ -441,7 +441,7 @@ functions:
| `llm` | `str` | **required** | LLM for research and synthesis. |
| `tools` | `list[str]` | `[]` | Search tools available to the agent. |
| `max_llm_turns` | `int` | `10` | Maximum number of LLM turns (includes both reasoning and tool-calling steps). |
| `max_tool_iterations` | `int` | `5` | Maximum tool-calling iterations before forcing synthesis. |
| `max_tool_iterations` | `int` | `2` | Maximum total tool calls before synthesis. Values above two remain valid but are capped at two. |
| `verbose` | `bool` | `false` | Enable verbose logging. |

### `deep_research_agent`
Expand Down Expand Up @@ -676,7 +676,7 @@ functions:
tools:
- web_search_tool
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent: # Multi-phase deep research
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/cli-with-local-nims.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ functions:
tools:
- web_search_tool
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/full-pipeline-llamaindex.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ functions:
- web_search_tool
- knowledge_search
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

deep_research_agent:
_type: deep_research_agent
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/full-pipeline-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ functions:
- web_search_tool
- knowledge_search
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2

# -------------------------------------------------------------------------
# Deep research agent
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/minimal-shallow-only.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ functions:
tools:
- web_search
max_llm_turns: 10 # Max reasoning steps before forced output
max_tool_iterations: 5 # Max tool invocations per session
max_tool_iterations: 2 # Max total calls: initial search + one retry

# ---------------------------------------------------------------------------
# Workflow
Expand Down
2 changes: 1 addition & 1 deletion docs/source/resources/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Common issues and solutions for the AI-Q blueprint.
|-------|-------|-----|
| Agent hangs on deep research | LLM timeout or rate limit | Set `verbose: true` in config to see progress; check LLM API availability and rate limits |
| HTTP 429 or 503 on deep research | Nemotron hosted endpoint availability | Retry after a short delay, reduce concurrency, or follow the [self-hosting guidance](#nemotron-hosted-endpoint-availability) for consistent throughput |
| Shallow research returns generic answers | Insufficient tool calls | Increase `max_tool_iterations` (default: 5) |
| Shallow research returns generic answers | Weak or irrelevant search evidence | Keep `max_tool_iterations: 2` (the supported cap) and improve the selected source or query wording |
| Clarifier keeps asking questions | Too many clarification turns | Reduce `max_turns`, or set `enable_clarifier: false` in the workflow to disable clarification |
| SSE stream disconnects | Network timeout | Client auto-reconnects using `last_event_id`; refer to [Data Flow](../architecture/data-flow.md) |
| Job status stuck on RUNNING | Dask worker crashed | Check Dask logs; the ghost job reaper will eventually mark it FAILURE |
Expand Down
2 changes: 1 addition & 1 deletion frontends/aiq_api/src/aiq_api/jobs/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ def _create_agent_instance(
return agent_cls(
llm_provider=llm_provider,
tools=tools,
max_tool_iterations=getattr(fn_config, "max_tool_iterations", 5),
max_tool_iterations=getattr(fn_config, "max_tool_iterations", 2),
callbacks=callbacks,
)
except TypeError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ functions:
tools:
- web_search_tool
max_llm_turns: 10
max_tool_iterations: 5
max_tool_iterations: 2
verbose: true

deep_research_agent:
Expand Down
Loading
Loading