smithery.ai

knowledge_search

基于 RAG 的知识库检索技能。从本地文档中检索相?

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0
LicenseMIT

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,322 B
  • docs SUMMARY.md 194 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

知识检索技能

此技能使用 RAG(Retrieval-Augmented Generation)技术从本地知识库中检索相关信息。

能力范围

  • 语义检索: 基于向量相似度的语义搜索
  • 关键词匹配: 精确关键词检索
  • 多文档整合: 从多个文档中提取相关片段
  • 上下文增强: 将检索结果注入 Prompt 增强回答

使用场景

当用户提出以下类型的问题时,应激活此技能:

  • "根据文档,XXX 是什么意思?"
  • "在知识库中查找关于 XXX 的信息"
  • "帮我找找有关 XXX 的资料"
  • 任何需要基于文档回答的问题

依赖工具

工具名称 用途 必需
rag_retriever 向量检索 ✅
rag_indexer 文档索引 ❌

输入参数

参数 类型 必填 说明
query string ✅ 检索查询
top_k int ❌ 返回结果数量,默认 3
filter object ❌ 过滤条件(文档类型、日期等)
threshold float ❌ 相似度阈值,默认 0.7

输出格式

{
  "success": true,
  "data": {
    "query": "什么是机器学习",
    "results": [
      {
        "content": "机器学习是人工智能的一个分支...",
        "source": "ai_basics.md",
        "score": 0.92,
        "metadata": {
          "page": 1,
          "chunk_id": "chunk_001"
        }
      }
    ],
    "total": 3,
    "context_for_llm": "相关上下文拼接文本..."
  }
}

处理流程

  1. 接收用户查询
  2. 将查询文本向量化
  3. 在 FAISS 索引中执行相似度搜索
  4. 获取 Top-K 相关文档片段
  5. 整合为可用于 LLM 的上下文

检索策略

  • 混合检索: 结合向量检索和关键词匹配
  • 重排序: 对检索结果进行二次排序
  • 去重: 移除重复或高度相似的片段
  • 截断: 控制上下文长度不超过 LLM 限制

注意事项

  • 需要先完成文档索引
  • 检索结果质量依赖 Embedding 模型
  • 建议定期更新索引