rag-design-doc

GitHub

用于端到端设计检索增强生成(RAG)系统的技能,涵盖数据摄入、分块、索引、检索、重排序及提示工程。旨在解决幻觉问题,提供包含评估指标和故障缓解策略的完整设计方案。

plugins/pm-ai/skills/rag-design-doc/SKILL.md mohitagw15856/pm-claude-skills

Trigger Scenarios

设计 RAG 管道 构建文档聊天功能 调试 RAG 系统返回错误答案 知识助手架构设计

Install

npx skills add mohitagw15856/pm-claude-skills --skill rag-design-doc -g -y
More Options

Non-standard path

npx skills add https://github.com/mohitagw15856/pm-claude-skills/tree/main/plugins/pm-ai/skills/rag-design-doc -g -y

Use without installing

npx skills use mohitagw15856/pm-claude-skills@rag-design-doc

指定 Agent (Claude Code)

npx skills add mohitagw15856/pm-claude-skills --skill rag-design-doc -a claude-code -g -y

安装 repo 全部 skill

npx skills add mohitagw15856/pm-claude-skills --all -g -y

预览 repo 内 skill

npx skills add mohitagw15856/pm-claude-skills --list

SKILL.md

Frontmatter
{
    "name": "rag-design-doc",
    "description": "Design a Retrieval-Augmented Generation system end to end. Use when asked to design a RAG pipeline, a 'chat with your docs' feature, a knowledge assistant, or to debug why a RAG system gives wrong\/ungrounded answers. Produces a RAG design doc — ingestion & chunking, embeddings & index, retrieval & reranking, the generation prompt, grounding\/citations, evaluation, and failure modes with mitigations."
}

RAG Design Doc Skill

Most RAG systems fail not at generation but at retrieval — the model answers confidently from the wrong chunks. This skill forces the decisions that actually determine quality (chunking, retrieval, reranking, grounding) and pairs each with how you'll evaluate it, so "it hallucinates sometimes" becomes a diagnosable, fixable pipeline.

Required Inputs

Ask for these only if they aren't already provided:

  • Corpus — what's being retrieved over (docs, tickets, code, tables), size, and update frequency.
  • Queries — the kinds of questions users ask, and how precise/recall-sensitive they are.
  • Grounding requirement — must answers cite sources? Is "I don't know" acceptable (it should be)?
  • Constraints — latency budget, cost, privacy/tenancy (per-customer isolation?), and freshness needs.

Output Format

RAG Design: [system]

1. Goal & non-goals — what questions it answers well, and what it explicitly won't do.

2. Ingestion & chunking

  • Source connectors and refresh strategy (full re-index vs. incremental).
  • Chunking: strategy (fixed, recursive, semantic, structure-aware), size + overlap, and what metadata travels with each chunk (source, section, timestamp, permissions). Chunking is the highest-leverage choice — justify it.

3. Embeddings & index — embedding model + dimension, vector store, and the index/filter strategy (incl. metadata filters and per-tenant isolation).

4. Retrieval — top-k, hybrid (dense + keyword/BM25) vs. pure vector, metadata pre-filtering, and query transformation (rewriting, decomposition, HyDE) if used.

5. Reranking — whether a cross-encoder/reranker narrows the candidate set before generation, and the final context budget.

6. Generation — the prompt template, how retrieved context is formatted, the instruction to answer only from context and say "I don't know" otherwise, and how citations are produced and verified.

7. Evaluation — retrieval metrics (recall@k, MRR) separately from answer quality (faithfulness/groundedness, correctness). Pair with an ai-eval-plan.

8. Failure modes & mitigations — a table: symptom → likely stage → fix.

Symptom Likely cause (stage) Mitigation
Confident but wrong retrieval missed the chunk hybrid search, better chunking, rerank
Right doc, wrong detail chunk too large/small tune size+overlap, structure-aware split
Ignores retrieved context prompt/format stronger grounding instruction, fewer/cleaner chunks
Stale answers index freshness incremental re-index, timestamp filter

