SkillsApr 2, 2026·3 min read

Haystack — Production RAG & Agent Framework

Build composable AI pipelines for RAG, agents, and search. Model-agnostic, production-ready, by deepset. 18K+ stars.

TO
TokRepo精选 · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

```bash pip install haystack-ai ``` ```python from haystack import Pipeline from haystack.components.generators import OpenAIGenerator from haystack.components.builders import PromptBuilder prompt = PromptBuilder(template="Answer: {{question}}") llm = OpenAIGenerator(model="gpt-4o") pipe = Pipeline() pipe.add_component("prompt", prompt) pipe.add_component("llm", llm) pipe.connect("prompt", "llm") result = pipe.run({"prompt": {"question": "What is RAG?"}}) print(result["llm"]["replies"][0]) ```
## Introduction Haystack is a **production-grade framework for building RAG pipelines, AI agents, and search systems**. Created by deepset, it provides composable building blocks that snap together into complex AI applications — from simple question answering to multi-step agents with tool use. Core capabilities: - **Composable Pipelines** — Build AI workflows by connecting modular components: retrievers, readers, generators, rankers, and more. Type-safe connections prevent runtime errors - **RAG Out of the Box** — Pre-built components for document indexing, embedding, retrieval, and generation. Support for 15+ vector stores and all major embedding models - **AI Agents** — Build agents with tool use, planning, and multi-step reasoning. Agents can call pipelines as tools, enabling complex nested workflows - **Model Agnostic** — Works with OpenAI, Anthropic, Google, Cohere, Hugging Face, Ollama, and any custom model. Switch providers without rewriting pipeline logic - **Document Processing** — Convert PDFs, DOCX, HTML, and more into indexed documents. Built-in preprocessing, splitting, and cleaning - **Evaluation** — Built-in evaluation framework to measure RAG quality with metrics like faithfulness, relevance, and context precision - **Production Ready** — Serializable pipelines, async execution, streaming, and deployment-ready with REST API generation 18,000+ GitHub stars. Used in production by enterprises for knowledge management, customer support, and document intelligence. ## FAQ **Q: How is Haystack different from LangChain?** A: Haystack focuses on type-safe, composable pipelines with strong production guarantees. LangChain is more flexible but less opinionated. Haystack pipelines are serializable (save/load as YAML) and have built-in evaluation. Choose Haystack for production RAG, LangChain for rapid prototyping. **Q: Can I use it with local models?** A: Yes. Haystack supports Ollama, Hugging Face Transformers, and any OpenAI-compatible local server. Run your entire pipeline offline. **Q: Does it support streaming?** A: Yes. Haystack 2.x has built-in streaming support. Responses stream token by token from generators through the pipeline to your application. **Q: Is it free?** A: Haystack is fully open source (Apache 2.0). deepset offers a commercial platform (deepset Cloud) for managed deployment, but the framework itself is free. ## Works With - OpenAI / Anthropic / Google / Cohere / Ollama for LLMs - Weaviate / Qdrant / Pinecone / Chroma / Elasticsearch for vector stores - Hugging Face models for embeddings and reranking - FastAPI for REST API deployment - Docker / Kubernetes for production scaling
🙏

Source & Thanks

- GitHub: [deepset-ai/haystack](https://github.com/deepset-ai/haystack) - License: Apache 2.0 - Stars: 18,000+ - Maintainer: deepset GmbH Thanks to the deepset team for building the most production-oriented RAG framework, proving that AI pipelines can be both composable and reliable enough for enterprise deployment.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets