deepset-ai/haystack
Component-based Python orchestration for RAG pipelines and tool-using agents
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Haystack is an embeddable Python SDK with two execution abstractions. Pipeline connects components through named inputs and outputs, with branches and loops when the next step depends on a result. This makes it possible to keep ingestion and indexing separate from the query path, where retrieval, filtering, ranking, and generation can be tested independently. Agent handles workflows where the model selects tools at runtime.
The haystack-ai distribution targets Python 3.11 or newer and uses Hatchling for builds. Core code lives in haystack/, with sibling test/, e2e/, and examples/ directories. The component interface is the main extension boundary: custom code can adapt a converter, retriever, or model backend without replacing the workflow. The interface makes substitution possible, but does not guarantee equivalent outputs or behavior across backends.
Key Capabilities & Differentiators
Haystack covers indexing, retrieval, memory, generation, and evaluation. It supports synchronous and asynchronous pipeline execution and token streaming. Components can connect to hosted providers including OpenAI, Anthropic, Mistral, Google, Azure OpenAI, and AWS Bedrock, as well as local models. Text and image routing components in v3.5.0 provide concrete entry points for multimodal workflows.
Agents can run tool calls concurrently. Lifecycle hooks such as before_llm, before_tool, and on_exit let application code inspect or intervene at defined points. Built-in tracking of step_count, token_usage, and tool calls helps distinguish repeated model steps from tool fan-out. SkillToolset adds descriptions to the context only when needed. These features provide hooks and signals for policy and monitoring; they are not, by themselves, a security boundary or an operations stack.
Trade-offs & Limitations
Against a hand-written flow using provider SDKs, Haystack earns its place when teams need to test retrieval separately, change ranking without rewriting prompt assembly, or share routing logic across applications. For a stable retrieve-and-generate endpoint, a short Python implementation may be easier to own. Swapping a component also does not eliminate the need to validate score distributions, output schemas, or tool-call behavior.
Async execution overlaps I/O, but concurrency can amplify rate-limit pressure and the load on downstream tools. Set budgets for loops and tool fan-out, and exercise timeout and partial-failure paths before rollout. Compared with the separately offered Haystack Enterprise Platform, the Apache-2.0 SDK gives teams control over where and how they run workloads, but does not supply the platform's packaged governance, access controls, and operational tooling.
Hardware & Deployment Guide
Start with pip install haystack-ai on Python 3.11 or newer. Docker images are available and the repository contains docker/. The core is a library: to expose a self-hosted API, plan for a serving layer and its authentication, secrets, monitoring, and traffic controls. Hosted inference reduces local model-serving requirements but introduces network, quota, and data-handling constraints. Offline use requires locally available models and backends, an inventory of outbound integrations, and a telemetry decision.
In v3.5.0, OpenAIDecisionsTextRouter sends text to named outputs by label via the OpenAI Decisions API, adding a provider-specific option that should not be treated as offline-capable. The v2.31.1 security release raised the minimum versions to anyio>=4.14.2 and certifi>=2026.10.19. Check the resolved versions in the actual deployment image, especially when an existing lockfile pins transitive dependencies.
before_llm, before_tool, and on_exit provide extension points around model calls, tool calls, and agent exit.step_count, token_usage, and tool calls; SkillToolset adds skill descriptions to context on demand.OpenAIDecisionsTextRouter for dispatch by label.Teams building RAG, search, or tool-using applications that need to tune retrieval and routing independently and retain control over model providers and deployment.
A short, stable provider SDK flow is sufficient, or you need a ready-to-run API with governance and access controls rather than a library to embed.
Quick Start & Installation
pip install haystack-aiComparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| haystack ★ | 27.2k | +53 | Python | Apache-2.0 | Component-based Python orchestration for RAG pipelines and tool-using agents |
| llama_index | 53.1k | +104 | Python | MIT | A modular Python SDK for document ingestion, indexing, and RAG |
| langextract | 39.5k | +85 | Python | Apache-2.0 | Python SDK for extracting structured data with traceable source spans |
| llmware | 14.8k | +8 | Python | Apache-2.0 | Local-first Python RAG SDK for document retrieval and small-model inference. |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/deepset-ai/haystack.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about haystack
How should I divide a workflow between Pipeline and Agent?
before_tool rather than relying on the model to follow a prompt.Does Haystack need a GPU, and what should I size for?
Can we self-host Haystack in a commercial or restricted environment?
When is Haystack preferable to direct provider SDKs or a managed platform?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy