Deepset's Haystack 3.0 RC1: Production-grade agents with hooks and async
Agent hooks, first-class async, and built-in introspection redefine AI pipeline control.
Deepset's Haystack 3.0 Release Candidate 1 brings a major overhaul aimed at production-grade agent pipelines. The Agent is now far more capable, gaining a general-purpose hooks system with six lifecycle points: before_run, before_llm, before_tool, after_tool, on_exit, and after_run. This allows developers to inject guardrails, audit tool calls, or add human-in-the-loop checkpoints without modifying internal logic. Additionally, Skills are now first-class citizens via progressive disclosure, keeping context lean, and tools can be dynamically selected at runtime through the run() and run_async() methods. Native async tools and built-in introspection (step_count, token_usage, tool_call_counts) further enhance observability and control. Launching with step-level tracing spans (haystack.agent.step), teams can precisely monitor what their agent did.
On the serving side, Pipeline and AsyncPipeline have been unified into a single class that exposes both run (sync) and run_async, along with concurrent tool calls and token-by-token streaming via Pipeline.stream(). Components now share a symmetric lifecycle (warm_up to acquire resources, close to release) to prevent leaks in long-running services. The core is leaner: legacy Generators are removed, haystack-experimental is no longer a dependency, and 30 components (like Sentence Transformers, Hugging Face, Whisper) have moved to independently released packages in haystack-core-integrations. Migration is straightforward with provided guides, making Haystack 3.0 a powerful, flexible framework for building observable, production-ready AI agents.
- Agent hooks at 6 lifecycle stages (e.g., before_tool, after_tool) enable guardrails and human-in-the-loop without modifying internals.
- Built-in introspection exposes step_count, token_usage, and tool_call_counts as state, with step-level tracing spans.
- Unified Pipeline supports both sync run() and async run_async(), concurrent tool calls, and token streaming for serving.
Why It Matters
Empowers developers to build robust, observable AI agents with full control and production-ready async serving.