Skip to content
OpenSmartRoute
Skillv1.0.0

haystack

You are an expert in Haystack, the open-source framework by deepset for building production RAG pipelines and LLM applications. You help developers create composable pipelines with document stores, re

by terminalskills(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from terminalskills/skills (skills/haystack/SKILL.md). Install upstream with npx skills add terminalskills/skills --skill haystack. Copyright stays with the author (Apache-2.0).

Haystack — LLM Application Framework by deepset

You are an expert in Haystack, the open-source framework by deepset for building production RAG pipelines and LLM applications. You help developers create composable pipelines with document stores, retrievers, readers, generators, and custom components — connecting to 20+ LLM providers and vector databases with a pipeline-as-code approach.

Core Capabilities

RAG Pipeline

from haystack import Pipeline
from haystack.components.embedders import OpenAIDocumentEmbedder, OpenAITextEmbedder
from haystack.components.writers import DocumentWriter
from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever
from haystack.components.generators import OpenAIGenerator
from haystack.components.builders import PromptBuilder
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack import Document

store = InMemoryDocumentStore()

# Indexing pipeline
indexing = Pipeline()
indexing.add_component("embedder", OpenAIDocumentEmbedder())
indexing.add_component("writer", DocumentWriter(document_store=store))
indexing.connect("embedder", "writer")

docs = [Document(content="Haystack supports 20+ LLM providers..."), Document(content="Pipelines are composable...")]
indexing.run({"embedder": {"documents": docs}})

# Query pipeline
template = """Given these documents, answer the question.
Documents: {% for doc in documents %}{{ doc.content }}{% endfor %}
Question: {{ question }}
Answer:"""

rag = Pipeline()
rag.add_component("embedder", OpenAITextEmbedder())
rag.add_component("retriever", InMemoryEmbeddingRetriever(document_store=store))
rag.add_component("prompt", PromptBuilder(template=template))
rag.add_component("llm", OpenAIGenerator(model="gpt-4o"))
rag.connect("embedder.embedding", "retriever.query_embedding")
rag.connect("retriever", "prompt.documents")
rag.connect("prompt", "llm")

result = rag.run({"embedder": {"text": "What providers does Haystack support?"}, "prompt": {"question": "What providers?"}})
print(result["llm"]["replies"][0])

Custom Components

from haystack import component

@component
class MetadataFilter:
    @component.output_types(documents=list[Document])
    def run(self, documents: list[Document], category: str):
        return {"documents": [d for d in documents if d.meta.get("category") == category]}

Installation

pip install haystack-ai

Best Practices

  1. Pipeline-as-code — Connect components explicitly; clear data flow, easy debugging
  2. Document stores — InMemory for dev, Qdrant/Pinecone/Weaviate for production
  3. PromptBuilder — Jinja2 templates for dynamic prompts; inject documents, history, metadata
  4. Custom components — Use @component decorator; define inputs/outputs, Haystack handles wiring
  5. Branching — Pipelines support conditional routing; different paths based on query type
  6. Serializationpipeline.dumps() / Pipeline.loads() for saving/loading pipeline configs
  7. Evaluation — Built-in eval components for faithfulness, relevance, answer correctness
  8. Streaming — Use OpenAIGenerator(streaming_callback=...) for real-time token delivery

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/terminalskills-skills-haystack/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

terminalskills-skills-haystack.ocm.jsonjson
{
  "ocm": "1",
  "id": "terminalskills-skills-haystack",
  "kind": "skill",
  "name": "haystack",
  "description": "You are an expert in Haystack, the open-source framework by deepset for building production RAG pipelines and LLM applications. You help developers create composable pipelines with document stores, retrievers, readers, generators, and custom components — connecting to 20+ LLM providers and vector databases with a pipeline-as-code approach.",
  "publisher": "terminalskills",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding",
      "math"
    ],
    "tags": [
      "skill-md",
      "rag",
      "pipeline",
      "nlp",
      "search",
      "retrieval",
      "deepset",
      "python",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "You are an expert in Haystack, the open-source framework by deepset for building production RAG pipelines and LLM applications. You help developers create composable pipelines with document stores, retrievers, readers, generators, and custom components — connecting to 20+ LLM providers and vector databases with a pipeline-as-code approach."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/terminalskills/skills",
      "path": "skills/haystack/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/terminalskills/skills/blob/HEAD/skills/haystack/SKILL.md",
      "key": "terminalskills/skills/skills/haystack/SKILL.md"
    },
    "license": "Apache-2.0"
  },
  "instructions": "# Haystack — LLM Application Framework by deepset\n\nYou are an expert in Haystack, the open-source framework by deepset for building production RAG pipelines and LLM applications. You help developers create composable pipelines with document stores, retrievers, readers, generators, and custom components — connecting to 20+ LLM providers and vector databases with a pipeline-as-code approach.\n\n## Core Capabilities\n\n### RAG Pipeline\n\n```python\nfrom haystack import Pipeline\nfrom haystack.components.embedders import OpenAIDocumentEmbedder, OpenAITextEmbedder\nfrom haystack.components.writers import D",
  "cost": {
    "context_tokens": 801
  }
}

Fetch it by URL: GET /api/v1/registry/terminalskills-skills-haystack/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.