/rag-retrieval
Retrieval-Augmented Generation patterns for grounded LLM responses. Use when building RAG pipelines, embedding documents, implementing hybrid search, contextual retrieval, HyDE, agentic RAG, multimodal RAG, query decomposition, reranking, or pgvector search.
$ npx -y skills add yonatangross/orchestkit --skill rag-retrieval --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/rag-retrieval
Context preview
The summary Claude sees to decide when to auto-load this skill.
Retrieval-Augmented Generation patterns for grounded LLM responses. Use when building RAG pipelines, embedding documents, implementing hybrid search, contextual retrieval, HyDE, agentic RAG, multimodal RAG, query decomposition, reranking, or pgvector search.
SKILL.md
rag-retrieval.SKILL.mdname: rag-retrieval
license: MIT
compatibility: "Claude Code 2.1.220+."
description: Retrieval-Augmented Generation patterns for grounded LLM responses. Use when building RAG pipelines, embedding documents, implementing hybrid search, contextual retrieval, HyDE, agentic RAG, multimodal RAG, query decomposition, reranking, or pgvector search.
tags: [rag, retrieval, llm, context, grounding, embeddings, hyde, reranking, pgvector, multimodal]
context: fork
agent: data-pipeline-engineer
version: 2.0.0
author: OrchestKit
user-invocable: false
disable-model-invocation: true
complexity: high
persuasion-type: reference
effort: high
metadata:
category: mcp-enhancement
allowed-tools:
- Read
- Glob
- Grep
- WebFetch
- WebSearch
path_patterns: ["**/rag/**", "**/retrieval/**", "**/embeddings/**", "**/vector/**"]
RAG Retrieval
Comprehensive patterns for building production RAG systems. Each category has individual rule files in `rules/` loaded on-demand.
House thresholds, fusion ordering, and the latency and quality budgets we assert live in `references/ork-delta.md`. Vendor documentation is linked, not restated (see [Upstream coverage](#upstream-coverage-do-not-restate)).
Quick Reference
| Category | Rules | Impact | When to Use | |----------|-------|--------|-------------| | [Core RAG](#core-rag) | 4 | CRITICAL | Basic RAG, citations, hybrid search, context management | | [Embeddings](#embeddings) | 3 | HIGH | Model selection, chunking, batch/cache optimization | | [Contextual Retrieval](#contextual-retrieval) | 3 | HIGH | Context-prepending, hybrid BM25+vector, pipeline | | [HyDE](#hyde) | 3 | HIGH | Vocabulary mismatch, hypothetical document generation | | [Agentic RAG](#agentic-rag) | 4 | HIGH | Self-RAG, CRAG, knowledge graphs, adaptive routing | | [Multimodal RAG](#multimodal-rag) | 3 | MEDIUM | Image+text retrieval, PDF chunking, cross-modal search | | [Query Decomposition](#query-decomposition) | 3 | MEDIUM | Multi-concept queries, parallel retrieval, RRF fusion | | [Reranking](#reranking) | 3 | MEDIUM | Cross-encoder, LLM scoring, combined signals | | [PGVector](#pgvector) | 4 | HIGH | PostgreSQL hybrid search, HNSW indexes, schema design |
**Total: 30 rules across 9 categories**
Core RAG
Fundamental patterns for retrieval, generation, and pipeline composition.
| Rule | File | Key Pattern | |------|------|-------------| | Basic RAG | `rules/core-basic-rag.md` | Retrieve + context + generate with citations | | Hybrid Search | `rules/core-hybrid-search.md` | RRF fusion (k=60) for semantic + keyword | | Context Management | `rules/core-context-management.md` | Token budgeting + sufficiency check | | Pipeline Composition | `rules/core-pipeline-composition.md` | Composable Decompose → HyDE → Retrieve → Rerank |
Embeddings
Embedding models, chunking strategies, and production optimization.
| Rule | File | Key Pattern | |------|------|-------------| | Models & API | `rules/embeddings-models.md` | Model selection, batch API, similarity | | Chunking | `rules/embeddings-chunking.md` | Semantic boundary splitting, 512 token sweet spot | | Advanced | `rules/embeddings-advanced.md` | Redis cache, Matryoshka dims, batch processing |
Contextual Retrieval
Anthropic's context-prepending technique — 67% fewer retrieval failures.
| Rule | File | Key Pattern | |------|------|-------------| | Context Prepending | `rules/contextual-prepend.md` | LLM-generated context + prompt caching | | Hybrid Search | `rules/contextual-hybrid.md` | 40% BM25 / 60% vector weight split | | Complete Pipeline | `rules/contextual-pipeline.md` | End-to-end indexing + hybrid retrieval |
HyDE
Hypothetical Document Embeddings for bridging vocabulary gaps.
| Rule | File | Key Pattern | |------|------|-------------| | Generation | `rules/hyde-generation.md` | Embed hypothetical doc, not query | | Per-Concept | `rules/hyde-per-concept.md` | Parallel HyDE for multi-topic queries | | Fallback | `rules/hyde-fallback.md` | 2-3s timeout → direct embedding fallback |
Agentic RAG
Self-correcting retrieval with LLM-driven decision making.
| Rule | File | Key Pattern | |------|------|-------------| | Self-RAG | `rules/agentic-self-rag.md` | Binary document grading for relevance | | Corrective RAG | `rules/agentic-corrective-rag.md` | CRAG workflow with web fallback | | Knowledge Graph | `rules/agentic-knowledge-graph.md` | KG + vector hybrid for entity-rich domains | | Adaptive Retrieval | `rules/agentic-adaptive-retrieval.md` | Query routing to optimal strategy |
Multimodal RAG
Image + text retrieval with cross-modal search.
| Rule | File | Key Pattern | |------|------|-------------| | Embeddings | `rules/multimodal-embeddings.md` | CLIP, SigLIP 2, Voyage multimodal-3 | | Chunking | `rules/multimodal-chunking.md` | PDF extraction preserving images | | Pipeline | `rules/multimodal-pipeline.md` | Dedup + hybrid retrieval + generation |
Query Decomposition
Breaking complex queries into concepts for parallel retrieval.
| Rule | File | Key Pattern | |------|------|-------------| | Detection | `rules/query-detection.md` | Heuristic indicators (<1ms fast path) | | Decompose + RRF | `rules/query-decompose.md` | LLM concept extraction + parallel retrieval | | HyDE Combo | `rules/query-hyde-combo.md` | Decompose + HyDE for maximum coverage |
Reranking
Post-retrieval re-scoring for higher precision.
| Rule | File | Key Pattern | |------|------|-------------| | Cross-Encoder | `rules/reranking-cross-encoder.md` | ms-marco-MiniLM (~50ms, free) | | LLM Reranking | `rules/reranking-llm.md` | Batch scoring + Cohere API | | Combined | `rules/reranking-combined.md` | Multi-signal weighted scoring |
PGVector
Production hybrid search with PostgreSQL.
| Rule | File | Key Pattern | |------|------|-------------| | Schema | `rules/pgvector-schema.md` | HNSW index + pre-computed tsvector | | Hybrid Search | `rules/pgvector-hybrid-search.md` | SQLAlchemy RRF with FULL OUTER JOIN | | Indexing
Read more
name: rag-retrieval license: MIT compatibility: "Claude Code 2.1.220+." description: Retrieval-Augmented Generation patterns for grounded LLM responses. Use when building RAG pipelines, embedding documents, implementing hybrid search, contextual retrieval, HyDE, agentic RAG, multimodal RAG, query decomposition, reranking, or pgvector search. tags: [rag, retrieval, llm, context, grounding, embeddings, hyde, reranking, pgvector, multimodal] context: fork agent: data-pipeline-engineer version: 2.0.0 author: OrchestKit user-invocable: false disable-model-invocation: true complexity: high persuasion-type: reference effort: high metadata: category: mcp-enhancement allowed-tools: - Read - Glob - Grep - WebFetch - WebSearch path_patterns: ["**/rag/**", "**/retrieval/**", "**/embeddings/**", "**/vector/**"]
RAG Retrieval
Comprehensive patterns for building production RAG systems. Each category has individual rule files in `rules/` loaded on-demand.
House thresholds, fusion ordering, and the latency and quality budgets we assert live in `references/ork-delta.md`. Vendor documentation is linked, not restated (see [Upstream coverage](#upstream-coverage-do-not-restate)).
Quick Reference
| Category | Rules | Impact | When to Use | |----------|-------|--------|-------------| | [Core RAG](#core-rag) | 4 | CRITICAL | Basic RAG, citations, hybrid search, context management | | [Embeddings](#embeddings) | 3 | HIGH | Model selection, chunking, batch/cache optimization | | [Contextual Retrieval](#contextual-retrieval) | 3 | HIGH | Context-prepending, hybrid BM25+vector, pipeline | | [HyDE](#hyde) | 3 | HIGH | Vocabulary mismatch, hypothetical document generation | | [Agentic RAG](#agentic-rag) | 4 | HIGH | Self-RAG, CRAG, knowledge graphs, adaptive routing | | [Multimodal RAG](#multimodal-rag) | 3 | MEDIUM | Image+text retrieval, PDF chunking, cross-modal search | | [Query Decomposition](#query-decomposition) | 3 | MEDIUM | Multi-concept queries, parallel retrieval, RRF fusion | | [Reranking](#reranking) | 3 | MEDIUM | Cross-encoder, LLM scoring, combined signals | | [PGVector](#pgvector) | 4 | HIGH | PostgreSQL hybrid search, HNSW indexes, schema design |
**Total: 30 rules across 9 categories**
Core RAG
Fundamental patterns for retrieval, generation, and pipeline composition.
| Rule | File | Key Pattern | |------|------|-------------| | Basic RAG | `rules/core-basic-rag.md` | Retrieve + context + generate with citations | | Hybrid Search | `rules/core-hybrid-search.md` | RRF fusion (k=60) for semantic + keyword | | Context Management | `rules/core-context-management.md` | Token budgeting + sufficiency check | | Pipeline Composition | `rules/core-pipeline-composition.md` | Composable Decompose → HyDE → Retrieve → Rerank |
Embeddings
Embedding models, chunking strategies, and production optimization.
| Rule | File | Key Pattern | |------|------|-------------| | Models & API | `rules/embeddings-models.md` | Model selection, batch API, similarity | | Chunking | `rules/embeddings-chunking.md` | Semantic boundary splitting, 512 token sweet spot | | Advanced | `rules/embeddings-advanced.md` | Redis cache, Matryoshka dims, batch processing |
Contextual Retrieval
Anthropic's context-prepending technique — 67% fewer retrieval failures.
| Rule | File | Key Pattern | |------|------|-------------| | Context Prepending | `rules/contextual-prepend.md` | LLM-generated context + prompt caching | | Hybrid Search | `rules/contextual-hybrid.md` | 40% BM25 / 60% vector weight split | | Complete Pipeline | `rules/contextual-pipeline.md` | End-to-end indexing + hybrid retrieval |
HyDE
Hypothetical Document Embeddings for bridging vocabulary gaps.
| Rule | File | Key Pattern | |------|------|-------------| | Generation | `rules/hyde-generation.md` | Embed hypothetical doc, not query | | Per-Concept | `rules/hyde-per-concept.md` | Parallel HyDE for multi-topic queries | | Fallback | `rules/hyde-fallback.md` | 2-3s timeout → direct embedding fallback |
Agentic RAG
Self-correcting retrieval with LLM-driven decision making.
| Rule | File | Key Pattern | |------|------|-------------| | Self-RAG | `rules/agentic-self-rag.md` | Binary document grading for relevance | | Corrective RAG | `rules/agentic-corrective-rag.md` | CRAG workflow with web fallback | | Knowledge Graph | `rules/agentic-knowledge-graph.md` | KG + vector hybrid for entity-rich domains | | Adaptive Retrieval | `rules/agentic-adaptive-retrieval.md` | Query routing to optimal strategy |
Multimodal RAG
Image + text retrieval with cross-modal search.
| Rule | File | Key Pattern | |------|------|-------------| | Embeddings | `rules/multimodal-embeddings.md` | CLIP, SigLIP 2, Voyage multimodal-3 | | Chunking | `rules/multimodal-chunking.md` | PDF extraction preserving images | | Pipeline | `rules/multimodal-pipeline.md` | Dedup + hybrid retrieval + generation |
Query Decomposition
Breaking complex queries into concepts for parallel retrieval.
| Rule | File | Key Pattern | |------|------|-------------| | Detection | `rules/query-detection.md` | Heuristic indicators (<1ms fast path) | | Decompose + RRF | `rules/query-decompose.md` | LLM concept extraction + parallel retrieval | | HyDE Combo | `rules/query-hyde-combo.md` | Decompose + HyDE for maximum coverage |
Reranking
Post-retrieval re-scoring for higher precision.
| Rule | File | Key Pattern | |------|------|-------------| | Cross-Encoder | `rules/reranking-cross-encoder.md` | ms-marco-MiniLM (~50ms, free) | | LLM Reranking | `rules/reranking-llm.md` | Batch scoring + Cohere API | | Combined | `rules/reranking-combined.md` | Multi-signal weighted scoring |
PGVector
Production hybrid search with PostgreSQL.
| Rule | File | Key Pattern | |------|------|-------------| | Schema | `rules/pgvector-schema.md` | HNSW index + pre-computed tsvector | | Hybrid Search | `rules/pgvector-hybrid-search.md` | SQLAlchemy RRF with FULL OUTER JOIN | | Indexing
Showing the first part of this file.
The Complete AI Development Toolkit for Claude Code — 114 skills, 37 agents, 212 hooks. Production-ready patterns for full-stack development.
Repo: yonatangross/orchestkit
Other skills on orchestkit.
- /accessibility
Accessibility patterns for WCAG 2.2 compliance, keyboard focus management, React Aria component patterns, cognitive inclusion, native HTML-first philosophy, and user preference honoring. Use when implementing screen reader support, keyboard navigation, ARIA patterns, focus
Open skill - /agent-orchestration
Agent orchestration patterns for agentic loops, multi-agent coordination, alternative frameworks, and multi-scenario workflows. Use when building autonomous agent loops, coordinating multiple agents, evaluating CrewAI/AutoGen/Swarm, or orchestrating complex multi-step scenarios.
Open skill - /ai-ui-generation
AI-assisted UI generation patterns for json-render, v0.app, Google Stitch, Bolt Cloud, and Cursor workflows. Covers prompt engineering for component and full-stack app generation, review checklists for AI-generated code, design token injection, refactoring for design system
Open skill - /analytics
Queries local analytics across OrchestKit projects for agent usage, skill frequency, hook timing, team activity, session replay, cost estimation, and model delegation trends. Privacy-safe with hashed project IDs. Supports time-range filtering and comparative analysis. Use when
Open skill - /animation-motion-design
Animation and motion design patterns using Motion library (formerly Framer Motion) and View Transitions API. Use when implementing component animations, page transitions, micro-interactions, gesture-driven UIs, or ensuring motion accessibility with prefers-reduced-motion.
Open skill - /api-design
API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows, RFC 9457 Problem Details error handling, and OpenAPI specs. Use when specifying the wire contract an endpoint exposes, choosing a versioning scheme, or
Open skill

