rag-retrieval-patterns

Configure dense, sparse, and hybrid document retrieval for RAG pipelines.

7|1|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/fratilanico/apex-os-bad-boy --skill rag-retrieval-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rag-retrieval-patterns
Source: https://github.com/fratilanico/apex-os-bad-boy/tree/main/rag-retrieval-patterns
Command: npx skills add https://github.com/fratilanico/apex-os-bad-boy --skill rag-retrieval-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams design, debug, and optimize retrieval-augmented generation (RAG) pipelines by selecting and combining dense, sparse, and hybrid retrieval strategies to improve excerpt relevance and grounding in documents.

Core Features & Use Cases

  • Decision-tree guidance for choosing between BM25, dense embeddings, and hybrid pipelines.
  • Concrete implementation patterns, including dense retrieval, BM25, and cross-encoder reranking.
  • Use cases include QA systems, document-grounded assistants, and knowledge-base search pipelines.

Quick Start

Describe a retriever setup and this skill configures a hybrid RAG pipeline leveraging dense, sparse, and reranking for your documents.

Frequently Asked Questions about rag-retrieval-patterns

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

FAQPage Schema
How do I choose between BM25 and dense embeddings for my RAG pipeline?

Choosing between BM25 and dense embeddings for a RAG pipeline depends on your query type: BM25 handles exact keyword matches while dense embeddings capture semantic meaning. This Skill provides decision-tree guidance to select the right retrieval strategy.

What is the best way to combine sparse and dense retrieval for document search?

The best way to combine sparse and dense retrieval for document search is a hybrid RAG pipeline. This Skill configures hybrid pipelines that merge BM25 and dense vector search, then applies cross-encoder reranking to maximize excerpt relevance.

How do I integrate vector search and reranking into a knowledge-grounded assistant?

To integrate vector search and reranking into a knowledge-grounded assistant, you describe a retriever setup and this Skill configures the hybrid pipeline. It supports modular components like embeddings models and cross-encoders to generate grounded answers with source cites.

When should I use cross-encoder reranking in a retrieval-augmented generation workflow?

Use cross-encoder reranking in a retrieval-augmented generation workflow when initial dense or sparse retrieval yields too many low-relevance documents. Reranking filters and reorders excerpts to improve grounding and answer accuracy for QA systems.

Why does my hybrid RAG pipeline return irrelevant excerpts despite using dense embeddings?

Irrelevant excerpts in a hybrid RAG pipeline often occur when dense embeddings alone miss exact keyword matches or lack reranking. Adding BM25 for sparse retrieval and cross-encoder reranking improves excerpt relevance and document grounding.