yuque-personal-smart-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Smart Search — Yuque Personal Knowledge Base Search & Q&A

智能搜索——语雀个人知识库搜索与问答

Search across your personal Yuque knowledge bases using natural language, read relevant documents, and synthesize a clear answer with references.
使用自然语言搜索你的个人语雀知识库,读取相关文档,合成带引用的清晰回答。

When to Use

适用场景

  • User asks a question that might be answered by their personal Yuque docs
  • User wants to find specific information in their own knowledge base
  • User says "搜一下我的文档", "search my Yuque", "我的知识库里有没有..."
  • 用户提出的问题可能能从其个人语雀文档中找到答案
  • 用户想要在自己的知识库中查找特定信息
  • 用户说「搜一下我的文档」、「search my Yuque」、「我的知识库里有没有...」

Required MCP Tools

所需MCP工具

All tools are from the
yuque-mcp
server:
  • yuque_search
    — Search documents by keyword
  • yuque_get_doc
    — Read full document content by slug/id
所有工具均来自
yuque-mcp
服务:
  • yuque_search
    — 按关键词搜索文档
  • yuque_get_doc
    — 通过slug/id读取完整文档内容

Workflow

工作流程

Step 1: Extract Search Keywords

步骤1:提取搜索关键词

From the user's natural language query, extract 1-3 concise Chinese keywords. Yuque search works best with short, specific terms.
Examples:
  • "我的部署流程文档在哪?" → keywords:
    部署流程
  • "How do I handle error logging?" → keywords:
    错误日志
    or
    日志处理
  • "我之前写的技术评审笔记" → keywords:
    技术评审
从用户的自然语言查询中,提取1-3个简洁的中文关键词。语雀搜索使用简短、具体的术语时效果最佳。
示例:
  • 「我的部署流程文档在哪?」 → 关键词:
    部署流程
  • 「How do I handle error logging?」 → 关键词:
    错误日志
    日志处理
  • 「我之前写的技术评审笔记」 → 关键词:
    技术评审

Step 2: Search Documents

步骤2:搜索文档

Call
yuque_search
with the extracted keywords:
Tool: yuque_search
Parameters:
  query: "<keywords>"
  type: "doc"
If the search returns no results:
  1. Try alternative keywords (synonyms, broader terms)
  2. Try splitting compound terms (e.g., "部署流程" → "部署" or "流程")
  3. If still no results, tell the user honestly: "在你的语雀知识库中未找到相关文档,建议尝试其他关键词或确认文档是否存在。"
调用
yuque_search
传入提取的关键词:
Tool: yuque_search
Parameters:
  query: "<keywords>"
  type: "doc"
如果搜索没有返回结果:
  1. 尝试替换关键词(同义词、更宽泛的术语)
  2. 尝试拆分复合词(例如「部署流程」→「部署」或「流程」)
  3. 如果仍然没有结果,如实告知用户:「在你的语雀知识库中未找到相关文档,建议尝试其他关键词或确认文档是否存在。」

Step 3: Filter and Rank Results

步骤3:筛选和排序结果

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 (focus on user's personal repos)
从搜索结果中,基于以下条件选择3-5篇最相关的文档:
  • 标题与查询的相关性
  • 文档更新时间(优先选择近期更新的)
  • 仓库上下文(聚焦用户的个人仓库)

Step 4: Read Document Content

步骤4:读取文档内容

For each selected document, fetch the full content:
Tool: yuque_get_doc
Parameters:
  repo_id: "<namespace>"    # e.g., "username/my-notes" (from search result's book.namespace)
  doc_id: "<slug>"          # e.g., "api" (from search result's target.slug)
Note: The search result contains nested data. Extract these key fields:
  • target.slug
    → use as
    doc_id
  • target.book.namespace
    → use as
    repo_id
  • target.title
    → document title
  • target.updated_at
    → last update time
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>"    # e.g., "username/my-notes" (from search result's book.namespace)
  doc_id: "<slug>"          # e.g., "api" (from search result's target.slug)
注意:搜索结果包含嵌套数据。提取以下关键字段:
  • target.slug
    → 用作
    doc_id
  • target.book.namespace
    → 用作
    repo_id
  • target.title
    → 文档标题
  • target.updated_at
    → 最后更新时间
最多读取3篇文档。如果第一篇文档已经能完整回答问题,可以跳过剩余文档。

Step 5: Synthesize and Respond

步骤5:合成并回复

Compose the answer in the following format:
markdown
undefined
按照以下格式组织回答:
markdown
undefined

回答

回答

[直接回答用户的问题,2-4 句话,简洁明了]
[直接回答用户的问题,2-4 句话,简洁明了]

关键要点

关键要点

  • 要点 1:[从文档中提取的关键信息]
  • 要点 2:[从文档中提取的关键信息]
  • 要点 3:[从文档中提取的关键信息]
  • 要点 1:[从文档中提取的关键信息]
  • 要点 2:[从文档中提取的关键信息]
  • 要点 3:[从文档中提取的关键信息]

参考文档

参考文档

  1. 文档标题 — 来自「知识库名称」,更新于 YYYY-MM-DD
  2. 文档标题 — 来自「知识库名称」,更新于 YYYY-MM-DD
undefined
  1. 文档标题 — 来自「知识库名称」,更新于 YYYY-MM-DD
  2. 文档标题 — 来自「知识库名称」,更新于 YYYY-MM-DD
undefined

Guidelines

使用规范

  • 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
  • This skill searches the user's personal knowledge bases — for team knowledge bases, use the
    smart-search
    skill in the
    yuque-group
    plugin
  • 始终使用用户提问的语言回答(中文或英文)
  • 相关情况下引用文档中的具体内容——使用
    >
    块引用
  • 如果文档包含冲突信息,注明差异并说明哪篇文档更新
  • 如果只找到部分答案,说明你找到的内容以及缺失的部分
  • 绝对不要编造文档中不存在的信息
  • 包含文档链接,方便用户查看完整来源
  • 本技能仅搜索用户的个人知识库——如需搜索团队知识库,请使用
    yuque-group
    插件中的
    smart-search
    技能

Error Handling

错误处理

SituationAction
yuque_search
returns empty
Try alternative keywords, then inform user
yuque_get_doc
fails (404)
Skip this doc, note it may have been deleted
yuque_get_doc
fails (403)
Tell user they may lack permission to access this doc
API timeoutRetry once, then inform user of connectivity issue
Too many resultsFocus on top 3 by relevance, mention there are more results available
场景处理方式
yuque_search
返回空结果
尝试替换关键词,然后告知用户
yuque_get_doc
调用失败(404)
跳过该文档,提示它可能已被删除
yuque_get_doc
调用失败(403)
告知用户可能没有访问该文档的权限
API超时重试一次,然后告知用户连接问题
结果过多聚焦相关性最高的前3条,提示还有更多可用结果