yuque-group-smart-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSmart Search — Yuque Team Knowledge Base Search & Q&A
智能搜索——语雀团队知识库搜索与问答
Search across group Yuque knowledge bases using natural language, read relevant documents, and synthesize a clear answer with references. Scoped to team/group repositories.
使用自然语言在语雀团队知识库中进行搜索,读取相关文档,合成带参考来源的清晰答案,搜索范围仅限团队/群组仓库。
When to Use
适用场景
- User asks a question that might be answered by their team's Yuque docs
- User wants to find specific information in group knowledge bases
- User says "搜一下团队文档", "search group Yuque", "团队知识库里有没有..."
- 用户提出的问题可能可以从团队的语雀文档中找到答案
- 用户想要在团队知识库中查找特定信息
- 用户说出「搜一下团队文档」、「search group Yuque」、「团队知识库里有没有...」这类内容
Required MCP Tools
所需MCP工具
All tools are from the server:
yuque-mcp- — List group knowledge bases to determine search scope
yuque_list_repos - — Search documents by keyword
yuque_search - — Read full document content by slug/id
yuque_get_doc
所有工具均来自服务:
yuque-mcp- — 列出团队知识库,确定搜索范围
yuque_list_repos - — 按关键词搜索文档
yuque_search - — 根据slug/id读取完整文档内容
yuque_get_doc
Workflow
工作流程
Step 1: Identify Team Scope
步骤1:确定团队范围
First, get the list of group knowledge bases to understand the search scope:
Tool: yuque_list_repos
Parameters:
login: "<group_login>"
type: "group"If the user hasn't specified a group login, ask: "请告诉我团队的语雀团队标识(group login),我来搜索团队知识库。"
首先获取团队知识库列表,明确搜索范围:
Tool: yuque_list_repos
Parameters:
login: "<group_login>"
type: "group"如果用户没有指定group login,询问:「请告诉我团队的语雀团队标识(group login),我来搜索团队知识库。」
Step 2: Extract Search Keywords
步骤2:提取搜索关键词
From the user's natural language query, extract 1-3 concise Chinese keywords. Yuque search works best with short, specific terms.
Examples:
- "团队的部署流程是什么?" → keywords:
部署流程 - "我们的 API 规范文档" → keywords:
API 规范 - "上次技术评审的结论" → keywords:
技术评审
从用户的自然语言查询中,提取1-3个简洁的中文关键词。语雀搜索使用简短、具体的词效果最佳。
示例:
- 「团队的部署流程是什么?」 → 关键词:
部署流程 - 「我们的 API 规范文档」 → 关键词:
API 规范 - 「上次技术评审的结论」 → 关键词:
技术评审
Step 3: Search Documents
步骤3:搜索文档
Call with the extracted keywords:
yuque_searchTool: yuque_search
Parameters:
query: "<keywords>"
type: "doc"If the search returns no results:
- Try alternative keywords (synonyms, broader terms)
- Try splitting compound terms (e.g., "部署流程" → "部署" or "流程")
- If still no results, tell the user honestly: "在团队语雀知识库中未找到相关文档,建议尝试其他关键词或确认文档是否存在。"
调用传入提取的关键词:
yuque_searchTool: yuque_search
Parameters:
query: "<keywords>"
type: "doc"如果搜索无结果:
- 尝试替换关键词(同义词、更宽泛的术语)
- 尝试拆分复合词(例如「部署流程」→「部署」或「流程」)
- 如果仍然没有结果,如实告知用户:「在团队语雀知识库中未找到相关文档,建议尝试其他关键词或确认文档是否存在。」
Step 4: Filter and Rank Results
步骤4:结果过滤与排序
From the search results, select the top 3-5 most relevant documents based on:
- Title relevance to the query
- Document update time (prefer recent)
- Repository context (prioritize results from group repos identified in Step 1)
Filter out results that don't belong to the team's knowledge bases.
从搜索结果中,基于以下条件选择前3-5篇最相关的文档:
- 标题与查询的相关性
- 文档更新时间(优先选择近期更新的)
- 仓库上下文(优先选择步骤1中确定的团队仓库的结果)
过滤不属于团队知识库的结果。
Step 5: Read Document Content
步骤5:读取文档内容
For each selected document, fetch the full content:
Tool: yuque_get_doc
Parameters:
repo_id: "<namespace>" # e.g., "my-team/tech-docs" (from search result's book.namespace)
doc_id: "<slug>" # e.g., "api-spec" (from search result's target.slug)Note: The search result contains nested data. Extract these key fields:
- → use as
target.slugdoc_id - → use as
target.book.namespacerepo_id - → document title
target.title - → last update time
target.updated_at
Read up to 3 documents. If the first document fully answers the question, you may skip the rest.
对每一篇选中的文档,获取完整内容:
Tool: yuque_get_doc
Parameters:
repo_id: "<namespace>" # 例如 "my-team/tech-docs"(来自搜索结果的book.namespace字段)
doc_id: "<slug>" # 例如 "api-spec"(来自搜索结果的target.slug字段)注意:搜索结果包含嵌套数据,提取以下关键字段:
- → 用作
target.slugdoc_id - → 用作
target.book.namespacerepo_id - → 文档标题
target.title - → 最后更新时间
target.updated_at
最多读取3篇文档。如果第一篇文档已经可以完整回答问题,可以跳过剩余文档。
Step 6: Synthesize and Respond
步骤6:合成内容并回复
Compose the answer in the following format:
markdown
undefined按照以下格式组织答案:
markdown
undefined回答
回答
[直接回答用户的问题,2-4 句话,简洁明了]
[直接回答用户的问题,2-4 句话,简洁明了]
关键要点
关键要点
- 要点 1:[从文档中提取的关键信息]
- 要点 2:[从文档中提取的关键信息]
- 要点 3:[从文档中提取的关键信息]
- 要点 1:[从文档中提取的关键信息]
- 要点 2:[从文档中提取的关键信息]
- 要点 3:[从文档中提取的关键信息]
参考文档
参考文档
- 文档标题 — 来自「知识库名称」,更新于 YYYY-MM-DD
- 文档标题 — 来自「知识库名称」,更新于 YYYY-MM-DD
undefined- 文档标题 — 来自「知识库名称」,更新于 YYYY-MM-DD
- 文档标题 — 来自「知识库名称」,更新于 YYYY-MM-DD
undefinedGuidelines
使用规范
- Always answer in the same language the user used (Chinese or English)
- Quote specific content from documents when relevant — use blockquotes
> - If documents contain conflicting information, note the discrepancy and mention which doc is more recent
- If the answer is only partially found, say what you found and what's missing
- Never fabricate information not present in the documents
- Include document links so the user can read the full source
- Only return results from group knowledge bases — filter out personal docs
- This skill searches group knowledge bases — for personal docs, use the skill in the
smart-searchpluginyuque-personal
- 始终使用和用户提问相同的语言回复(中文或英文)
- 相关情况下引用文档中的具体内容——使用块引用格式
> - 如果文档中存在冲突信息,说明差异并指出哪份文档更新时间更近
- 如果只找到部分答案,说明你找到的内容以及缺失的信息
- 绝对不要编造文档中不存在的信息
- 附上文档链接,方便用户查看完整来源
- 仅返回团队知识库的结果——过滤掉个人文档
- 本技能用于搜索团队知识库——如果要搜索个人文档,请使用插件中的
yuque-personal技能smart-search
Error Handling
错误处理
| Situation | Action |
|---|---|
| Check if group login is correct and group Token is configured |
| Try alternative keywords, then inform user |
| Skip this doc, note it may have been deleted |
| Tell user they may lack permission; check group Token scope |
| API timeout | Retry once, then inform user of connectivity issue |
| Too many results | Focus on top 3 by relevance, mention there are more results available |
| Team Token not configured | Inform user that group search requires a team-level Token |
| 场景 | 处理方式 |
|---|---|
| 检查group login是否正确,以及团队Token是否已配置 |
| 尝试替换关键词,之后告知用户 |
| 跳过该文档,说明该文档可能已被删除 |
| 告知用户可能缺少权限,检查团队Token的权限范围 |
| API超时 | 重试一次,之后告知用户存在连接问题 |
| 结果过多 | 重点展示相关性最高的前3条,说明还有更多可用结果 |
| 未配置团队Token | 告知用户团队搜索需要团队级别的Token |