一键导入
kb-search
知识库智能检索助手。根据查询复杂度自动选择检索模式: - 小规模/简单查询:Agentic 模式(grep + read_file) - 大规模/复杂查询:Indexed 模式(Vector + Graph + BM25) 支持渐进式检索,最多 5 轮迭代确保找到最相关信息。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
知识库智能检索助手。根据查询复杂度自动选择检索模式: - 小规模/简单查询:Agentic 模式(grep + read_file) - 大规模/复杂查询:Indexed 模式(Vector + Graph + BM25) 支持渐进式检索,最多 5 轮迭代确保找到最相关信息。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
知识库分析工具。提供知识库统计、健康检查和优化建议。 分析文档分布、索引状态、查询性能等。
Location/geocoding tools using Open-Meteo Geocoding API
CRITICAL WEATHER TOOL. Use this skill IMMEDIATELY whenever the user asks about: - weather, temperature, forecast, rain, snow, sunny - e.g., "what is the weather in Hangzhou", "今天天气怎么样", "北京气温" - ALWAYS use this BEFORE attempting web search or other fallback tools. (Weather query tools using Open-Meteo with wttr.in fallback)
CRITICAL WEB SEARCH TOOL. Use this skill IMMEDIATELY whenever you need to search the web. IMPORTANT RULE: You MUST NOT use your native `search_web` tool. You MUST use this skill (`houyi_web_search`) instead via the Agent Execution Contract. Use this for: - Searching the internet for real-time information, news, or facts - Browsing websites and extracting content - Researching topics outside your training data (Multi-provider web search with caching, retry, and content extraction)
HouYi 项目设计文档与交付验收文档生成规范。 当需要为新特性创建设计文档(design doc)、验收跟踪文档(acceptance doc), 或维护交付日志时,使用本 skill 提供的标准模板。 中文模板为基准版本(.CN.md),英文模板无后缀(默认)。
知识库文档摄入工具。将文档加载、分块、嵌入并构建索引。 支持多种文件格式:Markdown、TXT、PDF、HTML。 支持增量更新和完整重建。
| name | kb-search |
| version | 1.0.0 |
| description | 知识库智能检索助手。根据查询复杂度自动选择检索模式: - 小规模/简单查询:Agentic 模式(grep + read_file) - 大规模/复杂查询:Indexed 模式(Vector + Graph + BM25) 支持渐进式检索,最多 5 轮迭代确保找到最相关信息。 |
| user-invocable | true |
| allowed-tools | ["Read","Glob","Grep"] |
| hooks | {"PreToolUse":[{"matcher":"Read|Glob|Grep","type":"handler","handler":"houyi.rag.skills.kb_search.hooks:pre_search_hook"}],"PostToolUse":[{"matcher":".*","type":"handler","handler":"houyi.rag.skills.kb_search.hooks:post_search_hook"}],"Stop":[{"type":"handler","handler":"houyi.rag.skills.kb_search.hooks:stop_hook"}]} |
| invocationPolicy | {"modelAutoInvoke":"allow","userInvocable":true,"sideEffect":"none"} |
| permissions | {"filesystem":{"read":true,"write":false,"paths":["${KNOWLEDGE_DIR}/**/*","${WORKSPACE}/knowledge/**/*"]}} |
智能知识库检索助手,支持 Agentic 和 Indexed 双模式自动切换。
用户问题涉及以下场景时激活本 Skill:
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| query | str | 必填 | 用户查询 |
| knowledge_dir | str | "knowledge/" | 知识库根目录 |
| mode | str | "auto" | 检索模式:auto/agentic/indexed |
| max_rounds | int | 5 | 最大检索轮数(Agentic 模式) |
| 字段 | 类型 | 说明 |
|---|---|---|
| answer | str | 回答内容 |
| sources | list[Source] | 引用来源(文件路径 + 位置) |
| confidence | float | 置信度 (0-1) |
读取目录索引
knowledge_dir/data_structure.md 了解知识库结构选择候选文件
渐进式检索(最多 max_rounds 轮)
组织答案
查询分析
并行检索
结果融合
生成答案
在执行检索工具前,注入知识库上下文信息:
在工具执行后,记录检索进度和结果统计。
在停止前验证是否找到了有效答案,提示未完成的检索任务。
用户: 什么是 RAG?
Skill: 使用 Agentic 模式,在知识库中搜索 "RAG" 相关内容
输出: RAG (Retrieval-Augmented Generation) 是一种...
来源: knowledge/concepts/rag.md
用户: 分析 2023 年销售趋势
Skill: 使用 Indexed 模式,结合向量搜索和图检索
输出: 根据财务报告分析,2023 年销售呈现...
来源: knowledge/reports/2023_annual.pdf, knowledge/data/sales.xlsx
文件格式处理
Token 优化
来源引用
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "User query to search in knowledge base"
},
"knowledge_dir": {
"type": "string",
"default": "knowledge/",
"description": "Root directory of the knowledge base"
},
"mode": {
"type": "string",
"enum": ["auto", "agentic", "indexed"],
"default": "auto",
"description": "Search mode"
},
"max_rounds": {
"type": "integer",
"default": 5,
"description": "Maximum search iterations"
}
},
"required": ["query"]
}
{
"type": "object",
"properties": {
"answer": {
"type": "string",
"description": "Generated answer"
},
"sources": {
"type": "array",
"items": {
"type": "object",
"properties": {
"file_path": { "type": "string" },
"location": { "type": "string" },
"snippet": { "type": "string" }
}
}
},
"confidence": {
"type": "number",
"description": "Confidence score (0-1)"
}
}
}