Quality Checks

  • Retrieval quality is evaluated separately from answer quality (you can't fix what you can't isolate)
  • The system can say "I don't know" when context is insufficient — it's not forced to answer
  • Answers carry citations that are verified against the retrieved context
  • Chunking strategy and size are justified against the corpus structure, not copied from a tutorial
  • Per-tenant / permission isolation is handled in retrieval, not just at the UI
  • Hybrid (keyword + vector) retrieval is considered for queries with exact terms/IDs

Anti-Patterns

  • Do not jump to "fine-tune the model" when retrieval is the problem — fix what's retrieved first
  • Do not evaluate only the final answer — a good answer from luck and a bad answer from bad retrieval look different and need different fixes
  • Do not force an answer when nothing relevant was retrieved — an honest "I don't know" beats a confident hallucination
  • Do not ignore metadata filtering — semantic similarity will happily return the right-sounding chunk from the wrong document or wrong tenant
  • Do not pick a chunk size by default — it's the single biggest lever on retrieval quality

Based On

Retrieval-Augmented Generation practice — hybrid retrieval, reranking, grounded generation, and faithfulness evaluation.

Version History

  • a38bc30 Current 2026-07-05 11:11

Same Skill Collection

exports/openclaw/360-feedback-template/SKILL.md
exports/openclaw/401k-plan-decoder/SKILL.md
exports/openclaw/ab-test-planner/SKILL.md
exports/openclaw/ab-test-readout/SKILL.md
exports/openclaw/accessibility-audit/SKILL.md
exports/openclaw/account-plan/SKILL.md
exports/openclaw/acquirer-red-team/SKILL.md
exports/openclaw/ad-copy/SKILL.md
exports/openclaw/aeo-optimizer/SKILL.md
exports/openclaw/agenda-or-cancel/SKILL.md
exports/openclaw/agent-design-review/SKILL.md
exports/openclaw/agent-observability-spec/SKILL.md
exports/openclaw/agent-spec/SKILL.md
exports/openclaw/ai-ethics-review/SKILL.md
exports/openclaw/ai-eval-plan/SKILL.md
exports/openclaw/ai-feature-prd/SKILL.md
exports/openclaw/ai-product-canvas/SKILL.md
exports/openclaw/air-quality/SKILL.md
exports/openclaw/altitude-shifter/SKILL.md
exports/openclaw/ambiguity-resolver/SKILL.md
exports/openclaw/analyst-relations-brief/SKILL.md
exports/openclaw/announcement-card/SKILL.md
exports/openclaw/api-docs-writer/SKILL.md
exports/openclaw/api-test-plan/SKILL.md
exports/openclaw/api-versioning-strategy/SKILL.md
exports/openclaw/apology-letter/SKILL.md
exports/openclaw/architecture-decision-record/SKILL.md
exports/openclaw/architecture-diagram/SKILL.md
exports/openclaw/archive-strategy/SKILL.md
exports/openclaw/assumption-bounty/SKILL.md
exports/openclaw/assumption-mapper/SKILL.md
exports/openclaw/async-update-format/SKILL.md
exports/openclaw/auto-repair-estimate-decoder/SKILL.md
exports/openclaw/autopilot-charter/SKILL.md
exports/openclaw/benefits-decoder/SKILL.md
exports/openclaw/bid-tender-review/SKILL.md
exports/openclaw/board-deck-narrative/SKILL.md
exports/openclaw/board-minutes/SKILL.md
exports/openclaw/board-pre-read/SKILL.md
exports/openclaw/bom-cost-review/SKILL.md
exports/openclaw/bookkeeping-categorization/SKILL.md
exports/openclaw/boolean-search-builder/SKILL.md
exports/openclaw/brag-doc/SKILL.md
exports/openclaw/brainstorming/SKILL.md
exports/openclaw/brief-builder/SKILL.md
exports/openclaw/briefing-note/SKILL.md
exports/openclaw/budget-builder/SKILL.md
exports/openclaw/budget-variance-analysis/SKILL.md
exports/openclaw/bug-diagnosis/SKILL.md
exports/openclaw/bug-report/SKILL.md

Metadata

Files
0
Version
471c606
Hash
01f0ee64
Indexed
2026-07-05 11:11

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-30 11:01
浙ICP备14020137号-1 $방문자$