rag-systems

Installation
SKILL.md

rag-systems

Core Philosophy

Retrieval-Augmented Generation (RAG) is not simply splitting a PDF into 500-character chunks, embedding them with OpenAI, and dumping them into a vector database. Naive RAG produces fragmented context, keyword mismatch, and hallucinated answers. Production-grade RAG is a precision information retrieval pipeline that combines semantic chunking, hybrid search (dense embeddings + sparse BM25), cross-encoder reranking, and rigorous automated evaluation using the RAG Triad.


4-Step Production RAG Engineering Pipeline

Step 1: Chunking Strategy & Document Decomposition

  1. Avoid Arbitrary Fixed-Length Splitting:
    • Fixed character counts cut mid-sentence, slicing critical context in half.
  2. High-Precision Chunking Archetypes:
    • Semantic / Markdown Chunking: Split strictly along document boundaries (#, ##, ###, code blocks).
    • Recursive Character Chunking with Overlap: Split by paragraph (`

), then sentence ( `), with 15–20% token overlap to preserve transitional context.

  • Parent-Document / Small-to-Big Retrieval: Embed small chunks (128 tokens) for precise vector matching, but return the larger parent chunk (1,024 tokens) to the LLM context for generation.
Installs
1
First Seen
5 days ago