Skip to content
Agentmart
Submit a tool

rag-patterns

RAG 模式 —— 检索增强生成架构设计、分块策略、向量检索优化与评估方法

Skill by Sweetteabittersugar

IndexedMIT★ 3
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/sweetteabittersugar-rag-patterns

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

RAG 模式 —— 检索增强生成架构设计、分块策略、向量检索优化与评估方法

Use cases: ml

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/rag-patterns

What's inside

Skill name
rag-patterns
Description
RAG 模式 —— 检索增强生成架构设计、分块策略、向量检索优化与评估方法
License
MIT
Instructions
32 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • SKILL.md.disabled

SKILL.md (first lines)

# RAG 模式(检索增强生成)

## 概述
提供检索增强生成(Retrieval-Augmented Generation)系统的架构设计和优化指南,覆盖文档处理、分块策略、向量检索、重排序和评估全流程。

## 使用场景
- 构建基于私有知识库的问答系统
- 优化现有 RAG 系统的检索命中率和答案质量
- 选择分块策略(Chunking)和 Embedding 模型
- 评估 RAG 系统的检索和生成效果

## 核心原则
1. **分块策略决定检索质量**:分块太大导致检索精度降低,太小导致上下文碎片化。语义分块(按段落/章节)优于固定长度分块。
2. **检索增加冗余度**:召回 top_k 设为实际用量的 2-3 倍,留出重排序空间。检索不足时答案不完整,检索过多时引入噪声。
3. **重排序大幅提升准确率**:初检索使用轻量模型(BM25 / 向量相似度),最终选片使用强模型(Cross-encoder Reranker)。
4. **上下文组织影响生成质量**:将检索到的文档按相关性排列,标注来源,控制总长度在模型有效注意力窗口内。
5. **评估需要多维指标**:检索质量(Recall@k, MRR)、答案质量(忠实度、相关性)、用户体验(延迟、可解释性)。

## RAG 流水线
```
文档加载 → 文本提取 → 分块 → Embedding → 向量存储(索引)
查询 → 向量检索 → 混合检索(BM25 + 向量)→ 重排序 → 上下文组装 → LLM 生成
```

## 检查清单
- [ ] 分块策略是否基于文档语义(段落/章节)而非固定字符数?
- [ ] 检索召回数量是否为实际用量的 2-3 倍?
- [ ] 是否使用了重排序(Reranker)提升最终检索精度?
- [ ] 上下文中是否标注了每个引用片段的来源?
- [ ] 是否有系统的评估流程(检索指标 + 生成指标)?

From Sweetteabittersugar/agency, MIT.

More from Sweetteabittersugar/agency

Signals

Stars
3
Forks
1
Open issues
0
Last commit (this folder)
Jun 10, 2026 (4 months ago)
Last release
Aug 24, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Sweetteabittersugar

Cite this page

rag-patterns skill. Agent Mart. https://agentmart.dev/skills/sweetteabittersugar-rag-patterns (last updated 2026-10-24)