---
name: "haystack-modular-rag-pipelines"
description: "Design modular, observable RAG and search pipelines with Haystack 2.0 component graphs."
metadata:
  author: "deepset-ai"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "build haystack 2.0 pipeline"
  - "create custom haystack component"
  - "connect components haystack"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Haystack 2.0 Modular Component Graph Pipelines

Assembles data processing graphs with deepset Haystack 2.0: Pipeline, DocumentStore, InMemoryEmbeddingRetriever, PromptBuilder, OpenAIGenerator, and custom @component nodes.

## When to Invoke
Invoke this skill whenever you need to:
- build haystack 2.0 pipeline
- create custom haystack component
- connect components haystack

## Execution SOP & Rules
1. Create pipelines with pipeline = Pipeline() and add components via pipeline.add_component().
2. Connect inputs and outputs explicitly: pipeline.connect('retriever.documents', 'prompt_builder.documents').
3. Decorate custom components with @component and declare typed @component.output_types.
4. Execute pipelines with pipeline.run({ 'prompt_builder': { 'query': user_query } }).

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
