What you get
- Seventeen retrieval and RAG patterns implemented using Haystack’s pipeline and component abstractions
- Full portability across Pinecone, Weaviate, Chroma, Milvus, and Qdrant (with feature-specific notes on backend support)
- YAML-driven configuration with environment variable substitution so credentials stay out of code
- Evaluation support via shared
utils/evaluation.pymetrics - Shared reusable components and helper factories that all feature pipelines draw from
Module structure
Each feature directory follows the same layout:Feature catalog
Semantic search
Dense vector similarity search - the baseline pattern
Hybrid search
Combines dense + sparse embeddings with RRF fusion
Components
Reusable pipeline components for routing, compression, and query enhancement
Pipelines
Pipeline architecture patterns and composition
Core retrieval patterns
| Feature | Description | Use when |
|---|---|---|
| semantic_search | Dense vector similarity search | Starting point and baseline |
| hybrid_indexing | Dense + sparse embeddings with RRF | Both semantic and keyword precision needed |
| sparse_indexing | Sparse-only retrieval | Pure keyword/lexical precision |
| reranking | Two-stage retrieval with cross-encoder | Better final ranking needed |
| mmr | Maximal Marginal Relevance | Relevant + diverse results |
| diversity_filtering | Similarity count filtering | Less redundant context |
Advanced retrieval
| Feature | Description | Use when |
|---|---|---|
| metadata_filtering | Structured constraints | Need to filter by attributes |
| json_indexing | JSON-native documents | Structured fields + semantic content |
| query_enhancement | Multi-query, HyDE, step-back | Better query recall |
| contextual_compression | Abstractive, extractive, relevance filtering | Shorter, cleaner context |
| parent_document_retrieval | Index children, retrieve parents | Long docs with fragment search |
Production features
| Feature | Description | Use when |
|---|---|---|
| cost_optimized_rag | Token/compute budget control | Cost reduction needed |
| agentic_rag | Multi-step iterative RAG with self-reflection | Complex multi-hop questions |
| multi_tenancy | Tenant-scoped isolation | Per-customer data isolation |
| namespaces | Logical segmentation | Environment separation |
Embedding configuration
All Haystack feature pipelines read embedding configuration from the YAML config:RAG configuration
Generation is controlled by therag section:
enabled: false to run retrieval-only pipelines without generation.
Recommended onboarding path
Run semantic search baseline
Start with
semantic_search on your target backend with a small dataset limit (100-200 records) and verify the pipeline loads, indexes, and retrieves successfully.Measure retrieval quality
Use
evaluation_queries() and evaluate_retrieval() to establish baseline metrics.Add improvements incrementally
Add one improvement feature at a time (e.g.,
reranking or hybrid_indexing) and measure whether quality improves on your evaluation set.Add production features
Once the retrieval baseline is strong, adopt
multi_tenancy or namespaces for data isolation, and cost_optimized_rag for budget controls.Supported backends
- Chroma: Local embedded vector database with SQLite persistence
- Milvus: High-performance distributed vector database
- Pinecone: Managed vector database with native sparse vector support
- Qdrant: Vector database with advanced filtering and multitenancy
- Weaviate: GraphQL-based vector database with semantic search
Next steps
Semantic search
Start with the baseline semantic search pattern
Hybrid search
Learn about dense + sparse hybrid retrieval
Components
Explore reusable pipeline components
Pipelines
Understand pipeline architecture patterns