Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Rag Pipelines?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-rag-pipelines)
---
description: Build retrieval-augmented generation that cites sources: chunking, embeddings, hybrid search, reranking and evals
profile: standard
tags: ai, llm, search, data
---
# RAG pipelines
Use when an application answers questions from your own documents.
## Ingest
1. Clean and normalize documents. Keep titles, headings, URLs and timestamps as metadata.
2. Chunk on structure (headings, paragraphs) at a few hundred tokens with small overlap. Never split tables or code blocks mid-way.
3. Store chunk id, source id, position and access permissions with every vector.
## Retrieve
- Hybrid search: BM25 or keyword plus vector similarity. Keywords catch ids, error codes and names that embeddings miss.
- Filter by permissions and metadata before ranking, so users never retrieve text they cannot see.
- Rerank the top candidates with a cross-encoder or reranker model. Send the model only the best few chunks.
## Generate
- Instruct the model to answer only from the provided context, cite chunk ids, and say when the context does not contain the answer.
- Treat retrieved text as untrusted input: it may contain prompt injection. Keep system instructions outside it.
## Evaluate
- Build a labelled set of real questions with expected sources.
- Measure retrieval (recall@k of the right source) separately from answer quality (faithfulness to sources, correctness).
- Re-run the set on every change to chunking, embeddings, prompts or models, and compare before shipping.
## Operate
Re-index on document change, version the index with the embedding model, and log queries with retrieved ids (not personal data) to find gaps.