rag-pipeline-design

rag-pipeline-design is a skill for Claude Code from RBraga01/builder-ai. It costs 40 tokens per session (1,255 once invoked), scanned A, original, MIT.

A design guide for retrieval-augmented generation (RAG), a system that lets an AI find relevant information before answering. It requires checking the source data and expected questions before choosing how retrieval should work.

In plain words
What is it for?
Use it when building or debugging a RAG feature, or when changing document ingestion, chunking, embeddings, search, or reranking.
Why use it?
It avoids using default document splitting or search settings that may miss important context or produce unreliable answers. Each pipeline choice is based on the data and the kinds of questions users ask.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the builder-ai plugin — 8 skills, 5 agents shipped together

Good fit Use it when building or debugging a RAG feature, or when changing document ingestion, chunking, embeddings, search, or reranking.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rbraga01/builder-ai/rag-pipeline-design
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add RBraga01/builder-ai --skill rag-pipeline-design
Clone the repo
git clone --depth 1 https://github.com/RBraga01/builder-ai

Made for: Claude Code.

Or install builder-ai, the plugin that ships this one along with the rest of its 8 skills, 5 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rag-pipeline-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/rbraga01/builder-ai/rag-pipeline-design/github.svg)](https://agentmods.dev/skills/rbraga01/builder-ai/rag-pipeline-design)
Your own site
<a href="https://agentmods.dev/skills/rbraga01/builder-ai/rag-pipeline-design"><img src="https://agentmods.dev/badge/skills/rbraga01/builder-ai/rag-pipeline-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rag-pipeline-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/rbraga01/builder-ai/rag-pipeline-design"><img src="https://agentmods.dev/badge/skills/rbraga01/builder-ai/rag-pipeline-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,255 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.01255
Opus 5 $0.00020 $0.00628
Sonnet 5 $0.00008 $0.00251
Haiku 4.5 $0.00004 $0.00126

Measured 10d ago against content hash 93d5125d3471, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

rag-pipeline-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/rag-pipeline-design/SKILL.md · 130 lines

How it starts

The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RAG Pipeline Design

The Law

YOU CANNOT DESIGN A RAG PIPELINE WITHOUT FIRST AUDITING THE DATA AND THE QUERIES.
"Standard chunking" fails on structured documents.
"The embedding model worked for someone else" is not a validation.
A data audit + query audit + stage-by-stage decision log IS a design.

When to Use

Trigger when:

  • Starting a new RAG feature from scratch
  • Debugging retrieval quality issues (hallucination, missed context, low recall)
  • Upgrading an embedding model or retrieval strategy
  • Adding or removing a reranker
  • Changing chunk size, overlap, or ingestion strategy

The Process

A RAG pipeline has five stages. Design each explicitly — do not accept defaults.

Step 0 — Audit Before Designing

Answer both audits before making any pipeline decision:

Data Audit:

  • Source format: PDF / HTML / JSON / code / mixed?
  • Average document length (tokens)?
  • Is document structure (headings, sections, tables) load-bearing for meaning?
  • How frequently does content change?
  • Any formatting that will survive chunking (tables, numbered lists, code blocks)?

Query Audit:

  • Dominant query type: lookup / comparison / synthesis / aggregation?
  • Expected answer length: short fact / paragraph / multi-section?
  • Does the user need source attribution?
  • Is multi-hop reasoning required (answer requires combining facts across documents)?

Every design decision below flows from these two audits.

Step 1 — Chunking

Document Type Strategy Chunk Size Overlap
Prose / narrative Sentence boundary 256–400 tokens 15%
Structured (headings, sections) Section boundary 512–800 tokens 10%
Code Function / class boundary Variable None
Tables / CSV Row or row-group 128–256 tokens None

Always attach metadata to every chunk: source, date, section, page, chunk_index.

Step 2 — Embedding

Choose based on domain, not on general benchmark:

  1. Select 3 candidate models
  2. Build a 20-example similarity test set from your actual corpus (10 similar pairs, 10 dissimilar)
  3. Run all 3 candidates against the test set
  4. Pick the model with the highest correct rank correlation on your domain

Read the full file on GitHub · 130 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 130 lines · 40 tokens per session scan A 93d5125d3471

Subscribe to this mod's changes

rag-pipeline-design is a skill published in the GitHub repository RBraga01/builder-ai (2 stars, last pushed 3d ago), licensed MIT. It adds 40 tokens to every session and 1,255 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ai-engineering-toolkit

6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.

sickn33/agentic-awesome-skills · 47 tokens

ai-engineering-toolkit

AI Engineering Toolkit workflow skill. Use this skill when the user needs 6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching and the operator…

diegosouzapw/awesome-omni-skills · 81 tokens

rag-answerer

RAG answerer that only answers from supplied context.

lizhiyao/oh-my-knowledge · 15 tokens

fetch-llm-papers

Workflow for updating the LLM landscape paper pool (section/xllmpapers.md) using fetchllmpapers.py. Covers full re-fetch, resume from checkpoint, and adding new topics. USE FOR: Refreshing citation counts, expanding topic coverage. DO NOT USE FOR: Adding hand-curated entries to section files (use…

kimtth/azure-openai-llm-notes · 101 tokens

fetch-llm-apps

Workflow for updating the popular LLM applications pool (section/xllmapps.md) using fetchllmapps.py. Covers full refresh, alternate exports, topic tuning, and common pitfalls. USE FOR: Refreshing the ranked GitHub applications list linked from applications.md. DO NOT USE FOR: Hand-curating application entries inside…

kimtth/azure-openai-llm-notes · 85 tokens

ai-engineering-toolkit

6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.

sinhoneyy/master-skills · 47 tokens