Back to glossary

Term

Haystack

Haystack is an open-source AI orchestration framework from deepset for building production-ready LLM applications. Modular components — retrievers, generators, routers, tools — are assembled into explicit pipelines for RAG, agents and semantic search.

Haystack — explained in detail

Haystack is an open-source framework from the company deepset for orchestrating LLM applications. Its central concept is the pipeline: an application is modeled as a directed graph of interchangeable components — retrievers, embedders, prompt builders, generators (LLM calls), routers, memory layers, tools and evaluators. Each component has clearly defined inputs and outputs, so the data flow can be wired up explicitly and transparently. The architecture reworked in Haystack 2.0 emphasizes this modularity and makes pipelines serializable and therefore reproducibly deployable.

Its focus areas are RAG (retrieval-augmented generation), semantic search and dialogue systems. Haystack offers a large component library for embedding and retrieval, connections to various LLM providers, routing, guardrails and external tool calls. The pipeline model also supports more complex patterns such as hybrid search, reranking or self-correction loops, as well as agentic workflows. Alongside the free framework, deepset offers a commercial enterprise platform.

Example / Practical use

A classic use case is a document question-answering application: an indexing pipeline splits PDFs into chunks, generates embeddings and writes them to a document store (e.g. a vector database). A query pipeline takes the user question, retrieves the relevant chunks via a retriever, builds a prompt from them and passes it to an LLM, which formulates the answer with source references. Both pipelines are made of the same building blocks, just wired differently.

LangChain and LlamaIndex pursue similar goals; Haystack, however, particularly emphasizes explicit, serializable pipelines and a production-oriented focus. RAG and agentic RAG are patterns that Haystack implements — not the framework itself. Building blocks like embeddings and reranking are used by Haystack as components within its pipelines.

Entdecke mehr