haystack README

The project's README from github.com/deepset-ai/haystack. As one markdown file: README.md.

Blue banner with the Haystack logo and the text ‘haystack by deepset – The Open Source AI Framework for Production Ready RAG & Agents’ surrounded by abstract icons representing search, documents, agents, pipelines, and cloud systems.
CI/CD Tests types - Mypy Coverage badge Ruff
Docs Website
Package PyPI PyPI - Downloads PyPI - Python Version Conda Version GitHub License Compliance HVTrust Evidence Grade OpenSSF Best Practices
Meta Discord Twitter Follow

🎉🎊✨   Haystack 3.0 is out!   ✨🎊🎉

Read the announcement here!

🥳 🎈 🎆 🪅 🎇 🍾 🥂 🎁 🌈

Haystack is an open-source AI orchestration framework for building production-ready LLM applications in Python.

Design modular pipelines and agent workflows with explicit control over retrieval, routing, memory, and generation. Build scalable RAG systems, multimodal applications, semantic search, question answering, and autonomous agents, all in a transparent architecture that lets you experiment, customize deeply, and deploy with confidence.

Table of Contents

Installation

The simplest way to get Haystack is via pip:

pip install haystack-ai

Install nightly pre-releases to try the newest features:

pip install --pre haystack-ai

Haystack supports multiple installation methods, including Docker images. For a comprehensive guide, please refer to the documentation.

Documentation

If you're new to the project, check out "What is Haystack?" then go through the "Get Started Guide" and build your first LLM application in a matter of minutes. Keep learning with the tutorials. For more advanced use cases, or just to get some inspiration, you can browse our Haystack recipes in the Cookbook.

At any given point, hit the documentation to learn more about Haystack, what it can do for you, and the technology behind.

Features

Agents built for production
Extend agent behavior with lifecycle hooks (before_llm, before_tool, on_exit, …) for guardrails and custom logic, and track step_count, token_usage, and tool calls out of the box for monitoring and cost control. Get started fast with ready-made agents from Agent Pack (e.g., a deep research agent, or an advanced RAG agent) or give your own agents progressive skill discovery via SkillToolset, so skill descriptions only enter context when needed.

Built for context engineering
Design flexible systems with explicit control over how information is retrieved, ranked, filtered, combined, structured, and routed before it reaches the model. Define pipelines and agent workflows where retrieval, memory, tools, and generation are transparent and traceable.

Native Async Support
One Pipeline runs synchronously or asynchronously and streams token by token. Agent can run concurrent tool calls.

Modular and customizable
Use built-in components for retrieval, indexing, tool calling, memory, and evaluation, or create your own. Add loops, branches, and conditional logic to precisely control how context moves through your pipelines and agent workflows.

Model- and vendor-agnostic
Integrate with OpenAI, Mistral, Anthropic, Cohere, Hugging Face, Google, Azure OpenAI, AWS Bedrock, local models, and many others. Swap models or infrastructure components without rewriting your system.

Extensible ecosystem
Build and share custom components through a consistent interface that makes it easy for the community and third parties to extend Haystack and contribute to an open ecosystem.

[!TIP]

Would you like to deploy and serve Haystack pipelines as REST APIs or MCP servers? Hayhooks provides a simple way for you to wrap pipelines and agents with custom logic and expose them through HTTP endpoints or MCP. It also supports OpenAI-compatible chat completion endpoints and works with chat UIs like open-webui.

Haystack Enterprise: Support & Platform

Get expert support from the Haystack team, build faster with enterprise-grade templates, and scale securely with deployment guides for cloud and on-prem environments with Haystack Enterprise Starter. Read more about it in the announcement post.

👉 Get Haystack Enterprise Starter

Need a managed production setup for Haystack? The Haystack Enterprise Platform helps you build, test, deploy and operate Haystack pipelines with built-in observability, collaboration, governance, and access controls. It’s available as a managed cloud service or as a self-hosted solution.

👉 Learn more about Haystack Enterprise Platform or try it free

