跳到正文
Skillpedia
智能体33k · #8615

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/ai-research/rag-implementation/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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:

  1. Chunking is critical—bad chunks mean bad retrieval
  2. 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.

repo: davila7/claude-code-templates

热度

GitHub 星标
33k
排名
#8615
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能