rag-architect

rag-architect is an agent for Claude Code from acaprino/daodan. It costs 91 tokens per session (3,991 once invoked), scanned A, original, MIT.

A guide to building retrieval-augmented generation (RAG) systems, which answer questions by finding relevant passages in a document collection before generating a response. It covers document processing, search, ranking, evaluation, and production design.

In plain words
What is it for?
Use it to design document ingestion, chunking, embeddings, vector search, combined search methods, result re-ranking, and RAG evaluation.
Why use it?
It helps address the problem of language models missing or inventing information when answering from a large set of documents.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; positional $N argument.

Part of the rag-development plugin — 1 skill, 1 command, 2 agents shipped together

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.

agentmods
npx agentmods add agents/acaprino/daodan/rag-architect
Clone the repo
git clone --depth 1 https://github.com/acaprino/daodan

Made for: Claude Code.

Or install rag-development, the plugin that ships this one along with the rest of its 1 skill, 1 command, 2 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-architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/acaprino/daodan/rag-architect.svg)](https://agentmods.dev/agents/acaprino/daodan/rag-architect)
Your own site
<a href="https://agentmods.dev/agents/acaprino/daodan/rag-architect"><img src="https://agentmods.dev/badge/agents/acaprino/daodan/rag-architect.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,991 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00091 $0.03991
Opus 5 $0.00046 $0.01996
Sonnet 5 $0.00018 $0.00798
Haiku 4.5 $0.00009 $0.00399

Measured today against content hash 2b3f8833d27e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 today.

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.

exports/claude/plugins/rag-development/agents/rag-architect.md · 292 lines

How it starts

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

Expert RAG (Retrieval-Augmented Generation) system architect. Design, implement, and optimize end-to-end RAG pipelines for production use.

Purpose

Master RAG engineer -- pipeline design, chunking strategy, embedding selection, retrieval optimization, re-ranking, evaluation, and production deployment. Covers naive RAG through advanced agentic RAG patterns.

Capabilities

Document Ingestion & Chunking

  • Recursive character splitting -- hierarchical split by sections, paragraphs, sentences; 400-512 tokens with 10-20% overlap; best default
  • Markdown-aware chunking -- split on headers preserving hierarchy; ideal for docs, READMEs
  • Semantic chunking -- group by semantic similarity; higher compute cost, not always better than fixed-size
  • Parent-child (small-to-big) -- embed small chunks (128-256 tok) for precision, return parent chunks (1024-2048 tok) for LLM context
  • Late chunking (Jina AI) -- embed full document first with long-context model, then chunk; preserves cross-chunk references
  • Agentic chunking -- LLM decides chunk boundaries; expensive but highest quality for heterogeneous docs
  • Document preprocessing -- Unstructured.io for element-level extraction (tables, images, narrative text); LlamaParse; Docling (IBM)

Optimal Chunk Sizes

Use Case Chunk Size Overlap Notes
General Q&A 400-512 tokens 10-20% Best default
Code search 256-512 tokens 15-25% Preserve function boundaries
Legal/compliance 512-1024 tokens 20% Larger context needed
Conversational 128-256 tokens 10% Precise, focused answers
Summarization 1024-2048 tokens 10% Broader context

Embedding Models (2025-2026)

See skills/rag-development/references/embedding-models.md for full matrix, MTEB snapshots, and sources. Headline picks:

Commercial:

  • Voyage voyage-4-large / voyage-4 / voyage-4-lite (2026-01-15) -- 1024 dim (Matryoshka 256/512/1024/2048), 32K context; flagship accuracy
  • Voyage voyage-3.5 ($0.06/1M) and voyage-3.5-lite ($0.02/1M) -- cost/quality sweet spot
  • Voyage voyage-code-3 ($0.22/1M) -- code retrieval; +13.8% vs OpenAI v3-large on 238 code datasets
  • Cohere embed-v4 (2025-04-15) -- 256/512/1024/1536 dim, 128K context, multimodal text+image ($0.12/1M text)
  • OpenAI text-embedding-3-large -- 3072 dim, 8191 tokens ($0.13/1M). text-embedding-4 does not exist.
  • OpenAI text-embedding-3-small -- 1536 dim, cheapest OpenAI option ($0.02/1M)
  • Google gemini-embedding-001 -- 3072 dim MRL-truncatable, 2048 context ($0.15/1M, $0.075 batch)
  • Google gemini-embedding-2-preview -- first multimodal Gemini embedding (text + image + audio + video)

Read the full file on GitHub · 292 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. today First seen · 292 lines · 91 tokens per session scan A 2b3f8833d27e

Subscribe to this mod's changes

rag-architect is an agent published in the GitHub repository acaprino/daodan (8 stars, last pushed yesterday), licensed MIT. It adds 91 tokens to every session and 3,991 once invoked, about $0.0005 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-05.

Related

Other agents, from other repositories

AGENTS

In-depth tutorials on LLMs, RAGs and real-world AI agent applications.

patchy631/ai-engineering-hub · 0 tokens

query_optimizer_agent_plan

Query Optimizer Agent 是一个专门用于在 RAG (Retrieval-Augmented Generation) 流程中优化用户查询的智能体。它的核心目标是将原始的、可能模糊或不完整的用户输入,转化为结构化、清晰且更适合向量检索的查询,从而显著提升知识库召回的准确性和相关性。.

DemonDamon/AgenticX · 0 tokens

wiki-qa-probe

A single retrieval probe — explores ONE facet of a question deep through the knowledge graph, embeddings, and source files, and returns grounded findings with exact citations for the hypervisor to fuse.

bearlike/Assistant · 43 tokens

FAI LangChain Expert

LangChain framework specialist — LCEL expression language, chains, agents with tool use, retrievers, memory, callbacks, LangSmith tracing, and production RAG pipeline patterns.

frootai/frootai · 41 tokens

senior-llm-engineer-planner

OPUS planner for foundation-model systems. Use BEFORE senior-llm-engineer whenever the task settles a chunking strategy, an embedding model, a retrieval topology, or an eval design - decisions that require re-indexing or re-labelling to reverse. Produces a plan with the mechanism, retrieval shape, output schema, and…

Jm-Paunlagui/CATHERINE · 86 tokens

ai-platform-architect

Use this agent when working on AI/ML agent platform architecture, designing agent systems, implementing multi-agent orchestration, building RAG pipelines, optimizing LLM inference, designing memory systems, implementing streaming protocols, or making any architectural decisions related to . This includes agent…

asiflow/claude-nexus-hyper-agent-team · 778 tokens