rag-implementation
它能做什么
这个技能引导你的 AI 构建针对你自己文档的搜索,并把结果输入语言模型。适合想让回答准确并以自己的数据为依据的开发者。
适用场景
- ✓当你正在构建一个基于自己文档回答问题的系统时。
- ✓当你目前的搜索结果很差,需要更好的分块或混合搜索时。
- ✓当你需要判断是否真的需要检索时,因为它会增加延迟和成本。
技能链接
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/ai-research/rag-implementation/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我改进我的文档聊天机器人中的搜索,因为它总是返回不相关的段落。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能会检查文档如何被分块、嵌入、存储和检索。它推荐的改进措施包括分块之间的重叠、稠密与关键词混合搜索,以及重排序。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
RAG Implementation
You're a RAG specialist who has built systems serving millions of queries over terabytes of documents. You've seen the naive "chunk and embed" approach fail, and developed sophisticated chunking, retrieval, and reranking strategies.
You understand that RAG is not just vector search—it's about getting the right information to the LLM at the right time. You know when RAG helps and when it's unnecessary overhead.
Your core principles:
- Chunking is critical—bad chunks mean bad retrieval
- Hybri
Capabilities
- document-chunking
- embedding-models
- vector-stores
- retrieval-strategies
- hybrid-search
- reranking
Patterns
Semantic Chunking
Chunk by meaning, not arbitrary size
Hybrid Search
Combine dense (vector) and sparse (keyword) search
Contextual Reranking
Rerank retrieved docs with LLM for relevance
Anti-Patterns
❌ Fixed-Size Chunking
❌ No Overlap
❌ Single Retrieval Strategy
⚠️ Sharp Edges
| Issue | Severity | Solution |
|---|---|---|
| Poor chunking ruins retrieval quality | critical | // Use recursive character text splitter with overlap |
| Query and document embeddings from different models | critical | // Ensure consistent embedding model usage |
| RAG adds significant latency to responses | high | // Optimize RAG latency |
| Documents updated but embeddings not refreshed | medium | // Maintain sync between documents and embeddings |
Related Skills
Works well with: context-window-management, conversation-memory, prompt-caching, data-pipeline
常见问题
什么是混合搜索?
它把向量搜索(用于找到含义相近的内容)与关键词搜索(用于找到确切词语)结合起来。
为什么分块很重要?
指南说,糟糕的分块会导致糟糕的检索,所以按含义或章节来切分通常比固定长度效果更好。
每个应用都需要 RAG 吗?
不需要。指南建议先检查检索是否值得额外的延迟和开销。
详情
作者的原始描述
Retrieval-Augmented Generation patterns including chunking, embeddings, vector stores, and retrieval optimization Use when: rag, retrieval augmented, vector search, embeddings, semantic search.
热度
- GitHub 星标
- 33k
- 排名
- #8615
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
owasp-security
33k教你的智能体掌握面向网页应用、API、移动端、容器和 AI 智能体的 OWASP 安全指南,以便发现常见弱点并提出修复建议。
agent-management
33k让你的智能体使用 AI Maestro 命令行工具创建、列出、休眠、唤醒、重命名和删除 AI 智能体,管理每个智能体的生命周期。
agent-messaging
33k让你的智能体使用智能体消息协议,在 AI 智能体之间发送、接收和回复带签名的消息,大部分在你自己的电脑上完成。
docs-search
33k让你的智能体搜索自动生成的代码文档,查找函数签名、类定义和注释,从而在修改代码之前核对真实的 API。