rag-system-design

rag-system-design is a skill for Claude Code, Codex from vignesh2027/AI-AGENT-SKILLS. It costs 16 tokens per session (945 once invoked), scanned A, original, MIT.

A design and evaluation process for retrieval-augmented generation, where an AI answers using information retrieved from documents. It covers the questions, document ingestion, chunking, metadata, embeddings, and evaluation.

In plain words
What is it for?
Planning, evaluating, or operating systems that search a knowledge base before generating AI responses.
Why use it?
It addresses common problems such as retrieving the wrong text, exceeding context limits, using stale information, or making unsupported answers.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Planning, evaluating, or operating systems that search a knowledge base before generating AI responses.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vignesh2027/ai-agent-skills/rag-system-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 vignesh2027/AI-AGENT-SKILLS --skill rag-system-design
Clone the repo
git clone --depth 1 https://github.com/vignesh2027/AI-AGENT-SKILLS

Made for: Claude Code, Codex.

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-system-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/vignesh2027/ai-agent-skills/rag-system-design/github.svg)](https://agentmods.dev/skills/vignesh2027/ai-agent-skills/rag-system-design)
Your own site
<a href="https://agentmods.dev/skills/vignesh2027/ai-agent-skills/rag-system-design"><img src="https://agentmods.dev/badge/skills/vignesh2027/ai-agent-skills/rag-system-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-system-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/vignesh2027/ai-agent-skills/rag-system-design"><img src="https://agentmods.dev/badge/skills/vignesh2027/ai-agent-skills/rag-system-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 945 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.00016 $0.00945
Opus 5 $0.00008 $0.00473
Sonnet 5 $0.00003 $0.00189
Haiku 4.5 $0.00002 $0.00094

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

Security

Grade A, and why

rag-system-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 12d 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-system-design/SKILL.md · 97 lines

How it starts

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

Overview

RAG systems fail in ways that are hard to see: wrong chunks retrieved, context window overflows, hallucinations on retrieved content, stale knowledge base. This skill builds RAG systems with rigorous evaluation at every layer.

When to Use

  • Before building any system that grounds LLM responses in external data
  • When an existing RAG system is returning low-quality or inconsistent results
  • Before selecting an embedding model or vector database

Process

Step 1: Define the retrieval task

What questions will users ask? What documents will answer them? What does "good retrieval" look like? Write 50+ question-answer pairs as your evaluation set before writing any code.

Step 2: Design the ingestion pipeline

  • Source: what documents? In what format? How frequently updated?
  • Chunking strategy: fixed-size vs semantic vs structural
  • Chunk size: smaller chunks = more precise retrieval; larger = more context per chunk
  • Overlap: prevent context from being cut at chunk boundaries
  • Metadata: document source, date, section header — critical for filtering and attribution

Step 3: Choose and evaluate the embedding model

Test at least 2 embedding models on your retrieval evaluation set. Measure: retrieval accuracy (does the correct chunk appear in top-k?), latency, cost. Don't default to the most popular model.

Step 4: Build the vector store

  • Choose an index type appropriate for scale (exact vs approximate)
  • Store metadata alongside vectors
  • Plan for updates and deletions (not all vector DBs handle this well)
  • Test retrieval latency at your expected query volume

Step 5: Implement retrieval with evaluation

Measure:

  • Recall@k: Does the correct document appear in the top k results?
  • Precision@k: Of the top k results, how many are relevant?
  • MRR: Mean Reciprocal Rank — how highly is the correct document ranked?

Target: Recall@5 > 0.80 on your evaluation set before moving to generation.

Step 6: Design the context assembly

How do you combine retrieved chunks into a prompt context?

  • Order matters: LLMs attend more to beginning and end
  • Deduplication: don't include the same content twice
  • Relevance threshold: don't include low-score chunks just to fill context
  • Citation tracking: which chunks supported which claims?

Read the full file on GitHub · 97 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. 12d ago First seen · 97 lines · 16 tokens per session scan A ebf3c3a952b2

Subscribe to this mod's changes

rag-system-design is a skill published in the GitHub repository vignesh2027/AI-AGENT-SKILLS (1 stars, last pushed 14d ago), licensed MIT. It adds 16 tokens to every session and 945 once invoked, about $0.0001 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

mdc-langchain-rag-application-development

Applies specifically when developing RAG (Retrieval-Augmented Generation) applications using Langchain within Next.js projects.

GrayCodeAI/starling · 33 tokens

research-dspy

Build complex AI systems with declarative programming, optimize prompts automatically, create modular RAG systems and agents with DSPy - Stanford NLP's framework for systematic LM programming.

GrayCodeAI/starling · 36 tokens

research-faiss

Facebook's library for efficient similarity search and clustering of dense vectors. Supports billions of vectors, GPU acceleration, and various index types (Flat, IVF, HNSW). Use for fast k-NN sear...

GrayCodeAI/starling · 47 tokens

graph-retrieval

Exposes graph-based retrieval as a tool capability via querygraph. Reads normalized graph store files, builds a query-relevant subgraph, and returns LLM-friendly semantic triples with replayable evidence metadata.

study8677/repobrain · 46 tokens

knowledge-layer

High-level deployment wrapper over RepoBrain core with graph-first knowledge injection and all-file support. Exposes refreshfilesystem and askfilesystem for building and querying the knowledge graph.

study8677/repobrain · 42 tokens

spring-ai-integration

Use when integrating LLMs, chat clients, embeddings, RAG pipelines, or AI agents into Spring Boot. Covers Spring AI ChatClient, prompt templates, embeddings, vector stores, and structured output. Use when user mentions Spring AI, LLM, ChatGPT, Claude, RAG, embeddings.

rrezartprebreza/spring-boot-skills · 66 tokens