rag

rag is a command for Claude Code from an8079/take-skills. It costs 38 tokens per session (777 once invoked), scanned A, original, MIT.

A design and discussion command for RAG systems, which let an AI search a collection of documents before generating an answer. It covers workflows, document splitting, search methods, databases for document vectors, and monitoring tools.

In plain words
What is it for?
Use it to plan systems such as internal knowledge bases and document question-answering services, including the choice of embedding models, vector databases, retrieval and reranking methods, LangGraph workflows, and LangFuse or LangSmith monitoring.
Why use it?
It helps turn a broad question-answering idea into a concrete technical design. It supports decisions about how to prepare documents, find relevant passages, evaluate answers, and track costs and performance.

Command for Claude Code

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

Part of the claude-dev-assistant plugin — 21 skills, 39 commands shipped together

Good fit Use it to plan systems such as internal knowledge bases and document question-answering services, including the choice of embedding models, vector databases, retrieval and reranking methods, LangGraph workflows, and LangFuse or LangSmith monitoring.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/an8079/take-skills/takes-rag
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.

Clone the repo
git clone --depth 1 https://github.com/an8079/take-skills

Made for: Claude Code.

Or install claude-dev-assistant, the plugin that ships this one along with the rest of its 21 skills, 39 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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/an8079/take-skills/takes-rag"><img src="https://agentmods.dev/badge/commands/an8079/take-skills/takes-rag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 777 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.00038 $0.00777
Opus 5 $0.00019 $0.00388
Sonnet 5 $0.00008 $0.00155
Haiku 4.5 $0.00004 $0.00078

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

Security

Grade A, and why

rag 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.

commands/takes-rag.md · 114 lines

What it actually says

/rag - RAG 项目设计

与用户讨论并设计 RAG (Retrieval Augmented Generation) 项目架构。

使用方式

/rag

RAG设计
开始RAG设计
设计RAG系统

工作流程

  1. 需求讨论 - 与用户讨论 RAG 使用场景和需求
  2. 数据源分析 - 分析数据源类型和查询模式
  3. 架构设计 - 设计 RAG Pipeline 和工作流
  4. 组件选型 - 推荐 Embedding、Vector DB、Retrieval 策略
  5. 技术方案 - 提供完整的实现建议

讨论内容

LangGraph 工作流设计

  • Supervisor-Worker 模式
  • 状态持久化与 Checkpointing
  • 条件边与路由逻辑
  • 子图设计

LangFuse 集成方案

  • 追踪配置与装饰器使用
  • 评估指标设计
  • Prompt 版本管理
  • 成本分析

LangSmith 监控配置

  • 项目与数据集设置
  • 评估链构建
  • 反馈收集
  • A/B 测试

LangChain 组件选型

  • Embedding 模型选择(OpenAI BGE、Cohere)
  • Vector Database 对比与选型
  • Chunking 策略设计
  • Reranking 策略

RAG 架构设计

  • 向量数据库选型(Pinecone、Milvus、Qdrant、Chroma、FAISS)
  • Embedding 模型选择
  • Chunking 策略
  • Retrieval 和 Reranking 策略
  • LangGraph 状态机设计

输出内容

RAG 架构设计文档,包含:

内容 说明
向量数据库选型建议 根据规模、成本、性能需求推荐
Embedding 模型选择 中文/英文、精度/速度权衡
Chunking 策略 根据文档类型推荐分块策略
Retrieval 策略 Naive RAG、GraphRAG、Hybrid Search 等
Reranking 策略 BGE Reranker、Cohere Rerank
LangGraph 工作流 状态定义、节点设计、边设计
监控方案 LangFuse/LangSmith 配置建议

使用技能

  • skills/rag-design/SKILL.md - RAG 设计知识库

示例场景

场景 1: 企业内部知识库

用户: 我们想做一个法律文档问答系统
/rag → 讨论 → 推荐 GraphRAG + LangGraph + Qdrant + BGE

场景 2: 客服机器人

用户: 需要做一个实时客服系统
/rag → 讨论 → 推荐 Hybrid Search + Pinecone + Redis 缓存

场景 3: 多语言文档检索

用户: 我们的文档有中英文
/rag → 讨论 → 推荐 Cohere Embed + Weaviate + Hybrid Search

提示: /rag 是设计讨论模式,不会自动执行代码。讨论完成后,你可以使用 /plan 进入计划阶段。

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 · 114 lines · 38 tokens per session scan A e69e3fc069f1

Subscribe to this mod's changes

rag is a command published in the GitHub repository an8079/take-skills (4 stars, last pushed 5mo ago), licensed MIT. It adds 38 tokens to every session and 777 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.