rag-architect

rag-architect is a skill for Claude Code, Codex from eric861129/SKILLS_All-in-one. It costs 73 tokens per session (1,760 once invoked), scanned A, a copy of rag-architect, MIT.

A guide to building retrieval-augmented generation (RAG) systems, which let an AI answer using information retrieved from a document collection. It covers document splitting, vector search, ranking results, and testing retrieval quality.

In plain words
What is it for?
Use it to design document search, choose vector databases and embedding models, build hybrid search pipelines, improve retrieval, and evaluate knowledge-grounded AI applications.
Why use it?
It helps turn a collection of documents into a searchable source for AI answers. It also provides a way to check whether the right information is being found.

Skill for Claude CodeCodex

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

Good fit Use it to design document search, choose vector databases and embedding models, build hybrid search pipelines, improve retrieval, and evaluate knowledge-grounded AI applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/eric861129/skills_all-in-one/rag-architect
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 eric861129/SKILLS_All-in-one --skill rag-architect
Clone the repo
git clone --depth 1 https://github.com/eric861129/SKILLS_All-in-one

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/eric861129/skills_all-in-one/rag-architect/github.svg)](https://agentmods.dev/skills/eric861129/skills_all-in-one/rag-architect)
Your own site
<a href="https://agentmods.dev/skills/eric861129/skills_all-in-one/rag-architect"><img src="https://agentmods.dev/badge/skills/eric861129/skills_all-in-one/rag-architect/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-architect

Your own site · 80×15
<a href="https://agentmods.dev/skills/eric861129/skills_all-in-one/rag-architect"><img src="https://agentmods.dev/badge/skills/eric861129/skills_all-in-one/rag-architect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,760 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 92% copy Near-identical to another mod 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.00073 $0.01760
Opus 5 $0.00036 $0.00880
Sonnet 5 $0.00015 $0.00352
Haiku 4.5 $0.00007 $0.00176

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

Security

Grade A, and why

rag-architect 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 9d 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.

Origin

This is a copy

92% identical to rag-architect — 8 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

public/SKILLS/Data & Analysis/rag-architect/SKILL.md · 195 lines

How it starts

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

RAG Architect

Core Workflow

  1. Requirements Analysis — Identify retrieval needs, latency constraints, accuracy requirements, and scale
  2. Vector Store Design — Select database, schema design, indexing strategy, sharding approach
  3. Chunking Strategy — Document splitting, overlap, semantic boundaries, metadata enrichment
  4. Retrieval Pipeline — Embedding selection, query transformation, hybrid search, reranking
  5. Evaluation & Iteration — Metrics tracking, retrieval debugging, continuous optimization

For each step, validate before moving on (see checkpoints below).

Reference Guide

Load detailed guidance based on context:

Topic Reference Load When
Vector Databases references/vector-databases.md Comparing Pinecone, Weaviate, Chroma, pgvector, Qdrant
Embedding Models references/embedding-models.md Selecting embeddings, fine-tuning, dimension trade-offs
Chunking Strategies references/chunking-strategies.md Document splitting, overlap, semantic chunking
Retrieval Optimization references/retrieval-optimization.md Hybrid search, reranking, query expansion, filtering
RAG Evaluation references/rag-evaluation.md Metrics, evaluation frameworks, debugging retrieval

Implementation Examples

1. Chunking Documents

from langchain.text_splitter import RecursiveCharacterTextSplitter

# Evaluate chunk_size on your domain data — never use 512 blindly
splitter = RecursiveCharacterTextSplitter(
    chunk_size=800,
    chunk_overlap=100,
    separators=["\n\n", "\n", ". ", " "],
)

chunks = splitter.create_documents(
    texts=[doc.page_content for doc in raw_docs],
    metadatas=[{"source": doc.metadata["source"], "timestamp": doc.metadata.get("timestamp")} for doc in raw_docs],
)

Checkpoint: assert all(c.metadata.get("source") for c in chunks), "Missing source metadata"

2. Generating Embeddings & Indexing

from openai import OpenAI
import qdrant_client
from qdrant_client.models import VectorParams, Distance, PointStruct

client = OpenAI()
qdrant = qdrant_client.QdrantClient("localhost", port=6333)

# Create collection
qdrant.recreate_collection(
    collection_name="knowledge_base",
    vectors_config=VectorParams(size=1536, distance=Distance.COSINE),
)

def embed_chunks(chunks: list[str], model: str = "text-embedding-3-small") -> list[list[float]]:
    response = client.embeddings.create(input=chunks, model=model)
    return [r.embedding for r in response.data]

# Idempotent upsert with deduplication via deterministic IDs
import hashlib, uuid

points = []
for i, chunk in enumerate(chunks):
    doc_id = str(uuid.UUID(hashlib.md5(chunk.page_content.encode()).hexdigest()))
    embedding = embed_chunks([chunk.page_content])[0]
    points.append(PointStruct(id=doc_id, vector=embedding, payload=chunk.metadata))

qdrant.upsert(collection_name="knowledge_base", points=points)

Read the full file on GitHub · 195 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 195 lines · 73 tokens per session scan A 95e2590e5bff

Subscribe to this mod's changes

rag-architect is a skill published in the GitHub repository eric861129/SKILLS_All-in-one (52 stars, last pushed 4mo ago), licensed MIT. It adds 73 tokens to every session and 1,760 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to rag-architect, differing in 8 lines, and is treated as a copy.