v2.28.0
The latest update to the popular RAG framework introduces flexible agent state handling and stricter LLM component requirements.
deepset has launched Haystack v2.28.0, a significant update to its open-source framework for building production-ready LLM applications. The release introduces a powerful new feature allowing tools and components to directly receive the live agent State object through parameter injection. Developers can now annotate function-based tools with a State parameter or declare State input sockets on component-based tools, enabling tools to read from and write to multiple state keys without complex wiring. This provides greater flexibility compared to the existing declarative mapping approach, though it creates tighter coupling between tool implementation and the State object.
Major breaking changes include stricter requirements for the LLM component, which now mandates that user_prompt must contain at least one Jinja2 template variable (like {{ variable_name }}) at initialization. This ensures the component always exposes required input sockets for correct pipeline scheduling. The framework has also migrated from the requests library to httpx for HTTP handling, affecting utilities like request_with_retry and components like HuggingFaceTEIRanker, which now raise httpx.HTTPError instead of requests.exceptions.RequestException. Agent.run() methods now require explicit messages arguments, and documentation has been updated to clarify Markdown processing behavior with DocumentCleaner.
These changes reflect Haystack's evolution toward more robust, production-oriented LLM application development, with improved error handling, better serialization resilience for agent snapshots, and standardized HTTP client usage throughout the framework.
- Tools can now receive live agent State objects via parameter injection, enabling direct access to runtime context without complex wiring
- LLM components require user_prompt with Jinja2 template variables, ensuring proper pipeline scheduling and input socket exposure
- Migration from requests to httpx standardizes HTTP handling across the framework, affecting retry utilities and HuggingFaceTEIRanker
Why It Matters
Enables more sophisticated agent workflows with direct state access while enforcing production-ready patterns for LLM application development.