rag-patterns

Optimize RAG retrieval with chunking, embedding, hybrid search, and reranking patterns.

6|1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/kmshihab7878/claude-code-setup --skill rag-patterns-kmshihab7878
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rag-patterns
Source: https://github.com/kmshihab7878/claude-code-setup/tree/main/skills/rag-patterns
Command: npx skills add https://github.com/kmshihab7878/claude-code-setup --skill rag-patterns-kmshihab7878

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

RAG patterns and optimization reduce irrelevant or missing context in LLM responses by improving how documents are chunked, embedded, retrieved, and re-ranked so answers are accurate and concise.

Core Features & Use Cases

  • Chunking Strategies: Fixed, recursive, semantic, sentence-based, and parent-child patterns for precise retrieval.
  • Embedding Selection: Guidance on model choice by quality, cost, dimensionality, and context length.
  • Retrieval Optimization: Hybrid search, query expansion, reranking, and semantic caching patterns.
  • Multimodal & Agentic RAG: Document parsing for text/tables/images and agent routers that combine tools (SQL, APIs, calculators).
  • Memory & Evaluation: Episodic memory patterns, MCP integration, and RAG-specific metrics for faithfulness and context recall.
  • Use Case Examples: Document Q&A, agent memory systems, multimodal document processing, and production RAG pipelines.

Quick Start

Invoke the rag-patterns skill to audit and recommend chunking, embedding, and retrieval settings for the current document corpus.

Frequently Asked Questions about rag-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve retrieval quality and reduce irrelevant context in my RAG pipeline?

Improve RAG retrieval quality by optimizing chunking strategies, selecting appropriate embedding models, and applying hybrid search with reranking to ensure LLM responses are accurate and concise.

What chunking strategy works best for precise document retrieval in large corpora?

Fixed, recursive, semantic, sentence-based, and parent-child chunking patterns provide precise retrieval for large corpora by segmenting documents into optimal context windows for embedding.

How does hybrid search and reranking work for production retrieval deployments?

Hybrid search combines multiple retrieval methods, while reranking reorders results by relevance to optimize LLM context and reduce missing or irrelevant information in production deployments.

Can I parse tables and images for multimodal RAG with this approach?

Multimodal RAG parsing handles text, tables, and images, enabling document Q&A and multimodal processing by integrating diverse data formats into the retrieval pipeline.

How do I evaluate faithfulness and context recall in agentic RAG systems?

Evaluate agentic RAG systems using specific metrics for faithfulness and context recall, alongside episodic memory patterns and MCP integration hooks to measure retrieval accuracy.

What is the best way to select an embedding model for agent memory systems?

Select embedding models for agent memory by evaluating quality, cost, dimensionality, and context length to match retrieval requirements and optimize production knowledge systems.