Haystack v3.2.0 (2026-09-24, PyPI haystack-ai 3.2.0) adds experimental SummarizationCompactor for CompactionHook (four-tier progressive summarization toward a token budget; sample context_window=400_000, compact_at=0.7, compact_to=0.4), TokenBudgetHook with exit_reason=token_budget_exceeded, a general stop_run control flag, and fluent Pipeline.add_components/connect_many. Includes security hardening and breaking serialization/toolset changes.

Key Takeaways

  • ✓Shipped: GitHub v3.2.0 = PyPI haystack-ai 3.2.0
  • ✓Context: experimental SummarizationCompactor + CompactionHook; four-tier progressive summaries; sample 400k window, compact_at 0.7 → compact_to 0.4
  • ✓Budget: TokenBudgetHook (e.g. max_total_tokens=100_000) exits with token_budget_exceeded
  • ✓Control: any hook can set stop_run for a custom clean exit_reason
  • ✓DX/security: fluent add_components/connect_many; Jinja custom_filters require unsafe=True on load; Toolset + operator removed
🔬

In-Depth Technical Analysis

Core Background & Industry Pain Points

Long-running Agents inflate context across tool turns: hard truncation drops goals and open work; unbounded growth hits window and cost limits. Production also needs clean budget exits instead of exceptions, plus shorter pipeline assembly. Haystack v3.2.0 (2026-09-24, PyPI haystack-ai 3.2.0) ships compaction, budgets, and fluent builders together.

Architecture Highlights & Internals

Experimental SummarizationCompactor plugs into CompactionHook with four tiers (historical_turns → historical_summaries → current_task_steps → current_task_summaries), summarizing only as much as needed; min_keep_steps keeps the newest steps verbatim; summaries can use a cheap model. Sample knobs: context_window=400_000, compact_at=0.7, compact_to=0.4. Experimental TokenBudgetHook stops before the next LLM call with exit_reason="token_budget_exceeded". Any hook can state.set("stop_run", reason). Pipeline.add_components() / connect_many() enable fluent construction.

Authoritative Benchmarks & Measured Scores

No separate public latency/accuracy leaderboard in the release notes. Quantified knobs in docs/examples: 400_000 context window, 0.7→0.4 compaction ratios, and TokenBudget sample 100_000 tokens. Breaking: Jinja custom_filters serialization requires unsafe=True on load; Toolset + operator removed in favor of lists.

Developer Hands-on Guide

pip install -U haystack-ai==3.2.0. Attach CompactionHook(SummarizationCompactor(...)) and TokenBudgetHook(max_total_tokens=...) on Agent; for custom stops use state.set("stop_run", ...). Load pipelines with custom filters via unsafe=True, or set HAYSTACK_UNSAFE_DESERIALIZATION only on fully trusted deployments. Docs: SummarizationCompactor, TokenBudgetHook.