v2.28.0-rc1
The new release lets tools directly read/write agent state, replacing complex declarative mapping with simple parameter injection.
Deepset has launched the release candidate for Haystack v2.28.0, introducing a significant simplification for developers building AI agents. The standout feature allows tools and components to declare a `State` parameter in their signature, receiving the live agent state object automatically at invocation time. This eliminates the need for the previous declarative `inputs_from_state` and `outputs_to_state` wiring, making it easier to create tools that need to read from or write to multiple state keys. The system intelligently excludes these State parameters from the LLM-facing schema, so models aren't asked to supply them.
Beyond agent improvements, v2.28 represents a substantial infrastructure upgrade with the migration from the `requests` library to `httpx` for all HTTP operations. This change affects utilities like `request_with_retry` and components like `HuggingFaceTEIRanker`, requiring developers to update exception handling from `requests.exceptions.RequestException` to `httpx.HTTPError`. The release also includes several enhancements: `Agent.run()` now requires explicit `messages` arguments, `MarkdownHeaderSplitter` gains granular control over header splitting levels, and error reporting for failed HTTP requests has been improved with additional diagnostic details.
Additional quality-of-life improvements include making `_create_agent_snapshot` robust against serialization errors with proper fallbacks, adding `run_async` to `LLMMetadataExtractor`, and updating documentation around `DocumentCleaner` to prevent accidental flattening of Markdown content. These changes collectively make Haystack more reliable for production agent workflows while maintaining backward compatibility where possible.
- Tools can now directly access agent State via annotated parameters, replacing complex declarative mapping with simple injection
- HTTP stack upgraded from requests to httpx, requiring exception handling updates from RequestException to HTTPError
- Agent.run() now requires explicit messages argument, MarkdownHeaderSplitter gains header_split_levels parameter for granular control
Why It Matters
Simplifies building complex AI agents by reducing boilerplate code and improving error handling for production systems.