Skip to content

docs: Update concept docs for Agent and move/improve State docs#11272

Merged
sjrl merged 14 commits into
mainfrom
concept-docs-agent
May 8, 2026
Merged

docs: Update concept docs for Agent and move/improve State docs#11272
sjrl merged 14 commits into
mainfrom
concept-docs-agent

Conversation

@sjrl
Copy link
Copy Markdown
Contributor

@sjrl sjrl commented May 7, 2026

Related Issues

Proposed Changes:

  • Moved states.mdx docs to be alongside the Agent and HITL component docs
  • Shortened the agent concepts docs and linked more heavily to our component docs
  • Updated examples to use recommened patterns
  • states docs were updated to highlight more practical use of state with Agent

How did you test it?

Ran code blocks locally

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

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

Project Deployment Actions Updated (UTC)
haystack-docs Ready Ready Preview, Comment May 7, 2026 0:58am

Request Review

@sjrl sjrl marked this pull request as ready for review May 7, 2026 12:42
@sjrl sjrl requested a review from a team as a code owner May 7, 2026 12:42
@sjrl sjrl requested review from anakin87 and removed request for a team May 7, 2026 12:42
@sjrl sjrl self-assigned this May 7, 2026
@claude
Copy link
Copy Markdown

claude Bot commented May 7, 2026

test

@claude
Copy link
Copy Markdown

claude Bot commented May 7, 2026

Code review - two issues found. Issue 1: gpt-5.4-nano typo. Issue 2: Wrong import path.

@claude
Copy link
Copy Markdown

claude Bot commented May 7, 2026

Code review

Two issues found:

Issue 1: Invalid model name gpt-5.4-nano (typo)

tool_calling_agent = Agent(
chat_generator=OpenAIChatGenerator(model="gpt-5.4-nano"),
system_prompt=(

The model gpt-5.4-nano does not exist in OpenAIs catalog — this is a typo for gpt-5-nano. This string was introduced in 14 places across the new state.mdx, agents.mdx, and their version-2.28 mirrors. The deleted code correctly used gpt-5-nano. Any reader copy-pasting these snippets will get a model_not_found error from the OpenAI API.

Fix: replace all occurrences of gpt-5.4-nano with gpt-5-nano.


Issue 2: Incorrect import path for merge_lists / replace_values

### Default Handlers
State provides two built-in merge behaviors (importable from `haystack.components.agents`):
- **`merge_lists`**: Appends to the existing list (default for list types)

The new state.mdx says these are "importable from haystack.components.agents", but haystack/components/agents/__init__.py only exports Agent and State. merge_lists and replace_values are only accessible from haystack.components.agents.state. The deleted docs had the correct path (from haystack.components.agents.state.state_utils import merge_lists, replace_values). This error also appears in the version-2.28 mirror.

Fix: change "importable from haystack.components.agents" to "importable from haystack.components.agents.state".

Copy link
Copy Markdown
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

Sounds reasonable

@sjrl sjrl merged commit ca84979 into main May 8, 2026
20 checks passed
@sjrl sjrl deleted the concept-docs-agent branch May 8, 2026 07: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