JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
docs: 补充 AgenticSkillRetrieval 文档
xutuo5f8d2ee8ac79
diff --git a/docs/en/AgenticSkillRetrieval.md b/docs/en/AgenticSkillRetrieval.mdnew file mode 100644index 0000000000..156f7af421--- /dev/null+++ b/docs/en/AgenticSkillRetrieval.md@@ -0,0 +1,225 @@+# Agentic Skill Retrieval+---++## Concepts++### What is Agentic Skill Retrieval?++Agentic Skill Retrieval is JiuwenSwarm's skill-directory retrieval feature for environments with a **large number of installed skills**.++When only a few skills are installed, the agent can often inspect the list directly. When dozens or hundreds of skills are installed, injecting every skill into the prompt causes two common problems:++| Problem | Impact |+|---------|--------|+| High context usage | User tasks, files, and conversation history have less room |+| Attention dilution | The model may focus on irrelevant skills and miss the right one |++Agentic Skill Retrieval builds a local **installed-skill tree index** and exposes directory-browsing tools at runtime. The agent can inspect likely branches step by step, then decide which `SKILL.md` files to read.++### What it is for++Use it when:++- Many skills are installed and full skill injection would be noisy.+- A task may require multiple capability areas, such as PDF reading, table extraction, and report generation.+- The user does not name a skill, but installed skills may help.+- In Team / Cluster Mode, the Leader needs to identify relevant skills before dispatching work.++It is not meant for:++- Very small skill sets where listing all skills is enough.+- Tasks where the user already names the exact skill to use.+- Tasks that do not need installed skills.+- Installing new skills. Agentic Skill Retrieval only searches **installed skills**.++### Basic workflow++```text+Install skills+ ↓+Build local skill tree index+ ↓+User sends a task+ ↓+Agent chooses likely skill-tree branches+ ↓+skill_branch_explore expands relevant branches+ ↓+skill_branch_peek checks summaries when needed+ ↓+Candidate skills appear+ ↓+Agent reads relevant SKILL.md files+ ↓+JiuwenSwarm executes the task with its existing runtime+```++Agentic Skill Retrieval only helps find skills. It does not replace JiuwenSwarm's existing execution, file operations, tool calls, or team dispatch logic.++### Runtime tools++When enabled, the agent receives these tools:++| Tool | Purpose | When to use |+|------|---------|-------------|+| `skill_branch_explore` | Expand skill-tree branch nodes and reveal child branches or candidate skills | Main retrieval tool |+| `skill_branch_peek` | Inspect lightweight child-branch summaries without expanding the tree | Use when unsure whether a branch is worth exploring |+| `skill_index_build` | Build or reuse the local skill-tree index | Use only when retrieval tools report a missing or stale index |++In normal use, the agent should call `skill_branch_explore` or `skill_branch_peek` first. It should call `skill_index_build` only when the returned result explicitly says the index is missing or stale.++### Chat visualization++Within one conversation turn, the model may call `skill_branch_explore` and `skill_branch_peek` multiple times. The Web UI groups those calls into one dynamic skill tree:++- `explore` expands a node's child branches or skills.+- `peek` adds lightweight summaries to a node without expanding it.+- Multiple calls update the same tree instead of producing unrelated tool cards.+- Candidate skills appear as terminal nodes so users can see why the agent selected them.++This makes the retrieval process visible: users can follow how the agent moves from top-level categories to concrete skills.++---++## Operation Guide++### 1. Install skills++Agentic Skill Retrieval only searches installed skills. Install the skills you need from the left sidebar **Skills** page first.++See [Skills](Skills.md) for installation methods.++### 2. Enable Agentic Skill Retrieval++Open:++```text+Left sidebar → Configuration → Agentic Skill Retrieval+```++Enable **Skill Retrieval** and save the configuration.++When the switch is disabled, JiuwenSwarm does not register the retrieval tools or inject skill-tree guidance. The system returns to the original skill workflow.++### 3. Build the skill index++Open:++```text+Left sidebar → Skills → Skill Index → Build Index+```++The build scans installed skills, reads names, descriptions, and `SKILL.md`, then writes a local skill-tree index. After a successful build, the same index is reused; it does not need to be rebuilt on every startup.++Rebuild when:++- Skills were installed, uninstalled, or heavily modified.+- The UI reports that the index is missing, stale, or failed.+- Build settings such as root categories or max tree depth changed.++### 4. Use retrieval in chat++Users usually do not call the tools directly. Send a normal task, for example:++```text+Please prioritize currently installed skills for this task. If relevant skills are found, use their contents in your answer.++I have a PDF contract and an Excel spreadsheet. Extract key clauses, verify amount fields, and generate a Chinese review report.+```++With Agentic Skill Retrieval enabled, the model can browse the skill tree, discover PDF, Excel, document review, or report-generation skills, and then decide which `SKILL.md` files to read.++### 5. Inspect the retrieval process++In the chat message, expand the skill retrieval tree to see:++- Which top-level categories the model inspected.+- Which branches were peeked.+- Which branches were explored.+- Which candidate skills appeared.++When a skill looks relevant, the agent may read its `SKILL.md` before executing the task.++---++## Configuration++Common settings are available under **Configuration → Agentic Skill Retrieval**.++| Setting | Description |+|---------|-------------|+| Enable Skill Retrieval | Global switch. Disabled means the original skill flow is used |+| Root Categories | Top-level taxonomy used to guide skill-tree construction |+| Max Tree Depth | Maximum depth of the skill tree |+| Split Threshold Base | Threshold for splitting overly large branches |+| Build Workers | Build concurrency |+| Build Retries | Retry count for LLM classification or branch generation failures |+| Build Request Timeout | Timeout for a single build request |+| Build Total Timeout | Maximum total build duration; `0` means unlimited |+| Classification Batch Limit | Max skill batch size for classification |+| Build Postprocess | Clean up unclear or too-small branches after build |+| Equivalent Branch Merge | Merge semantically duplicate branches |+| Max Exposure Depth | How deep `skill_branch_explore` reveals in one call |+| Compact Codes | Use more compact node codes |+| Flatten Tree | Flatten the retrieval tree |++The default retrieval mode is non-compact and non-flat, preserving clear tree structure and branch semantics.++### Root categories++Root categories define the first layer of the tree. They help route a large number of skills into stable, mutually understandable groups.++Good root categories should:++- Cover common user tasks.+- Be as mutually exclusive as practical.+- Use short, clear descriptions.+- Avoid specific tool, framework, or skill names unless they are real business boundaries.++The Web UI shows the default taxonomy so users can edit and save it directly.++---++## FAQ++### Why did the model not call retrieval tools?++Possible reasons:++- The task already named a specific skill.+- The task does not need installed skills.+- The index is missing and retrieval has not been triggered yet.+- The global switch is disabled.++You can make the intent explicit: "Please prioritize currently installed skills for this task."++### Why does the tool say the index is missing?++Open:++```text+Skills → Skill Index → Build Index+```++Alternatively, let the model call `skill_index_build` after a retrieval tool explicitly asks for it. Then retry the task.++### Why does the build take time?++The build reads installed skills and calls the model to generate branches and classifications. More skills and deeper trees take longer. The finished index is reused across conversations.++### Does it install new skills automatically?++No. It only searches installed skills. Install new skills from the **Skills** page.++### Does it replace Team / Cluster Mode dispatch?++No. It helps the Leader or agent find relevant skills. Task decomposition, skill reading, tool execution, and team coordination still use JiuwenSwarm's existing runtime.++---++## Related docs++- [Skills](Skills.md)+- [Configuration](Configuration.md)+- [Agent Team](AgentTeam.md)+- [中文:Agentic 技能检索](../zh/Agentic技能检索.md)diff --git a/docs/en/SUMMARY.md b/docs/en/SUMMARY.mdindex d144685328..b2fad3e789 100644--- a/docs/en/SUMMARY.md+++ b/docs/en/SUMMARY.md@@ -28,6 +28,7 @@- [Context compression & offload](ContextCompression.md)- [Coding Memory](CodingMemory.md)- [Skills](Skills.md)+ - [Agentic Skill Retrieval](AgenticSkillRetrieval.md)- [Skill self-evolution](SkillSelfEvolution.md)- [Agent & workspace](Agent.md)- [Browser tools](Browser.md)diff --git "a/docs/zh/Agentic\346\212\200\350\203\275\346\243\200\347\264\242.md" "b/docs/zh/Agentic\346\212\200\350\203\275\346\243\200\347\264\242.md"new file mode 100644index 0000000000..388d2c82e7--- /dev/null+++ "b/docs/zh/Agentic\346\212\200\350\203\275\346\243\200\347\264\242.md"@@ -0,0 +1,225 @@+# Agentic 技能检索+---++## 概念科普++### Agentic 技能检索是什么++Agentic 技能检索是 JiuwenSwarm 面向**较大规模已安装技能**场景提供的技能目录检索能力。++当已安装技能数量较少时,智能体可以直接查看技能列表并选择合适技能;当技能数量达到几十、上百甚至更多时,直接把所有技能注入上下文会带来两个问题:++| 问题 | 影响 |+|------|------|+| 上下文占用过高 | 用户任务、文件内容和历史对话更容易被挤出上下文 |+| 注意力分散 | 模型容易被大量无关技能干扰,漏掉真正需要的技能 |++Agentic 技能检索通过离线构建一棵**已安装技能树**,并在运行时提供目录浏览工具,让智能体像查目录一样逐层披露相关分支,再决定读取哪些 `SKILL.md`。++### 它解决什么问题++适合以下场景:++- 已安装技能数量较多,不适合把全量技能直接放进 system prompt。+- 用户任务需要组合多个领域能力,例如“读取 PDF → 抽取表格 → 生成报告”。+- 用户没有明确指定技能名称,但任务明显可能受益于已安装技能。+- 团队/集群模式中,Leader 需要先识别相关技能,再组织后续执行。++不适合以下场景:++- 只有很少技能,直接列出技能即可。+- 用户已经明确指定要使用某个技能。+- 当前任务不需要任何已安装技能。+- 需要安装新技能;Agentic 技能检索只检索**已安装技能**,不负责安装。++### 基本工作流++```text+安装技能+ ↓+构建本地技能树索引+ ↓+用户发起任务+ ↓+智能体根据任务选择技能树分支+ ↓+skill_branch_explore 展开相关分支+ ↓+必要时 skill_branch_peek 查看分支摘要+ ↓+发现候选技能+ ↓+读取相关 SKILL.md+ ↓+按 JiuwenSwarm 原有执行能力完成任务+```++Agentic 技能检索只负责“找技能”。它不替代 JiuwenSwarm 原有的执行、文件处理、工具调用、团队派发等能力。++### 三个运行时工具++启用后,智能体会获得以下工具:++| 工具 | 作用 | 使用时机 |+|------|------|----------|+| `skill_branch_explore` | 展开技能树分支,披露下一级分支或候选技能 | 主要检索工具,优先使用 |+| `skill_branch_peek` | 查看分支的轻量摘要和覆盖信息,不展开技能树 | 不确定某个分支是否值得展开时使用 |+| `skill_index_build` | 构建或复用本地技能树索引 | 仅当检索工具提示索引缺失或过期时调用 |++> 一般情况下,模型应先调用 `skill_branch_explore` 或 `skill_branch_peek`。只有工具明确提示“索引未构建或过期”时,才调用 `skill_index_build`。++### 聊天中的可视化++一轮对话中,模型可能多次调用 `skill_branch_explore` 和 `skill_branch_peek`。Web 页面会把这些调用合并展示为一棵动态扩展的技能树:++- `explore`:展开节点的下属分支或技能。+- `peek`:给节点补充分支摘要,不展开树。+- 多次调用会更新同一棵树,而不是堆叠多个孤立工具卡片。+- 当模型发现候选技能后,技能节点会出现在树的末端,便于用户理解模型选择依据。++这使用户能看到智能体如何从第一层分类逐步定位到具体技能。++---++## 操作指导++### 1. 安装技能++Agentic 技能检索只检索已安装技能。请先在左侧导航栏 **技能** 页面安装需要的技能。++技能安装方式见 [技能系统](技能.md)。++### 2. 开启 Agentic 技能检索++操作路径:++```text+左侧导航栏 → 配置信息 → Agentic技能检索+```++打开 **启用技能检索** 后保存配置。++关闭该开关后,JiuwenSwarm 不会注册技能检索工具,也不会注入技能树提示,系统会回到原有技能使用流程。++### 3. 构建技能索引++操作路径:++```text+左侧导航栏 → 技能 → 技能索引 → 构建索引+```++构建过程会扫描已安装技能,读取技能名称、描述和 `SKILL.md`,并生成本地技能树索引。构建完成后会复用同一套索引,不需要每次启动都重新构建。++当以下情况发生时,建议重新构建:++- 安装、卸载或大量修改了技能。+- 页面提示索引缺失、过期或构建失败。+- 调整了树根分层配置、最大树深等构建参数。++### 4. 使用技能检索++通常不需要用户手动调用工具。正常输入任务即可,例如:++```text+请优先利用当前已安装技能完成该任务;如果发现相关技能,请结合技能内容给出结果。++我有一份 PDF 合同和一份 Excel 表格,请提取关键条款,核对金额字段,并生成一份中文审阅报告。+```++启用 Agentic 技能检索后,模型会先浏览技能树,找到可能相关的 PDF、Excel、文档审阅、报告生成等技能,再决定读取哪些 `SKILL.md`。++### 5. 查看检索过程++在聊天消息中展开技能检索树,可以看到:++- 模型探索了哪些第一层分类。+- 哪些分支被 `peek` 查看过。+- 哪些分支被 `explore` 展开。+- 最终出现了哪些候选技能。++如果某个技能被认为相关,模型后续可能会读取该技能的 `SKILL.md`,再按技能说明执行任务。++---++## 配置说明++常用配置项位于 **配置信息 → Agentic技能检索**。++| 配置项 | 说明 |+|--------|------|+| 启用技能检索 | 全局开关。关闭后严格走原有技能流程 |+| 树根分层配置 | 第一层分类定义,用于引导技能树构建 |+| 最大树深 | 控制技能树最大分层深度 |+| 拆分阈值基数 | 控制分支过大时触发继续拆分的阈值 |+| 构建并发数 | 构建索引时的并发数量 |+| 构建重试次数 | LLM 分类或分支生成失败时的重试次数 |+| 构建请求超时 | 单次构建请求的超时时间 |+| 构建总超时 | 整体构建过程的最长时间,`0` 表示不限制 |+| 分类批大小上限 | 单次分类时的技能批大小 |+| 启用构建后处理 | 构建后尝试整理过小或不清晰的分支 |+| 启用等价分支合并 | 构建后合并语义重复的分支 |+| 单次披露深度 | `skill_branch_explore` 单次向下披露的层数 |+| 紧凑编码模式 | 是否使用更紧凑的节点编码 |+| 平铺检索树 | 是否将树结构平铺展示 |++默认检索采用非紧凑、非平铺模式,以保留更清晰的树结构和分支语义。++### 树根分层配置++树根分层配置用于定义第一层分类。它可以帮助构建过程把大量技能分发到互斥、清晰、稳定的大类中。++建议分类满足:++- 覆盖常见用户任务。+- 兄弟分类尽量互斥。+- 描述简洁,便于模型判断。+- 不要把某个具体工具、框架或技能名写成根分类,除非这是你们的主要业务边界。++页面会显示默认配置,用户可以直接编辑并保存。++---++## 常见问题++### 为什么开启后模型没有调用技能检索工具?++可能原因:++- 当前任务已经明确指定了技能。+- 当前任务不需要已安装技能。+- 索引未构建,且模型尚未触发检索工具。+- 全局开关未开启。++可以在任务中明确说明“请优先利用当前已安装技能完成该任务”。++### 为什么工具提示索引未构建?++请进入:++```text+技能 → 技能索引 → 构建索引+```++或让模型在工具提示要求下调用 `skill_index_build`。构建完成后再次发起任务。++### 为什么构建时间较长?++构建会读取所有已安装技能,并调用模型生成分支和分类。技能越多、树越深,耗时越长。构建完成后索引会复用,不需要每轮对话重建。++### 它会自动安装新技能吗?++不会。Agentic 技能检索只检索已安装技能。安装新技能仍需通过 **技能** 页面完成。++### 它会替代集群模式的 Leader 派发吗?++不会。它只帮助 Leader 或普通智能体找到相关技能。具体如何拆解任务、读取技能、执行工具、组织团队,仍由 JiuwenSwarm 原有运行模式完成。++---++## 相关文档++- [技能系统](技能.md)+- [配置说明](配置信息.md)+- [Agent Team 使用指南](AgentTeam.md)+- [English: Agentic Skill Retrieval](../en/AgenticSkillRetrieval.md)diff --git a/docs/zh/SUMMARY.md b/docs/zh/SUMMARY.mdindex 8f63529457..3924df7005 100644--- a/docs/zh/SUMMARY.md+++ b/docs/zh/SUMMARY.md@@ -31,6 +31,7 @@- [上下文压缩卸载](上下文压缩卸载.md)- [编码记忆](编码记忆.md)- [技能系统](技能.md)+ - [Agentic 技能检索](Agentic技能检索.md)- [Skill 自演进](Skill自演进.md)- [智能体与工作区](智能体.md)- [浏览器工具](浏览器.md)@@ -41,4 +42,4 @@- [开发实践](开发实践/README.md)- [日报生成器开发实践](开发实践/JiuwenSwarm日报生成器开发实践.md)- [代码审查助手开发实践](开发实践/JiuwenSwarm代码审查助手开发实践.md)-- [Linux NFS 共享文件系统](../linux-agent-teams-shared-filesystem.md)\ No newline at end of file+- [Linux NFS 共享文件系统](../linux-agent-teams-shared-filesystem.md)diff --git a/llm_config.txt b/llm_config.txtdeleted file mode 100644index 7c51a0433c..0000000000--- a/llm_config.txt+++ /dev/null@@ -1,4 +0,0 @@-model_name: deepseek-v4-flash-api_base: https://api.deepseek.com-api_key: sk-e6709f7581574183968a634d789b6e9e-model_provider: OpenAI\ No newline at end of file