Telemetry

Haystack collects anonymous usage statistics of pipeline components. We receive an event every time these components are initialized. This way, we know which components are most relevant to our community.

Read more about telemetry in Haystack or how you can opt out in Haystack docs.

🖖 Community

If you have a feature request or a bug report, feel free to open an issue in GitHub. We regularly check these, so you can expect a quick response. If you'd like to discuss a topic or get more general advice on how to make Haystack work for your project, you can start a thread in Github Discussions or our Discord channel. We also check 𝕏 (Twitter) and Stack Overflow.

Contributing to Haystack

We are very open to the community's contributions - be it a quick fix of a typo, or a completely new feature! You don't need to be a Haystack expert to provide meaningful improvements. To learn how to get started, check out our Contributor Guidelines first.

There are several ways you can contribute to Haystack:

[!TIP] 👉 Check out the full list of issues that are open to contributions

Organizations using Haystack

Haystack is used by thousands of teams building production AI systems across industries, including:

Are you also using Haystack? Open a PR or tell us your story

haystack (deepset-ai/haystack)

Searching Database…

26.8K ·GitHub
这是什么?一个开源的 AI 编排框架,用 Python 构建可用于生产环境的 LLM 应用:提供模块化的流水线和智能体工作流,可以明确掌控检索、路由、记忆和生成环节。
它是在我自己代码里使用的框架,还是装好就能用的成品应用?它是一个需要写代码使用的 Python 框架——你用内置或自定义组件来搭建流水线和智能体,而不是安装一个现成的产品。如果想把你的流水线作为 REST API 或 MCP 服务器对外提供,配套项目 Hayhooks 可以帮你封装。
我怎么让它跑起来?用 pip 安装即可;也支持每晚发布的预发布版本和 Docker 镜像。然后照着 Get Started Guide 走一遍——几分钟就能搭好你的第一个 LLM 应用,还有教程和 Cookbook 供深入研究更复杂的使用场景。
用它是必须绑定某一家 LLM 提供商吗?不,它不依赖任何模型和厂商:可以接入 OpenAI、Mistral、Anthropic、Cohere、Hugging Face、Google、Azure OpenAI、AWS Bedrock 或本地模型,随时更换,不需要重写你的系统。
它完全免费吗,还是有什么限制?核心框架免费开源,但专家支持、企业级模板,以及托管或自托管的 Enterprise Platform 属于付费的 Haystack Enterprise 产品。
它会把我使用情况的数据发到别处吗?会,它会收集匿名遥测数据,报告你初始化了哪些流水线组件;你可以通过文档里说明的选项关闭它。
我能用它构建哪些应用?可扩展的 RAG 系统、多模态应用、语义搜索、问答系统,以及自主智能体。流水线支持循环、分支和条件逻辑,因此上下文如何被检索、过滤、组合和路由始终是明确、可追踪的。
它的智能体为什么适合生产环境?生命周期钩子(before_llm、before_tool、on_exit)让你能加入护栏和自定义逻辑;step_count、token_usage 和工具调用默认就会被记录,方便监控和成本控制。流水线支持同步或异步运行,并逐 token 流式输出;智能体可以并发调用工具,Agent Pack 还内置了现成的智能体,比如深度研究智能体和高级 RAG 智能体。
我能把我的流水线发布为 REST API 或 MCP 服务器吗?可以——Hayhooks 会用自定义逻辑封装流水线和智能体,通过 HTTP 端点或 MCP 对外提供。它还支持与 OpenAI 兼容的聊天补全端点,并且可以配合 open-webui 之类的聊天界面使用。
它真的有人在生产环境使用,还是主要停留在实验阶段?数千个团队在生产环境中使用它,其中包括 Apple、Meta、Databricks、NVIDIA、Netflix、Airbus 和欧盟委员会。该项目从 2019 年发展至今,目前版本是 3.0。
Creator
deepset-ai
Size
394.2 MB
Stars
26.8K
Age
6y
Commits · 90 Days