rag-builder

rag-builder is a skill for Claude Code, Codex from oyi77/1ai-skills. It costs 31 tokens per session (958 once invoked), scanned A, original, MIT.

A guide to building retrieval-augmented generation (RAG), where an AI retrieves relevant information from your documents before writing an answer.

In plain words
What is it for?
It helps load and split documents, create searchable representations, retrieve relevant passages, combine keyword and semantic search, and cite sources.
Why use it?
It helps ground AI answers in current source material instead of relying only on the model's training or risking unsupported answers.

Skill for Claude CodeCodex

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

Part of the 1ai-skills plugin — 187 skills, 4 commands shipped together

Good fit It helps load and split documents, create searchable representations, retrieve relevant passages, combine keyword and semantic search, and cite sources.

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

Made for: Claude Code, Codex.

Or install 1ai-skills, the plugin that ships this one along with the rest of its 187 skills, 4 commands.

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-builder

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/oyi77/1ai-skills/rag-builder"><img src="https://agentmods.dev/badge/skills/oyi77/1ai-skills/rag-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 958 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00031 $0.00958
Opus 5 $0.00015 $0.00479
Sonnet 5 $0.00006 $0.00192
Haiku 4.5 $0.00003 $0.00096

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

Security

Grade A, and why

rag-builder 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 6d 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.

core/rag-builder/SKILL.md · 141 lines

How it starts

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

Overview

Retrieval-Augmented Generation (RAG) is the standard pattern for grounding LLMs in your data. This skill covers the full pipeline: document loading, chunking strategies, embedding, vector storage, retrieval, and answer synthesis.

Capabilities

  • Design document chunking strategies (fixed, semantic, recursive)
  • Select and configure embedding models for your use case
  • Implement hybrid search (vector + keyword) for better retrieval
  • Build answer synthesis with source attribution
  • Evaluate RAG quality with RAGAS metrics

When to Use

Trigger phrases:

  • "rag builder"

  • "RAG pipeline design — document chunking, embedding strategies, retrieval optimiz"

  • Building a chatbot over your documentation or knowledge base

  • Need LLM answers grounded in factual, up-to-date data

  • Document Q&A where hallucination is unacceptable

  • Customer support automation over product docs

When NOT to Use

  • Task is outside your authorization scope
  • You need to implement controls (use implementing-* skills)
  • Task is about analysis, not action (use analyzing-* skills)
  • You don't have access to target systems
  • Task requires compliance expertise (consult professionals)
  • Task is about defense, not offense (use defensive skills)

Pseudo Code

# Example workflow for this skill
def execute(input_data):
    # Step 1: Validate input
    if not input_data:
        raise ValueError("Input data is required")

    # Step 2: Process core logic
    result = process(input_data)

    # Step 3: Validate output
    validate_output(result)

    return result

Chunking Strategy

def chunk_document(doc, strategy="recursive", chunk_size=512, overlap=50):
    if strategy == "fixed":
        return split_by_chars(doc, chunk_size, overlap)
    elif strategy == "recursive":
        return recursive_split(doc, separators=["\n\n", "\n", ". ", " "], chunk_size=chunk_size)
    elif strategy == "semantic":
        return semantic_split(doc, similarity_threshold=0.8)

Read the full file on GitHub · 141 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. 6d ago First seen · 141 lines · 31 tokens per session scan A 081f6fb40081

Subscribe to this mod's changes

rag-builder is a skill published in the GitHub repository oyi77/1ai-skills (12 stars, last pushed today), licensed MIT. It adds 31 tokens to every session and 958 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-09-03.