Skip to content

docs: document Agent run metadata, runtime exit_conditions, SearchableToolset notes, and MockChatGenerator - #11873

Merged
julian-risch merged 7 commits into
mainfrom
docs/v3-simple-doc-updates-3
Jul 9, 2026
Merged

docs: document Agent run metadata, runtime exit_conditions, SearchableToolset notes, and MockChatGenerator#11873
julian-risch merged 7 commits into
mainfrom
docs/v3-simple-doc-updates-3

Conversation

@julian-risch

@julian-risch julian-risch commented Jul 5, 2026

Copy link
Copy Markdown
Member

Related Issues

Proposed Changes:

  • feat!: Track step_count, token_usage and tool_call_counts in Agent's State #11427Agent docs: the result dictionary now lists the auto-populated step_count, token_usage, and tool_call_counts outputs, with a new "Run Metadata" section explaining that they are readable mid-run by tools via inputs_from_state, are outputs only, and are reserved state_schema keys. The State page mentions "Reserved keys" covering all Agent-managed keys: the three run-metadata keys plus the hook-facing continue_run, tools, and hook_context.
  • fix: Various fixes to Agent around using SearchableToolset #11557Agent / SearchableToolset docs: exit_conditions is now described as evaluated at runtime, so conditions can name tools loaded later . Duplicate tool names are detected at the start of each agent step, and a new "Warm-up" section on the SearchableToolset page notes that constructing an Agent no longer warms up the toolset (warm-up happens via Agent.warm_up() or at run time).
  • fix: Refactor SearchableToolset and fix serialization of catalog=Toolset #11549SearchableToolset docs: warm_up() raises a ValueError when the catalog contains tools with duplicate names. Folded into the new "Warm-up" section.
  • feat: add MockChatGenerator #11708 — New MockChatGenerator page covering the four response modes (fixed, cycling, response_fn, echo default), model / meta / streaming_callback parameters, and usage examples. Added to the sidebar and the Generators overview table.

How did you test it?

  • The MockChatGenerator examples and the documented token_usage / step_count / tool_call_counts output shapes were executed against the v3 code.

Notes for the reviewer

Checklist

🤖 Generated with Claude Code

…hatGenerator

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
haystack-docs Error Error Jul 9, 2026 12:54pm

Request Review

…d state keys

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@julian-risch julian-risch changed the title docs: document Agent run metadata, runtime exit_conditions, and MockChatGenerator docs: document Agent run metadata, runtime exit_conditions, SearchableToolset notes, and MockChatGenerator Jul 5, 2026
Removed redundant wording and improved clarity in the overview section of MockChatGenerator documentation.
- `system_prompt`: A plain string or Jinja2 template used as the system message for every run. If the template contains Jinja2 variables, those variables become additional inputs to `run()`.
- `user_prompt`: A Jinja2 template appended to the user-provided messages on each run. Template variables become additional inputs to `run()`. Use `required_variables` to enforce which variables must be provided.
- `exit_conditions`: List of conditions that cause the agent to stop. Use `”text”` to stop when the LLM replies without a tool call, or a tool name to stop once that tool has been executed. Defaults to `[“text”]`.
- `exit_conditions`: List of conditions that cause the agent to stop. Use `”text”` to stop when the LLM replies without a tool call, or a tool name to stop once that tool has been executed. Defaults to `[“text”]`. Exit conditions are evaluated at runtime rather than validated at initialization, so a condition can name a tool that is only loaded later — for example, a tool passed at runtime via `run(tools=...)` or one discovered by a [`SearchableToolset`](../../tools/searchabletoolset.mdx).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition could also be left out.

`chat_generator` is the only mandatory parameter — an instance of a Chat Generator that supports tools. All other parameters are optional.

- `tools`: A list of tool or toolset instances the agent can call. Supported types: [`Tool`](../../tools/tool.mdx), [`ComponentTool`](../../tools/componenttool.mdx), [`PipelineTool`](../../tools/pipelinetool.mdx), [`MCPTool`](../../tools/mcptool.mdx), [`Toolset`](../../tools/toolset.mdx), [`MCPToolset`](../../tools/mcptoolset.mdx), [`SearchableToolset`](../../tools/searchabletoolset.mdx).
- `tools`: A list of tool or toolset instances the agent can call. Supported types: [`Tool`](../../tools/tool.mdx), [`ComponentTool`](../../tools/componenttool.mdx), [`PipelineTool`](../../tools/pipelinetool.mdx), [`MCPTool`](../../tools/mcptool.mdx), [`Toolset`](../../tools/toolset.mdx), [`MCPToolset`](../../tools/mcptoolset.mdx), [`SearchableToolset`](../../tools/searchabletoolset.mdx). Tool names must be unique; duplicate names are detected at the start of each agent step, before the chat generator is called.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition could also be left out.

@sjrl
sjrl changed the base branch from v3 to main July 8, 2026 13:22
@julian-risch
julian-risch marked this pull request as ready for review July 8, 2026 19:20
@julian-risch
julian-risch requested a review from a team as a code owner July 8, 2026 19:20
@julian-risch
julian-risch requested review from davidsbatista and removed request for a team July 8, 2026 19:20
@claude

claude Bot commented Jul 8, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@claude

claude Bot commented Jul 8, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@davidsbatista davidsbatista left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@julian-risch
julian-risch merged commit d037854 into main Jul 9, 2026
21 of 22 checks passed
@julian-risch
julian-risch deleted the docs/v3-simple-doc-updates-3 branch July 9, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants