Squash-merge verified routing remediation at exact head 690f9c14b0. Required validate and paired evaluation checks passed; advisory droid review had no blocking findings.
Build production search and NLP pipelines with Haystack. Pipeline DAG composition, document stores, retrievers, PromptBuilder (Jinja2), generators, evaluation, Hayhooks deployment. Use when building search pipelines or comparing NLP application frameworks. Do not use this skill for unrelated requests; route to the nearest named specialist.
Haystack (by deepset) is a production-oriented framework for building search and NLP pipelines. Its core abstraction is the Pipeline — a directed acyclic graph of typed components with explicit connections. Unlike LangChain's LCEL (pipe operator) or LlamaIndex's query engines, Haystack pipelines are declared upfront with add_component and connect, giving validated, debuggable DAGs.
Core Paradigm
fromhaystackimportPipelinefromhaystack.components.embeddersimportSentenceTransformersTextEmbedderfromhaystack.components.retrievers.in_memoryimportInMemoryEmbeddingRetrieverfromhaystack.components.buildersimportPromptBuilderfromhaystack.components.generatorsimportOpenAIGeneratorfromhaystack.document_stores.in_memoryimportInMemoryDocumentStore# Build a pipelinedocument_store=InMemoryDocumentStore()pipeline=Pipeline()pipeline.add_component("embedder",SentenceTransformersTextEmbedder())pipeline.add_component("retriever",InMemoryEmbeddingRetriever(document_store=document_store))pipeline.add_component("prompt_builder",PromptBuilder(template="Answer using: {{documents}}\n\nQuestion: {{question}}"))pipeline.add_component("generator",OpenAIGenerator())# Connect componentspipeline.connect("embedder.embedding","retriever.query_embedding")pipeline.connect("retriever.documents","prompt_builder.documents")pipeline.connect("prompt_builder","generator")# Runresult=pipeline.run({"embedder":{"text":"What is Haystack?"},"prompt_builder":{"question":"What is Haystack?"}})
Core Principles
Pipelines are validated DAGs. add_component + connect. Pipeline validation catches errors BEFORE execution — leverage this during development.
Components are typed. Each component has input/output slots. Connections must match types. This prevents runtime errors.
PromptBuilder uses Jinja2. Templates are Jinja2 strings, not f-strings. {{documents}}, {{query}}, {{question}} are variable placeholders.
Indexing and query are separate pipelines. One pipeline loads/cleans/embeds/writes documents. Another retrieves/generates answers. They share the DocumentStore.
Evaluation is a pipeline too. Add evaluator components to measure faithfulness, relevancy, or custom metrics.
Where to Start
You already have...
Start here
Nothing — exploring Haystack
Build a basic indexing + query pipeline
Documents to index
Build an indexing pipeline (converters, splitter, embedder, writer)
A search use case
Build a query pipeline (embedder, retriever, prompt, generator)