rag-pipeline-designer
RAG Pipeline Designer
Overview
Keywords: RAG, retrieval-augmented generation, chunking, embeddings, vector database, hybrid search, BM25, dense retrieval, reranking, cross-encoder, recall@k, MRR, nDCG, faithfulness, context window, query expansion, semantic search.
This skill turns a vague "we want to do RAG over our docs" into a concrete, defensible architecture with tradeoffs made explicit. A RAG pipeline is a sequence of lossy stages — each stage can silently throw away the right answer. The job is to identify which stage is failing (or will fail) and pick components that fit the corpus, query distribution, latency budget, and cost ceiling.
Treat RAG design as five decisions made in order, with evaluation wrapped around all of them:
- Ingestion & chunking — how documents become retrievable units.
- Embedding & indexing — how units become searchable vectors (and/or keyword index).
- Retrieval — how a query fetches candidates.
- Reranking & context assembly — how candidates are ordered and packed into the prompt.
- Generation — how the LLM is grounded and constrained.
- Evaluation — how you prove each stage works, offline, before shipping.
Read references/component-catalog.md for concrete component options and references/evaluation-metrics.md for the metric definitions. Use scripts/chunk_text.py to produce candidate chunkings and scripts/eval_retrieval.py to score retrieval against a labeled set. Fill in templates/rag-design-doc.md to capture the final design. See examples/support-kb-rag.md for a complete worked design.