rag-patterns

Optimize RAG pipeline chunking, embedding, and retrieval strategies.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/nist0/CoDev --skill rag-patterns-nist0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rag-patterns
Source: https://github.com/nist0/CoDev/tree/main/.github/skills/rag-patterns
Command: npx skills add https://github.com/nist0/CoDev --skill rag-patterns-nist0

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, sentence-transformers, asyncpg, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenges of building efficient and effective RAG (Retrieval-Augmented Generation) pipelines, providing robust chunking, embedding, and retrieval strategies.

Core Features & Use Cases

  • Expert Chunking: Implement optimal chunking strategies for efficient document processing.
  • Embedding Model Selection: Utilize the same embedding model for ingestion and query to ensure consistency.
  • Vector Store Operations: Index vectors with metadata for precise retrieval.
  • Hybrid Retrieval: Combine dense and sparse retrieval for comprehensive search.
  • Context-Window Assembly: Assemble retrieved chunks into a coherent prompt.
  • Hallucination Mitigation: Instruct models to stay grounded and verify claims.
  • Evaluation: Measure retrieval and generation quality for continuous improvement.
  • Use Case: Enhance the performance of a RAG pipeline for code documentation, improving recall and precision.

Quick Start

To start using the rag-patterns skill, run the following command in your terminal: ./.venv/bin/python tools/codev/scripts/validate-route-smoke.py

Frequently Asked Questions about rag-patterns

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

FAQPage Schema
How do I optimize chunking strategies for a RAG pipeline?

Optimize RAG pipeline chunking by implementing expert strategies for efficient document processing. This ensures code documentation and technical documents are segmented effectively for precise context retrieval.

What is the best way to combine dense and sparse retrieval for context assembly?

Combine dense and sparse retrieval for comprehensive search context assembly. This hybrid approach retrieves precise chunks, assembling them into a coherent prompt to instruct models and mitigate hallucinations.

Do I need openai and sentence-transformers to use cross-encoder reranking?

Yes, you need openai and sentence-transformers for embeddings and cross-encoder reranking. Utilizing the same embedding model for ingestion and query ensures consistency across your vector store operations.

How does vector store indexing with metadata improve RAG retrieval?

Vector store indexing with metadata improves RAG retrieval by enabling precise filtering during search. This enhances recall and precision when analyzing technical documents or mixed-content corpora.

Can I measure retrieval and generation quality for continuous improvement?

You can measure retrieval and generation quality through built-in evaluation mechanisms. This allows continuous improvement of your RAG pipeline by verifying claims and keeping models grounded.