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(symphony): 更新 Symphony 文档
xutuoe9858540e81f
diff --git a/docs/README.md b/docs/README.mdindex ff9732afc3..bab0204953 100644--- a/docs/README.md+++ b/docs/README.md@@ -90,6 +90,11 @@<td width="28%"><a href="zh/技能.md">技能</a></td><td width="50%">智能体技能挂载、调用与扩展机制。</td></tr>+ <tr>+ <td width="22%"><strong>技能交响乐</strong></td>+ <td width="28%"><a href="zh/symphony-技能编排与分发.md">技能交响乐</a></td>+ <td width="50%">技能编排与分发系统。</td>+ </tr><tr><td width="22%"><strong>频道</strong></td><td width="28%"><a href="zh/频道.md">频道</a> / <a href="zh/ACP插件使用.md">ACP 插件使用</a> / <a href="zh/TUI使用指南.md">TUI 使用指南</a></td>diff --git a/docs/README_EN.md b/docs/README_EN.mdindex f489d400a8..db26cd06b2 100644--- a/docs/README_EN.md+++ b/docs/README_EN.md@@ -90,6 +90,11 @@ This page collects common JiuwenSwarm usage instructions, feature documentation,<td width="28%"><a href="en/Skills.md">Skills</a></td><td width="50%">Agent skill mounting, invocation, and extension mechanisms.</td></tr>+ <tr>+ <td width="22%"><strong>Skill Symphony</strong></td>+ <td width="28%"><a href="en/symphony.md">Skill Symphony</a></td>+ <td width="50%">Introduces skill orchestration and dispatch system.</td>+ </tr><tr><td width="22%"><strong>Channels</strong></td><td width="28%"><a href="en/Channels.md">Channels</a> / <a href="en/ACP_Client_Config.md">ACP Plugin Usage</a> / <a href="en/CLI.md">TUI User Guide</a></td>diff --git a/docs/en/AgenticSkillRetrieval.md b/docs/en/AgenticSkillRetrieval.mddeleted file mode 100644index 156f7af421..0000000000--- a/docs/en/AgenticSkillRetrieval.md+++ /dev/null@@ -1,225 +0,0 @@-# 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/Configuration.md b/docs/en/Configuration.mdindex 7d6f3f6095..349353892f 100644--- a/docs/en/Configuration.md+++ b/docs/en/Configuration.md@@ -21,8 +21,9 @@ The configuration panel contains the following main sections:- **Context Compression**: Dialogue history management (see [6. Context Compression](#6-context-compression))- **Tool Security Guardrails**: Tool invocation permission checks (see [7. Tool Security Guardrails](#7-tool-security-guardrails))- **Memory Sensitive-Info Filtering**: Memory system privacy protection settings (see [8. Memory Sensitive-Info Filtering](#8-memory-sensitive-info-filtering))+- **Skill Symphony and Skill Retrieval**: Skill-tree retrieval, skill score, and skill orchestration settings (see [9. Skill Symphony and Skill Retrieval Configuration](#9-skill-symphony-and-skill-retrieval-configuration))-The panel also includes **Free Search Engine Configuration**, **Multi-Agent / Team Configuration**, **A2UI**, **Agentic Skill Retrieval**, **Memory Sensitive-Info Filtering**, and **Email Configuration** sections. Configure them as needed.+The panel also includes **Free Search Engine Configuration**, **Multi-Agent / Team Configuration**, **A2UI**, and **Email Configuration** sections. Configure them as needed.> 💡 **Tip**: Model configuration (`api_base`, `api_key`, `model`, `model_provider`) is required; all other configurations are optional.@@ -329,11 +330,88 @@ The system automatically identifies and filters the following types of sensitive----## 9. Advanced Configuration+## 9. Skill Symphony and Skill Retrieval Configuration++Symphony settings control two related capabilities: **Skill Retrieval** finds candidate skills from installed skills, and **Skill Orchestration** uses the skill score to organize candidates into a confirmable, executable skill chain.++### 9.1 Frontend switches++The configuration panel exposes two related switches:++| Switch | Config key | Default | Purpose |+| --- | --- | --- | --- |+| **Enable Skill Retrieval** | `symphony.skill_retrieval.enabled` | `false` | Registers skill-tree retrieval tools such as `skill_branch_explore`, `skill_branch_peek`, and `skill_index_build` |+| **Enable Skill Symphony** | `symphony.enabled` | `false` | Registers skill score and orchestration tools such as `symphony_read_score`, `symphony_refresh_score`, and `symphony_compose_score` |++The two switches are independent. Skill Retrieval answers "how to find candidate skills"; Skill Symphony answers "how to orchestrate candidate skills into a route". If only Skill Retrieval is enabled, the system only gets skill-tree retrieval. If only Skill Symphony is enabled, the system can read and refresh the skill score, but candidate skills do not automatically come from Skill Retrieval.++### 9.2 Skill index and skill score++Related pages are under **Skills** in the left sidebar:++| Page | Purpose |+| --- | --- |+| **Skill Index** | Builds the local installed-skill tree index used for step-by-step retrieval |+| **Skill Graph** | Builds and displays connectable relationships between skills for orchestration |++After installing, uninstalling, or heavily modifying skills, rebuild the skill index. If the skill changes affect relationships between skills, also run an incremental build or full rebuild on the Skill Graph page.++### 9.3 Symphony settings in the main config++Advanced build, retrieval, and orchestration parameters are configured in the user runtime config file:++```text+~/.jiuwenswarm/config/config.yaml+```++Common settings:++| Setting | Default | Description |+| --- | --- | --- |+| `symphony.paths.skills_root` | Empty string | Skill source directory; empty means the runtime default is used |+| `symphony.paths.score_dir` | Empty string | Skill score artifact directory; empty means the runtime default is used |+| `symphony.fingerprint.scan.max_depth` | Empty | Maximum skill-file scan depth; empty means the runtime default is used |+| `symphony.fingerprint.extraction.workers` | `4` | Skill fingerprint extraction concurrency |+| `symphony.fingerprint.extraction.batch_size` | `2` | Skill fingerprint extraction batch size |+| `symphony.fingerprint.extraction.body_limit` | Empty | Body length limit for fingerprint extraction; empty means the runtime default is used |+| `symphony.fingerprint.normalization.workers` | `4` | Skill fingerprint normalization concurrency |+| `symphony.fingerprint.normalization.batch_size` | `2` | Skill fingerprint normalization batch size |+| `symphony.fingerprint.normalization.duplicate_name_similarity_threshold` | `0.8` | Similarity threshold for detecting near-duplicate skill names |+| `symphony.fingerprint.normalization.max_vocab_size` | Empty | Maximum dynamic vocabulary size; empty means the runtime default is used |+| `symphony.build.workers` | `4` | Skill score build concurrency |+| `symphony.build.batch_size` | `16` | Skill score build batch size |+| `symphony.build.require_consensus` | `false` | Whether multiple judgments must agree before accepting a relationship |+| `symphony.build.min_edge_confidence` | `0.1` | Minimum edge confidence written into the skill score |+| `symphony.orchestration.mode` | `fast` | Orchestration mode. The current runtime uses the fast orchestration path |+| `symphony.orchestration.top_k` | `3` | Maximum number of candidate routes retained during orchestration |+| `symphony.orchestration.max_depth` | `4` | Maximum skill-chain search depth |+| `symphony.orchestration.min_edge_confidence` | `0.3` | Minimum skill-score edge confidence preferred by orchestration |+| `symphony.skill_retrieval.artifact_root` | Empty string | Skill index artifact directory; empty means the default workspace is used; can be supplied by `SYMPHONY_SKILL_RETRIEVAL_ROOT` |+| `symphony.skill_retrieval.build.branching_factor` | `128` | Skill-tree split-threshold base; controls how coarse or fine the tree is |+| `symphony.skill_retrieval.build.max_depth` | `6` | Maximum skill-tree depth |+| `symphony.skill_retrieval.build.root_categories` | Empty string | Root taxonomy configuration used to stabilize the first tree layer |+| `symphony.skill_retrieval.build.max_workers` | `2` | Skill index build concurrency |+| `symphony.skill_retrieval.build.max_retries` | `2` | Retry count for failed LLM classification or grouping calls |+| `symphony.skill_retrieval.build.request_timeout_seconds` | `420` | Timeout for one LLM build request |+| `symphony.skill_retrieval.build.classification_batch_limit` | `32` | Maximum number of skills per classification call |+| `symphony.skill_retrieval.build.discovery_seed` | `42` | Random seed used during build sampling for better reproducibility |+| `symphony.skill_retrieval.build.postprocess_enabled` | `true` | Whether to clean up unclear or too-small branches after build |+| `symphony.skill_retrieval.build.postprocess_max_passes` | `1` | Maximum number of postprocess passes after build |+| `symphony.skill_retrieval.build.postprocess_min_skills` | `6` | Minimum skill-count reference used by postprocess branch cleanup |+| `symphony.skill_retrieval.build.equivalence_enabled` | `false` | Whether to merge semantically duplicate branches |+| `symphony.skill_retrieval.retrieve.compact_codes_enabled` | `false` | Whether retrieval uses more compact node codes |+| `symphony.skill_retrieval.retrieve.flatten_tree` | `false` | Whether retrieval flattens the skill tree |+| `symphony.skill_retrieval.retrieve.max_exposure_depth` | `1` | Maximum tree depth exposed by one `skill_branch_explore` call |++> 📖 For details about Skill Retrieval, the skill score, and Skill Orchestration, see [Symphony: Skill Retrieval, Orchestration, and Dispatch](symphony.md).++---++## 10. Advanced ConfigurationBeyond the **Configuration** page, the product may use a **main configuration** for timeouts, temperature, heartbeat interval, context thresholds, and toggles that work together with **context compression**, **permissions**, **memory restrictions**, and similar UI switches. **This document does not state where those files live on disk**; for offline edits or bulk rollout, contact your administrator.-### 9.1 Common logical keys (conceptual paths)+### 10.1 Common logical keys (conceptual paths)These are **conceptual** paths in the main configuration for cross-reference with ops or release notes; they are **not** a one-to-one list of every UI field.@@ -349,11 +427,11 @@ These are **conceptual** paths in the main configuration for cross-reference wit<a id="dotenv-configuration"></a>-### 9.2 Runtime parameters outside the Configuration page+### 10.2 Runtime parameters outside the Configuration pageFine-grained options for browser automation, network proxies, or some search paths may be supplied by the **runtime or deployment template** and **may not** appear on the **Configuration** page. Typical users only need required UI fields and business keys; leave the rest to admins or ops.-### 9.3 Precedence (conceptual)+### 10.3 Precedence (conceptual)Generally, from highest to lowest: **values you save in the web Configuration UI** → **environment-injected variables** → **built-in product defaults**. Exact behavior depends on your version and deployment.diff --git a/docs/en/SUMMARY.md b/docs/en/SUMMARY.mdindex b2fad3e789..b19fff972d 100644--- a/docs/en/SUMMARY.md+++ b/docs/en/SUMMARY.md@@ -28,7 +28,7 @@- [Context compression & offload](ContextCompression.md)- [Coding Memory](CodingMemory.md)- [Skills](Skills.md)- - [Agentic Skill Retrieval](AgenticSkillRetrieval.md)+ - [Symphony](symphony.md)- [Skill self-evolution](SkillSelfEvolution.md)- [Agent & workspace](Agent.md)- [Browser tools](Browser.md)diff --git a/docs/en/Skills.md b/docs/en/Skills.mdindex 0d36345e03..dd33f9fcc1 100644--- a/docs/en/Skills.md+++ b/docs/en/Skills.md@@ -184,8 +184,8 @@ The Skills management page is the main place to manage and browse all skills. Op|--------|------|| **My Skills** | Browse and search installed skills, filter by "All / Enabled / Disabled", toggle skills on/off, and open details || **Skill Marketplace** | Install new skills; contains three sub-pages: **Built-in**, **SwarmSkills online search**, and **Skills online search** (SkillNet / ClawHub) |-| **Skill Graph** | Visualize the capability relationships among installed skills |-| **Skill Index** | Build a local skill retrieval index and find matching skills by task need |+| **Skill Graph** | Visualize capability relationships among installed skills; see [Symphony](symphony.md) |+| **Skill Index** | Build a local skill retrieval index and find matching skills by task need; see [Symphony](symphony.md) |@@ -215,53 +215,9 @@ In the list, use **View skill experience** to browse evolution entries for that> **Why it helps:** Skill experience reflects self-evolution and improvements from real use, so you can judge ongoing usefulness and maintainers get actionable input.-#### Skill graph+#### Skill graph and skill index-The skill graph shows how installed skills can connect to each other. Each node represents a skill, and each edge represents a `can_feed` relationship: one skill's output can be used as another skill's input. It helps users understand possible skill combinations and gives Skill Symphony candidate relationships for orchestration.----#### How to read the skill graph--| Element | Description |-|------|------|-| **Node** | An installed skill. The node label usually matches the skill name or skill ID |-| **Edge** | A `can_feed` relationship between two skills |-| **Direction** | `A -> B` means skill A can feed its output into skill B |-| **Confidence** | How confident the system is that this connection is usable; higher confidence is a stronger orchestration candidate |-| **In-degree** | How many upstream skills can feed into this skill under the current filters |-| **Out-degree** | How many downstream skills this skill can feed under the current filters |--> **Tip:** The graph shows candidate connections, not execution history. A visible edge does not guarantee every task can be chained directly. Always check the skill details, required inputs, and current task goal.--#### Page areas--| Area | Purpose |-|------|------|-| **Left panel** | Shows visible skill/edge counts, search, minimum confidence, and the skill list |-| **Canvas** | Shows the relationship graph. Drag to pan, scroll to zoom, and click a node to inspect it |-| **Right details** | Shows the selected skill's ID, in-degree, out-degree, description, inputs, outputs, tasks, and related edges |--In **Related edges**:-- `->` means the selected skill can provide output to the target skill-- `<-` means the selected skill can receive output from an upstream skill-- `can_feed · 85%` shows the edge type and confidence--#### Common actions--| Action | Description |-|------|------|-| **Search skills** | Enter keywords in the left search box to show matching skills and related connections |-| **Adjust minimum confidence** | Hide lower-confidence edges so you can focus on stronger connections |-| **Read graph** | Reload the existing built skill graph |-| **Incremental build** | Update the graph after adding, removing, or changing skills |-| **Pause build** | Pause a long-running graph build while keeping completed cache and checkpoints |-| **Full rebuild** | Recompute everything when the graph looks stale or incorrect |-| **Fit view** | Re-center and scale the visible graph |--#### Minimum confidence--The minimum confidence slider only filters the already loaded graph locally. It can hide edges below the current threshold, but it does not recompute relationships and cannot reveal edges below the build-time acceptance threshold. To regenerate candidate relationships, run an incremental build or full rebuild.+The **Skill Graph** and **Skill Index** tabs are part of Symphony. The skill index helps the agent find candidate skills from a large installed-skill set, while the skill graph uses `can_feed` relationships to show whether skills can connect. For multi-skill orchestration, graph building, graph reading, and chat usage, see [Symphony: Skill Orchestration and Dispatch](symphony.md).---@@ -432,57 +388,9 @@ Before using a skill, check:Show gitcode-pr details and SKILL.md content.```-### How to use Skill Symphony in chat--Skill Symphony is useful when a task needs several skills to work together, such as "recognize text from an image, translate it, write copy, and send an email." It first produces an executable route from installed skills and the skill graph, then you can confirm before running the actual skills.--#### Before you use it--1. Open left sidebar → **Configuration** → **Other configuration**.-2. Expand **Skill Symphony**, turn on **Enable Skill Symphony**, then click **Save** in the top-right corner.-3. Confirm the required skills are installed. If you recently added, removed, or changed skills, open **Skills** → **Skill graph** and run **Incremental build** or **Read graph** first.----#### Recommended prompt style--In chat, say that you want to use skills, and provide the goal, input material, expected output, and follow-up action in one request.--**Template:**--```text-Use Skill to complete <final goal>.-The input is <file, link, text, or account information>.-I need <output format or deliverable>, then <whether to continue with the next action>.-```--**Example:**--```text-Use Skill to translate an English technical blog image into Chinese,-write a WeChat public-account intro copy, and send it to my email.-Image URL: https://gitcode.com/lin-xiaoyu/data/blob/main/blog.webp-```--Prompts that trigger Skill Symphony more reliably:-- Explicitly say "Use Skill" or "use skills"-- Describe the complete goal instead of only one step-- Provide required inputs such as image URL, file path, recipient, target language, or output format-- If you want the system to continue after planning, reply with "execute according to the orchestration result" or "confirm and continue"--#### Understand the orchestration result--After Skill Symphony is enabled, the system first returns a skill orchestration graph and a short explanation. Each box is a skill, and each arrow shows execution order and result handoff. In the example below, the route is `image-translate -> yescan-ocr-universal -> general-writing -> imap-smtp-email`: translate the image, extract text, write copy, then send the email.----After seeing the route, you can respond in one of these ways:-- **Route looks right**: reply "execute according to the orchestration result"-- **Missing information**: provide the missing file, link, email address, account, or parameter-- **Route is not right**: clarify the change, such as "do not send email, only generate copy" or "run OCR before translation"-- **Plan only**: stop after the orchestration result and use it as a skill-combination suggestion+### Multi-skill tasks: Skill Symphony-> **Tip:** Skill Symphony can only orchestrate installed skills and available configuration. If the result says no suitable skill is available, install the required skill first, then refresh or rebuild the skill graph and try again.+When a task needs several skills to work together, such as "recognize text from an image, translate it, write copy, and send an email," Skill Symphony can first produce a skill chain and then wait for confirmation before execution. For setup, prompt examples, and how to read the orchestration result, see [Symphony: Skill Orchestration and Dispatch](symphony.md).---diff --git a/docs/en/Symphony.md b/docs/en/Symphony.mdnew file mode 100644index 0000000000..e271cdc21e--- /dev/null+++ b/docs/en/Symphony.md@@ -0,0 +1,509 @@+# Symphony: Skill Retrieval, Orchestration, and Dispatch+---++## Concepts++### What is Symphony?++Symphony is JiuwenSwarm's mechanism for skill retrieval, orchestration, and dispatch across a large set of installed skills. It answers two questions: **how to find the right skills**, and **how to use them together**.++- **Skill Retrieval** answers "how to find": it organizes a flat skill list into a browsable skill tree so the agent can explore likely branches and find candidate skills.+- **Skill Orchestration** answers "how to use": it uses candidate skills, input/output structures, and skill dependencies to produce a confirmable, executable skill chain.++You can think of Symphony as a two-part design: **a tree for retrieval, a graph for orchestration**. If a task only needs one clearly named skill, use the normal skill workflow. Symphony is meant for tasks that need the agent to find skills, check whether they can connect, and then form an execution route. In Team / Cluster Mode, that route can also guide how the Leader dispatches follow-up work.++#### Find candidate skills with Skill Retrieval++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 skill 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 |++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.++#### Build an execution route with Skill Orchestration++If Skill Retrieval answers "which skills should participate", Skill Orchestration answers "how should they work together". For example, a task such as "recognize text from an image, translate it, write copy, and send an email" usually cannot be completed by one skill alone. Candidate skills need to be arranged into a stable route based on input/output dependencies.++Skill Orchestration builds an executable route from the task goal, current inputs, candidate skills, and connectable relationships in the skill score. When an input is missing, the system can look backward through the graph for an upstream skill that may provide it. After the route is confirmed, JiuwenSwarm continues with the actual skill execution.++The important part is not listing skills in order. Skill Orchestration checks whether upstream results can actually feed downstream skills. Connectable relationships, input/output structures, and task semantics all affect the final route. The result is not just a set of "related" skills, but a skill chain whose dependencies can be explained, confirmed, and executed.++The skill score is the graph used by orchestration. Each node represents a skill. Each edge means one skill's output can be used as another skill's input, in other words, a connectable relationship. It helps users understand possible skill combinations and gives orchestration candidate relationships to work from.++++The skill score shows connectable candidate relationships. It is not execution history, and it does not guarantee every visible connection can be chained directly for every task. Always check the skill details, required inputs, and current task goal.++#### What problem does it solve?++- **Too many skills to inspect directly**: Skill Retrieval avoids putting every skill description into context and lets the agent find candidates step by step.+- **Knowing which skills are relevant is not enough**: orchestration checks whether upstream outputs can actually feed downstream inputs.+- **Multi-skill workflows need stable chaining**: the skill score's connectable relationships help form confirmable, executable skill chains instead of ad hoc runtime stitching.+- **Complex tasks need explanation and dispatch**: users or Leaders can see why each skill was selected, how results flow, and how follow-up work can be dispatched.++### End-to-end workflow++```text+Install skills+ v+Build the local skill tree index+ v+Build or read the skill score+ v+User sends a task+ v+The agent selects skill-tree branches for the task+ v+skill_branch_explore expands relevant branches+ v+skill_branch_peek checks branch summaries when needed+ v+Candidate skills are found+ v+Skill Orchestration builds a skill chain from the task goal, candidate skills, and skill score+ v+User confirms+ v+JiuwenSwarm continues with concrete skill execution+```++Skill Retrieval mainly finds skills. Skill Orchestration organizes candidate skills into a task-oriented execution route. The skill score records and displays whether skills can connect, giving orchestration the graph relationships it needs. Skill Retrieval and Skill Orchestration are Symphony's two core capabilities.++### Runtime tools++When Skill Retrieval is enabled, the agent receives skill-directory browsing tools. When Skill Symphony is enabled, the agent receives score and orchestration tools. Users usually do not need to call these tools manually; the system chooses them based on the task.++#### Skill Retrieval tools++| Tool | What it does | When to use |+|------|--------------|-------------|+| `skill_branch_explore` | Expands a skill-tree branch and reveals child branches or candidate skills | Main retrieval tool, used to inspect relevant branches |+| `skill_branch_peek` | Shows a lightweight branch summary without expanding the full tree | Use when it is unclear whether a branch is worth expanding |+| `skill_index_build` | Builds or refreshes the local installed-skill tree index | Use only when retrieval tools explicitly report a missing or stale index |++When `skill_branch_explore` returns a `skills` section, those entries are installed skills, not branch IDs. The agent narrows candidates by skill name, description, and returned `worker_id`. If orchestration is needed later, those `worker_id` values can be passed to `symphony_compose_score` as `candidate_skill_ids`.++#### Skill Orchestration tools++| Tool | What it does | When to use |+|------|--------------|-------------|+| `symphony_read_score` | Checks whether the skill score exists and whether it is stale | Before orchestration, when the current score state needs to be known |+| `symphony_refresh_score` | Extracts installed-skill features and refreshes the skill score | When the score is missing, stale, or skills were newly installed or changed |+| `symphony_compose_score` | Main orchestration entry. Builds an execution graph from the task goal, candidate skills, and skill score | When the user asks to use skills, or the task needs a skill chain, skill ordering, or a specialized tool chain |++The core parameter of `symphony_compose_score` is `query`, the original user task. The current orchestration mode is `fast`. If Skill Retrieval has already narrowed the candidate set, pass the `worker_id` list from `skill_branch_explore` into `candidate_skill_ids`; Symphony will compose a skill chain from those candidates and their connectable neighbors. If the result says no suitable skill is available, install the required skill from the **Skills** page, call `symphony_refresh_score` to refresh the score, and then compose again with the original task.++---++## Operation Guide++### 1. Prepare installed skills++Symphony only uses installed skills. Install the skills you need from the left sidebar **Skills** page first.++See [Skills](Skills.md) for installation methods.++### 2. Enable Skill Retrieval++Open:++```text+Left sidebar -> Configuration -> Skill Retrieval+```++Enable **Skill Retrieval** and save the configuration.++When the switch is disabled, JiuwenSwarm does not register 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. Build the skill score++Open:++```text+Left sidebar -> Skills -> Skill Graph+```++#### How to read the skill graph++| Element | Description |+|---------|-------------|+| **Node** | An installed skill. The node label usually matches the skill name or skill ID |+| **Edge** | A connectable relationship between two skills, meaning the upstream skill output can be used by the downstream skill |+| **Direction** | `A -> B` means skill A can feed its output into skill B |+| **Confidence** | How confident the system is that this edge is usable; higher confidence is a stronger orchestration candidate |+| **In-degree** | How many upstream skills can feed into this skill under the current filters |+| **Out-degree** | How many downstream skills this skill can feed under the current filters |++#### Page areas++| Area | Purpose |+|------|---------|+| **Left panel** | Shows visible skill/edge counts, search, minimum confidence, and the skill list |+| **Canvas** | Shows the relationship graph. Drag to pan, scroll to zoom, and click a node to inspect it |+| **Right details** | Shows the selected skill's ID, in-degree, out-degree, description, inputs, outputs, tasks, and related edges |++In **Related edges**:++- `->` means the selected skill can provide output to the target skill.+- `<-` means the selected skill can receive output from an upstream skill.+- `Connectable - 85%` shows the edge type and confidence.++#### Common actions++| Action | Description |+|--------|-------------|+| **Search skills** | Enter keywords in the left search box to show matching skills and related relationships |+| **Adjust minimum confidence** | Hide lower-confidence edges so you can focus on stronger skill handoffs |+| **Read score** | Reload the existing built skill score |+| **Incremental build** | Update the score after adding, removing, or changing skills |+| **Pause build** | Pause a long-running score build while keeping completed cache and checkpoints |+| **Full rebuild** | Recompute everything when the score looks stale or incorrect |+| **Fit view** | Re-center and scale the visible graph |++#### Minimum confidence++The minimum confidence slider only filters the already loaded graph locally. It can hide edges below the current threshold, but it does not recompute relationships and cannot reveal edges below the build-time acceptance threshold. To regenerate candidate relationships, run an incremental build or full rebuild.++### 5. Use Skill 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 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.++### 6. 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.++### 7. Use Skill Orchestration++#### Before you use it++1. Open left sidebar -> **Configuration** -> **Other configuration**.+2. Expand **Skill Symphony**, turn on **Enable Skill Symphony**, then click **Save** in the top-right corner.+3. Confirm the required skills are installed. If you recently added, removed, or changed skills, open **Skills** -> **Skill Graph** and run **Incremental build**. If you only need to confirm the current score state, use **Read score**.++The **Skill Symphony** switch enables Symphony orchestration. Skill Retrieval is still controlled by the separate **Skill Retrieval** switch.++++#### Recommended prompt style++In chat, say that you want to use skills, and provide the goal, input material, expected output, and follow-up action in one request.++**Template:**++```text+Use Skill to complete <final goal>.+The input is <file, link, text, or account information>.+I need <output format or deliverable>, then <whether to continue with the next action>.+```++**Example:**++```text+Use Skill to translate an English technical blog image into Chinese,+write a WeChat public-account intro copy, and send it to my email.+Image URL: XXX+```++Prompts that trigger Skill Orchestration more reliably:++- Explicitly say "Use Skill" or "use skills".+- Describe the complete goal instead of only one step.+- If you want the system to continue after planning, reply with "execute according to the orchestration result" or "confirm and continue".++#### Understand the orchestration result++After Skill Symphony is enabled, the system first returns a skill orchestration graph and a short explanation. Each box is a skill, and each arrow shows execution order and result handoff. In the example below, the route is `image-translate -> yescan-ocr-universal -> general-writing -> imap-smtp-email`: translate the image, extract text, write copy, then send the email.++++After seeing the route, you can respond in one of these ways:++- **Route looks right**: reply "execute according to the orchestration result".+- **Missing information**: provide the missing file, link, email address, account, or parameter.+- **Plan only**: stop after the orchestration result and use it as a skill-combination suggestion.++> **Tip:** Skill Orchestration only uses currently installed skills and available configuration. If the result says no suitable skill is available, install the required skill first, then refresh or rebuild the skill score and try again.++---++## Configuration++The Web configuration page exposes two related switches: **Enable Skill Retrieval** controls skill-tree retrieval tools, and **Enable Skill Symphony** controls skill score and orchestration tools. The Skill Index page provides index build, rebuild, cancel, status, and tree viewing operations. The Skill Graph page provides score reading, incremental build, pause build, and full rebuild operations.++Advanced build, retrieval, and orchestration settings are configured in the user runtime config file:++```text+~/.jiuwenswarm/config/config.yaml+```++### Configuration items++#### `symphony.enabled`++Whether to enable Symphony orchestration. The default template value is `false`.++When enabled, new sessions register orchestration tools such as `symphony_read_score`, `symphony_refresh_score`, and `symphony_compose_score`. The agent can read or refresh the skill score and build a skill chain from candidate skills. When disabled, these tools are not registered and the agent does not use the skill score for orchestration.++This switch controls Symphony orchestration tools. Skill Retrieval is still controlled separately by `symphony.skill_retrieval.enabled`: retrieval finds candidate skills, and orchestration builds an execution route from the task goal, candidate skills, and the skill score.++#### `symphony.paths.skills_root` / `symphony.paths.score_dir`++The skill source directory and skill score artifact directory. Both default template values are empty strings, which means the runtime default directories are used.++`symphony_refresh_score` reads skills from `skills_root` and refreshes the skill score. `symphony_read_score` and `symphony_compose_score` read score artifacts from `score_dir`. Configure these paths explicitly when the score needs to be cached in a fixed location or reused across runtime environments.++#### `symphony.orchestration`++Runtime parameters for Skill Orchestration. The current template is:++| Setting | Default | Description |+|---------|---------|-------------|+| `mode` | `fast` | Orchestration mode. The current runtime tools use the fast orchestration path and prioritize an executable skill chain |+| `top_k` | `3` | Maximum number of candidate routes retained per orchestration round. Larger values cover more alternatives but can make output less focused |+| `max_depth` | `4` | Maximum skill-chain search depth, limiting how many skills can be chained in one task |+| `min_edge_confidence` | `0.3` | Minimum confidence threshold for skill-score edges. Edges below this value are not preferred for orchestration |++These settings tune how candidate skills are connected into a route. If routes are too short or often miss intermediate steps, consider increasing `max_depth`. If routes are too broad or unstable, consider lowering `top_k` or increasing `min_edge_confidence`.++#### `symphony.skill_retrieval.enabled`++Whether to enable Skill Retrieval. The default template value is `false`. This setting can be configured from the Web UI.++When enabled, new sessions receive `skill_branch_explore`, `skill_branch_peek`, `skill_index_build`, and related retrieval guidance. When disabled, those tools and prompts are not registered, and the system returns to the original skill flow.++Use it when many installed skills need to be searched by task. If there are only a few skills, or if you want to use the original `list_skills` workflow, leave it disabled.++#### `symphony.skill_retrieval.build.root_categories`++`root_categories` defines the first layer, and optionally the second layer, of the skill tree before index construction starts.++When many skills are installed, letting the LLM freely invent root categories can make the tree unstable across builds. `root_categories` provides a stable directory skeleton: the LLM first distributes skills into these high-level categories, then dynamically splits each category further.++You can customize the default tree hierarchy for your application. It can be written as a YAML list. Each category should include:++- `id`: stable, short, and limited to lowercase letters, numbers, and hyphens.+- `name`: human-readable display name.+- `description`: what the category covers.+- `select_when`: when this category should be selected.+- `dont_select_when`: when this category should not be selected.+- `children`: optional preset second-level categories.++Good categories should:++- Cover common tasks.+- Be as mutually exclusive as practical.+- Use concise descriptions that are easy for the model to judge.++Set this manually in the user config file when customization is needed, then rebuild the index.++One-level example:++```yaml+symphony:+ skill_retrieval:+ build:+ root_categories:+ - id: office-docs+ name: Office documents+ description: Generate, edit, convert, extract, format, and structure office files.+ select_when: The user needs to process Word, PDF, PPT, Excel, Markdown, email, meeting notes, or office workflow deliverables.+ dont_select_when: The user is only writing general articles, managing notes, searching the web, developing web pages, generating media, or checking financial data.+ - id: system-tools+ name: System tools+ description: Device, file, cloud, agent/skill management, automation, safety, and connection configuration.+ select_when: The user asks to operate devices, manage files or cloud storage, configure channels, create skills/agents, switch personas, manage tasks, or run safety checks.+ dont_select_when: The user mainly wants a concrete business result such as writing a document, researching, making media, planning travel, or analyzing finance.+```++Two-level example:++```yaml+symphony:+ skill_retrieval:+ build:+ root_categories:+ - id: office-docs+ name: Office documents+ description: Read, convert, extract, edit, and generate office files.+ select_when: The task centers on PDF, Word, PPT, Excel, CSV, contracts, reports, or tables.+ dont_select_when: The user is mainly developing code, generating media, operating SaaS, or doing open web search.+ children:+ - id: pdf-and-ocr+ name: PDF and OCR+ description: PDF reading, splitting, merging, OCR, layout recognition, and document-to-text workflows.+ - id: spreadsheets-and-tables+ name: Spreadsheets and tables+ description: Excel, CSV, table extraction, formulas, field checks, and table cleanup.+ - id: presentations-and-reports+ name: Presentations and reports+ description: PPT, formal reports, charts in documents, and business-facing deliverables.+```++#### `symphony.skill_retrieval.build.branching_factor`++The split-threshold base for skill-tree construction. The current template default is `128`.++This does not require the LLM to generate a fixed number of branches. It is mainly used to derive the stopping threshold for splitting nodes: in the current implementation, a node usually stops splitting when its skill count is no more than about `branching_factor * 1.5`.++Lower values create a finer tree with more branches and slower builds, but fewer skills per leaf. Higher values create a coarser tree with faster builds, but more skills under each branch.++Use it to tune skill-tree granularity. With hundreds or thousands of skills, lower it if each branch still has too many candidate skills; raise it if builds are too slow or the tree is too fragmented.++#### Other Skill Retrieval settings++| Setting | Default | Description |+|---------|---------|-------------|+| `artifact_root` | Empty string | Index artifact directory; empty means the default workspace is used |+| `build.max_depth` | `6` | Maximum skill-tree depth |+| `build.max_workers` | `2` | Build concurrency; higher values can be faster but put more pressure on the model provider |+| `build.max_retries` | `2` | Retry count for failed LLM classification or grouping calls |+| `build.request_timeout_seconds` | `420` | Timeout for one LLM build request |+| `build.total_timeout_seconds` | `0` | Total build timeout; `0` means unlimited |+| `build.classification_batch_limit` | `32` | Maximum number of skills per classification call |+| `build.discovery_seed` | `42` | Random seed used during build sampling for better reproducibility |++#### Example configuration++```yaml+symphony:+ enabled: true+ paths:+ skills_root: ""+ score_dir: ""++ orchestration:+ mode: fast+ top_k: 3+ max_depth: 4+ min_edge_confidence: 0.3++ skill_retrieval:+ enabled: true+ artifact_root: ""+ build:+ branching_factor: 128+ max_depth: 6+ root_categories:+ - id: office-docs+ name: Office documents+ description: Generate, edit, convert, extract, format, and structure office files.+ select_when: The user needs to process Word, PDF, PPT, Excel, Markdown, email, meeting notes, or office workflow deliverables.+ dont_select_when: The user is only writing general articles, managing notes, searching the web, developing web pages, generating media, or checking financial data.+ - id: system-tools+ name: System tools+ description: Device, file, cloud, agent/skill management, automation, safety, and connection configuration.+ select_when: The user asks to operate devices, manage files or cloud storage, configure channels, create skills/agents, switch personas, manage tasks, or run safety checks.+ dont_select_when: The user mainly wants a concrete business result such as writing a document, researching, making media, planning travel, or analyzing finance.+ max_workers: 2+ max_retries: 2+ request_timeout_seconds: 420+ total_timeout_seconds: 0+ classification_batch_limit: 32+ discovery_seed: 42+ postprocess_enabled: true+ postprocess_max_passes: 1+ postprocess_min_skills: 6+ equivalence_enabled: false+ retrieve:+ compact_codes_enabled: false+ flatten_tree: false+ max_exposure_depth: 1+```++---++## 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 Skill Retrieval 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 skill index build take time?++The build reads all installed skills and calls the model to generate branches and classifications. More skills and deeper trees take longer. After the index is built, it is reused and does not need to be rebuilt for every conversation.++### Why does the skill score build take time?++The build reads installed skills and analyzes input/output and semantic handoff relationships between them. More skills and more possible connections take longer. After the score is built, you can read it directly instead of rebuilding it for every conversation.++### What is the difference between Skill Retrieval and the skill score?++Skill Retrieval finds candidate skills from a large installed-skill set. The skill score describes whether those skills can connect. The former is like browsing a directory; the latter is like inspecting a connection map.++### What is the relationship between Skill Retrieval and Skill Orchestration?++Both are part of Symphony. Skill Retrieval narrows the candidate skill set; Skill Orchestration builds an execution route from the task goal, candidate skills, and the skill score.++### Does it install new skills automatically?++No. Symphony only uses installed skills. Install new skills from the **Skills** page.++### Does it replace Team / Cluster Mode dispatch?++No. Symphony helps the Leader or agent find relevant skills and form a skill chain. Task decomposition, skill reading, tool execution, and team coordination still use JiuwenSwarm's existing runtime.++### Is building the skill score the same as composing an execution score?++This is an easy distinction to miss: building the skill score is not composing an execution score. Building the skill score usually happens before a task arrives and focuses on which skills in the whole installed skill set may have stable connectable relationships. Composing an execution score happens after a task arrives and focuses on this specific request: which skills should be selected from the score, in what order they should run, and where additional inputs are needed.++---++## Related docs++- [Skills](Skills.md)+- [Configuration](Configuration.md)+- [Agent Team](AgentTeam.md)+- [Chinese: Symphony](../zh/symphony-技能编排与分发.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"deleted file mode 100644index 388d2c82e7..0000000000--- "a/docs/zh/Agentic\346\212\200\350\203\275\346\243\200\347\264\242.md"+++ /dev/null@@ -1,225 +0,0 @@-# 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 3924df7005..e350941941 100644--- a/docs/zh/SUMMARY.md+++ b/docs/zh/SUMMARY.md@@ -31,7 +31,7 @@- [上下文压缩卸载](上下文压缩卸载.md)- [编码记忆](编码记忆.md)- [技能系统](技能.md)- - [Agentic 技能检索](Agentic技能检索.md)+ - [技能交响乐:技能检索、编排与分发](symphony-技能编排与分发.md)- [Skill 自演进](Skill自演进.md)- [智能体与工作区](智能体.md)- [浏览器工具](浏览器.md)diff --git "a/docs/zh/Symphony-\346\212\200\350\203\275\347\274\226\346\216\222\344\270\216\345\210\206\345\217\221.md" "b/docs/zh/Symphony-\346\212\200\350\203\275\347\274\226\346\216\222\344\270\216\345\210\206\345\217\221.md"new file mode 100644index 0000000000..b96ed9dc2c--- /dev/null+++ "b/docs/zh/Symphony-\346\212\200\350\203\275\347\274\226\346\216\222\344\270\216\345\210\206\345\217\221.md"@@ -0,0 +1,532 @@+# Symphony:技能检索、编排与分发+---++## 概念科普++### Symphony 是什么++Symphony(技能交响乐)是 JiuwenSwarm 面向海量已安装技能提供的技能编排与智能分发系统。它要解决的是两个问题:**怎么选**,以及**怎么用**。++- **技能检索**解决“怎么选”:把原本平铺的技能列表组织成可逐层浏览的技能树,让智能体按任务需求动态探索分支,找到候选技能。+- **技能编排**解决“怎么用”:基于候选技能、输入输出结构和技能依赖关系,生成一条可确认、可执行的技能链。++可以把 Symphony 理解为“双核心架构”:**检索用树,编排用图**。如果只需要调用一个明确的技能,按普通技能流程即可;Symphony 更适合“先找技能、再判断能否串起来、最后形成执行路线”的多步骤任务。在团队/集群模式中,这条路线也可以作为 Leader 分发后续任务的依据。++#### 用技能检索找到候选技能++技能检索是 JiuwenSwarm 面向**较大规模已安装技能**场景提供的技能目录检索能力。++当已安装技能数量较少时,智能体可以直接查看技能列表并选择合适技能;当技能数量达到几十、上百甚至更多时,直接把所有技能注入上下文会带来两个问题:++| 问题 | 影响 |+|------|------|+| 上下文占用过高 | 用户任务、文件内容和历史对话更容易被挤出上下文 |+| 注意力分散 | 模型容易被大量无关技能干扰,漏掉真正需要的技能 |++技能检索通过离线构建一棵**已安装技能树**,并在运行时提供目录浏览工具,让智能体像查目录一样逐层披露相关分支,再决定读取哪些 `SKILL.md`。++#### 用技能编排生成执行路线++如果说技能检索回答的是“选谁上场”,那么技能编排回答的就是“怎么让它们配合起来”。例如“先识别图片文字,再翻译,再写文案,最后发送邮件”这类任务,通常不是单个技能能完整完成的,需要把候选技能按输入输出依赖组织成一条稳定路线。++技能编排会围绕任务目标、已有输入和候选技能,参考技能总谱里的可衔接关系生成一条可执行路线。遇到缺失输入时,系统可以沿关系图反向查找能够补上该输入的上游技能;确认路线后,再继续执行具体技能。++技能编排的重点不是把技能简单排成列表,而是判断上游结果是否真的能喂给下游技能。可衔接关系、输入输出结构、任务语义都会影响最终编排。这样生成的不是“看起来相关”的技能组合,而是能够解释依赖关系、可确认、可执行的技能链。++技能总谱是编排使用的关系图。图中的每个节点代表一个技能,边代表一个技能的输出可以作为另一个技能的输入,也就是可衔接(`can_feed`)关系。它既可以帮助用户理解技能之间如何组合,也会为技能编排提供可参考的候选关系。++++技能总谱展示的是“可衔接候选关系”,不是已经执行过的任务记录,也不保证所有场景都一定能直接串联。实际使用时仍需结合技能详情、输入参数和任务目标确认。++#### 它解决什么问题++- **技能太多时怎么选**:避免把所有技能说明一次性塞进上下文,让智能体按任务需要逐步找到候选技能。+- **技能选对后怎么用**:不只判断技能是否相关,还判断上游输出能否真正接到下游输入。+- **多技能流程怎么稳定串起来**:基于技能总谱里的可衔接关系生成可确认、可执行的技能链,减少临场拼接导致的中断。+- **复杂任务怎么解释和分发**:让用户或 Leader 能看清每个技能为什么被选中、结果如何传递,以及后续任务如何分发执行。++### 基本工作流++```text+安装技能+ ↓+构建本地技能树索引+ ↓+构建或读取技能总谱+ ↓+用户发起任务+ ↓+智能体根据任务选择技能树分支+ ↓+skill_branch_explore 展开相关分支+ ↓+必要时 skill_branch_peek 查看分支摘要+ ↓+发现候选技能+ ↓+技能编排基于任务目标、候选技能和技能总谱生成技能链+ ↓+用户确认+ ↓+继续执行具体技能+```++技能检索主要负责“找技能”;技能编排负责把候选技能组织成一条面向任务的执行路线;技能总谱负责展示和沉淀“技能之间能否衔接”,为编排提供关系图依据。技能检索和技能编排构成 Symphony(技能交响乐)的两类核心能力。++### 运行时工具++启用技能检索后,智能体会获得技能目录查阅工具;启用技能交响乐后,智能体会获得技能编排工具。通常不需要用户手动调用这些工具,系统会根据任务自动选择。++#### 技能检索工具++| 工具 | 作用 | 使用时机 |+|------|------|----------|+| `skill_branch_explore` | 展开技能树分支,披露下一级分支或候选技能 | 主要检索工具,优先用于查看相关分支 |+| `skill_branch_peek` | 查看分支的轻量摘要和覆盖信息,不展开完整技能树 | 不确定某个分支是否值得展开时使用 |+| `skill_index_build` | 构建或刷新本地已安装技能树索引 | 仅当检索工具明确提示索引缺失或过期时调用 |++当 `skill_branch_explore` 返回 `skills` 小节时,其中的条目是已安装技能,不是分支 ID。智能体会根据技能名称、描述和返回的 `worker_id` 缩小候选范围;如果后续需要编排,可以把候选技能的 `worker_id` 传给 `symphony_compose_score` 的 `candidate_skill_ids`。++#### 技能编排工具++| 工具 | 作用 | 使用时机 |+|------|------|----------|+| `symphony_read_score` | 查看技能总谱是否存在、是否过期 | 编排前需要确认总谱状态时使用 |+| `symphony_refresh_score` | 抽取已安装技能特征并刷新技能总谱 | 总谱缺失、过期,或安装新技能后需要更新关系图时使用 |+| `symphony_compose_score` | 技能编排入口,基于任务目标、候选技能和技能总谱生成执行图 | 用户要求使用技能,或任务需要技能链、技能排序、专门工具链时使用 |++`symphony_compose_score` 的核心参数是 `query`,即原始用户任务;当前编排模式为 `fast`。如果已经通过技能检索缩小了候选范围,可以把 `skill_branch_explore` 返回的 `worker_id` 列表传入 `candidate_skill_ids`,让 Symphony 在这些候选技能及其可衔接邻居中生成技能链。若编排结果提示缺少合适技能,需要先通过 **技能** 页面搜索并安装新技能,再调用 `symphony_refresh_score` 刷新总谱,最后用原始任务重新编排。++---++## 操作指导++### 1. 准备已安装技能++Symphony 只会使用已安装技能。请先在左侧导航栏 **技能** 页面安装需要的技能。++技能安装方式见 [技能系统](技能.md)。++### 2. 开启技能检索++操作路径:++```text+左侧导航栏 → 配置信息 → 技能检索+```++打开 **启用技能检索** 后保存配置。++关闭该开关后,JiuwenSwarm 不会注册技能检索工具,也不会注入技能树提示,系统会回到原有技能使用流程。++### 3. 构建技能索引++操作路径:++```text+左侧导航栏 → 技能 → 技能索引 → 构建索引+```++构建过程会扫描已安装技能,读取技能名称、描述和 `SKILL.md`,并生成本地技能树索引。构建完成后会复用同一套索引,不需要每次启动都重新构建。++当以下情况发生时,建议重新构建:++- 安装、卸载或大量修改了技能。+- 页面提示索引缺失、过期或构建失败。+- 调整了树根分层配置、最大树深等构建参数。++### 4. 构建技能总谱++操作路径:++```text+左侧导航栏 → 技能 → 技能总谱+```++#### 如何解读技能总谱++| 元素 | 说明 |+|------|------|+| **节点** | 一个已安装技能,节点名称通常对应技能名称或技能 ID |+| **边** | 两个技能之间的可衔接关系,表示上游技能的输出可以供下游技能使用 |+| **方向** | `A → B` 表示技能 A 的输出可以接到技能 B 的输入 |+| **置信度** | 系统判断该边可衔接的可信程度;置信度越高,越适合作为编排候选 |+| **入度** | 当前筛选条件下,有多少上游技能可以接入该技能 |+| **出度** | 当前筛选条件下,该技能可以接到多少下游技能 |++#### 页面区域说明++| 区域 | 用途 |+|------|------|+| **左侧面板** | 展示当前可见的技能数、边数;支持搜索技能、调整最小置信度、查看技能列表 |+| **中间画布** | 展示技能关系图;可拖拽平移、滚轮缩放,点击节点查看详情 |+| **右侧详情** | 展示选中技能的 ID、入度、出度、描述、输入、输出、任务信息以及相关边 |++右侧的 **相关边** 中:++- `→` 表示当前技能可以向目标技能提供输出。+- `←` 表示当前技能可以接收上游技能的输出。+- `可衔接 · 85%` 这类信息表示边的类型与置信度。++#### 常用操作++| 操作 | 说明 |+|------|------|+| **搜索技能** | 在左侧搜索框输入关键词,只显示匹配技能及其相关关系 |+| **调整最小置信度** | 过滤低置信度的边,便于聚焦更可靠的技能衔接关系 |+| **读谱** | 重新读取当前已经构建好的技能总谱 |+| **增量构建** | 在新增、删除或修改技能后,优先使用增量构建更新总谱 |+| **暂停构建** | 总谱构建耗时较长时可暂停,已完成的缓存和 checkpoint 会保留 |+| **全量重新构建** | 当总谱异常、关系明显过旧或需要彻底重算时使用 |+| **适配视图** | 将当前可见图谱重新居中并缩放到合适大小 |++#### 最小置信度说明++“最小置信度”滑块只会对已经加载的图谱做本地过滤。它可以隐藏低于当前阈值的边,但不会重新计算技能关系,也不会显示低于构图验收阈值的边。如果希望重新生成候选关系,需要执行增量构建或全量重新构建。++### 5. 使用技能检索++通常不需要用户手动调用工具。正常输入任务即可,例如:++```text+请优先利用当前已安装技能完成该任务;如果发现相关技能,请结合技能内容给出结果。++我有一份 PDF 合同和一份 Excel 表格,请提取关键条款,核对金额字段,并生成一份中文审阅报告。+```++启用技能检索后,模型会先浏览技能树,找到可能相关的 PDF、Excel、文档审阅、报告生成等技能,再决定读取哪些 `SKILL.md`。++### 6. 查看检索过程++在聊天消息中展开技能检索树,可以看到:++- 模型探索了哪些第一层分类。+- 哪些分支被 `peek` 查看过。+- 哪些分支被 `explore` 展开。+- 最终出现了哪些候选技能。++如果某个技能被认为相关,模型后续可能会读取该技能的 `SKILL.md`,再按技能说明执行任务。++### 7. 使用技能编排++#### 使用前准备++1. 打开左侧导航栏 → **配置信息** → **其他配置**。+2. 展开 **技能交响乐** 配置项,开启 **启用技能交响乐**,然后点击右上角 **保存**。+3. 确认任务需要的技能已经安装;如果刚新增、删除或修改过技能,建议先到 **技能** → **技能总谱** 中执行一次 **增量构建**。如果只是确认当前总谱状态,可以先 **读谱**。++这里的 **技能交响乐** 开关用于开启 Symphony 的编排能力;技能检索仍由前面的 **技能检索** 开关单独控制。++++#### 推荐的提问方式++在对话里直接说明要使用技能,并把任务目标、输入材料、期望输出和后续动作一次说清楚。++**推荐模板:**++```text+使用 Skill,帮我完成 <最终目标>。+输入是 <文件、链接、文本或账号信息>。+需要输出 <结果格式或交付物>,然后 <是否继续执行下一步动作>。+```++**示例:**++```text+使用 Skill,将一张英文技术博客图片翻译成中文,+并写一段公众号介绍文案后发送到我的邮箱。+图片位置:<本地位置或图片连接>+```++更容易触发技能编排的写法:++- 明确写出“使用 Skill”或“使用技能”。+- 描述完整目标,而不是只写单个步骤。+- 如果希望系统继续执行,明确说“按照编排结果执行”或“确认后继续执行”。++#### 看懂编排结果++开启后,系统会先返回一张技能编排图和简短说明。图中的每个方块是一个技能,箭头表示执行顺序和结果传递关系。下面示例中,系统先规划出 `image-translate → yescan-ocr-universal → general-writing → imap-smtp-email` 的路线,再说明每个技能分别负责翻译图片、提取文字、撰写文案和发送邮件。++++看到编排结果后,可以继续这样回复:++- **路线正确**:回复“按照编排结果执行”。+- **缺少信息**:补充系统提示中缺少的文件、链接、邮箱、账号或参数。+- **只想看方案**:不确认执行即可,编排结果本身可以作为技能组合建议。++> **提示**:技能编排只会基于当前已安装技能和可用配置进行规划。如果结果提示没有合适技能,需要先安装对应技能,再刷新或重建技能总谱后重试。++---++## 配置说明++当前 Web 配置页主要提供两个相关开关:**启用技能检索** 控制技能树检索工具,**启用技能交响乐** 控制技能总谱与编排工具。技能索引页提供索引构建、重新构建、取消构建、查看构建状态和查看索引树等操作;技能总谱页提供读谱、增量构建、暂停构建和全量重新构建等操作。++构建、检索和编排的高级参数需要在用户运行时配置文件进行配置:++```text+~/.jiuwenswarm/config/config.yaml+```++### 配置项说明++#### `symphony.enabled`++是否启用技能交响乐的编排能力。默认模板值是 `false`。++开启后,新会话会注册 `symphony_read_score`、`symphony_refresh_score`、`symphony_compose_score` 等编排工具。智能体可以读取或刷新技能总谱,并在已有候选技能基础上生成技能链。关闭后不注册这些工具,智能体不会使用技能总谱进行编排。++该开关控制的是 Symphony 的编排工具;技能检索仍由 `symphony.skill_retrieval.enabled` 单独控制。也就是说,检索负责找到候选技能,编排负责基于任务目标、候选技能和技能总谱生成执行路线。++#### `symphony.paths.skills_root` / `symphony.paths.score_dir`++技能来源目录和技能总谱产物目录。默认模板值都是空字符串,表示使用运行时默认目录。++`symphony_refresh_score` 会从 `skills_root` 读取技能并刷新技能总谱;`symphony_read_score` 和 `symphony_compose_score` 会读取 `score_dir` 下的总谱产物。需要把总谱缓存到固定位置、或者在不同运行环境之间复用总谱时,可以显式配置这些目录。++#### `symphony.orchestration`++技能编排的运行参数。当前模板配置如下:++| 配置项 | 默认值 | 说明 |+|--------|--------|------|+| `mode` | `fast` | 编排模式。当前运行时工具使用快速编排路径,优先给出可执行的技能链 |+| `top_k` | `3` | 每轮编排保留的候选路线数量上限,值越大越容易覆盖备选路线,但输出也会更分散 |+| `max_depth` | `4` | 技能链最大搜索深度,用于限制一次任务中串联技能的长度 |+| `min_edge_confidence` | `0.3` | 技能总谱边的最低置信度阈值,低于该值的连接关系不会优先用于编排 |++这些参数适用于调节“如何把候选技能连成路线”。如果结果过短、经常漏掉中间处理步骤,可以适当增加 `max_depth`;如果路线过多或不稳定,可以降低 `top_k` 或提高 `min_edge_confidence`。++#### `symphony.skill_retrieval.enabled`++是否启用技能检索。默认模板值是 `false`。该配置可在 web 页面配置。++开启后,新会话会获得 `skill_branch_explore`、`skill_branch_peek`、`skill_index_build` 等技能检索工具,并在系统提示中看到技能树检索方法。关闭后不注册这些工具,不注入技能树提示,严格回到原有技能流程。++适用于需要在大量已安装技能中,根据任务查找相关技能的场景。如果技能数量很少,或者希望完全使用原来的 `list_skills` 流程,可以关闭。++#### `symphony.skill_retrieval.build.root_categories`++树默认分层配置 `root_categories` 的作用,是在构建技能索引时,预先指定技能树的第一层、可选第二层分类边界。++当本地安装了大量 skills 时,如果完全让 LLM 自由生成根分类,分类结果可能不稳定,甚至不同构建之间根节点差异较大。`root_categories` 相当于给构建过程一个稳定的“目录骨架”,让 LLM 先把所有技能分发到这些大类下,再在每个大类内部继续动态拆分。++您可以自己设置技能树构建时的默认分层结构,以最大程度适配您的应用场景。它可以写成 YAML 列表。每个分类建议包含:++- `id`:稳定、短小、只使用英文小写、数字和短横线。+- `name`:面向人类展示的分类名。+- `description`:分类覆盖范围。+- `select_when`:什么时候应该选这个分类。+- `dont_select_when`:什么时候不应该选这个分类。+- `children`:可选。用于预设下一层分类。++建议分类满足:++- 覆盖常见任务。+- 兄弟分类尽量互斥。+- 描述简洁,便于模型判断。++需要自定义时,请在用户配置文件中手动设置,并重新构建索引。++一层分类示例:++```yaml+symphony:+ skill_retrieval:+ build:+ root_categories:+ - id: office-docs+ name: 办公文档+ description: 办公文件的生成、编辑、转换、提取、排版和结构化处理。+ select_when: 用户要处理 Word、PDF、PPT、Excel、Markdown、邮件、会议纪要或办公流程产物。+ dont_select_when: 用户只是写普通文章/营销文案、管理个人知识库/笔记/任务、联网查资料、开发网页、生成图片视频或查询金融行情。+ - id: system-tools+ name: 系统工具+ description: 手机设备、文件云盘、智能体/技能管理、任务自动化、安全合规和连接配置。+ select_when: 用户请求操作设备系统、管理文件云盘、配置渠道、创建技能/智能体、切换人格、管理任务或做安全校验。+ dont_select_when: 用户主要要完成一个具体业务任务,如写文档、查资料、做图、出行或金融分析。+```++两层分类示例:++```yaml+symphony:+ skill_retrieval:+ build:+ root_categories:+ - id: office-docs+ name: 办公文档+ description: 处理办公文件的读取、转换、抽取、编辑和生成。+ select_when: 用户任务围绕 PDF、Word、PPT、Excel、CSV、合同、报告或表格文件。+ dont_select_when: 用户主要是在开发代码、生成媒体、远程操作 SaaS 或做开放式网页搜索。+ children:+ - id: pdf-and-ocr+ name: PDF 与 OCR+ description: PDF 读取、拆分、合并、OCR、版面识别和文档转文本。+ - id: spreadsheets-and-tables+ name: 表格与数据表+ description: Excel、CSV、表格抽取、公式、字段核对和表格清洗。+ - id: presentations-and-reports+ name: 演示与报告+ description: PPT、正式报告、图表入文档和面向业务的交付物生成。+```++#### `symphony.skill_retrieval.build.branching_factor`++构建技能树时的拆分阈值基数。当前模板默认值是 `128`。++这个参数不是要求 LLM 每次生成固定数量的分支。它主要用于派生节点停止拆分阈值:当前实现中,一个节点的技能数不超过约 `branching_factor * 1.5` 时,通常会停止继续拆分。++值越小,树会更细,分支更多,构建更慢,但单个叶子节点包含的技能更少;值越大,树会更粗,构建更快,但单个分支下可能出现更多技能。++适用于调节技能树粒度。几百到几千个技能时,如果分支下候选技能过多,可以适当调小;如果构建太慢或树过碎,可以适当调大。++#### 其它技能检索配置项++| 配置项 | 默认值 | 说明 |+|--------|--------|------|+| `artifact_root` | 空字符串 | 索引产物目录;为空时使用默认工作区 |+| `build.max_depth` | `6` | 技能树最大深度,达到后停止继续拆分 |+| `build.max_workers` | `2` | 构建并发数;越大越快,但模型并发压力更高 |+| `build.max_retries` | `2` | LLM 分类或分组失败后的重试次数 |+| `build.request_timeout_seconds` | `420` | 单次 LLM 构建请求超时时间 |+| `build.total_timeout_seconds` | `0` | 整体构建总超时;`0` 表示不限制 |+| `build.classification_batch_limit` | `32` | 单次分类调用最多放入多少个技能 |+| `build.discovery_seed` | `42` | 构建采样随机种子,用于提高可复现性 |+++#### 附:完整配置项示例++```yaml+symphony:+ enabled: true+ paths:+ skills_root: ""+ score_dir: ""++ orchestration:+ mode: fast+ top_k: 3+ max_depth: 4+ min_edge_confidence: 0.3++ skill_retrieval:+ enabled: true+ artifact_root: ""+ build:+ branching_factor: 128+ max_depth: 6+ root_categories:+ - id: office-docs+ name: 办公文档+ description: 办公文件的生成、编辑、转换、提取、排版和结构化处理。+ select_when: 用户要处理 Word、PDF、PPT、Excel、Markdown、邮件、会议纪要或办公流程产物。+ dont_select_when: 用户只是写普通文章/营销文案、管理个人知识库/笔记/任务、联网查资料、开发网页、生成图片视频或查询金融行情。+ - id: writing-content+ name: 写作内容+ description: 文章、故事、新闻、营销文案、内容策划、文本润色和写作风格处理。+ select_when: 用户要写、改写、润色、策划或生成面向读者的文字内容,而不是操作具体办公文件。+ dont_select_when: 用户明确要输出 Word/PDF/PPT/Excel 文件、生成图片视频、联网调研、管理知识库或构建智能体/skill。+ - id: search-research+ name: 搜索研究+ description: 网页搜索、内容抓取、新闻、论文、深度调研和知识库检索。+ select_when: 用户要查找已有信息、联网搜索、读取网页、研究主题、检索论文、查询新闻或使用知识库/笔记/记忆。+ dont_select_when: 用户已经给定资料且只要求生成具体文件、图片、视频、表格或创作文案。+ - id: media-creative+ name: 图片音视频+ description: 图片理解、图像生成、视觉设计、视频动画、语音音乐、漫画和绘本视觉产物。+ select_when: 用户输入或输出涉及图片、截图、照片、OCR、音频、语音、音乐、视频、动画、漫画或视觉设计。+ dont_select_when: 用户主要是在写文本、做办公文件、网页开发、旅行查询或金融分析。+ - id: life-services+ name: 生活服务+ description: 出行旅行、地图天气、健康教育、本地优惠、餐饮和日常生活服务。+ select_when: 用户请求与真实生活行动、位置、旅行、天气、健康、学习、优惠券、餐饮或本地服务有关。+ dont_select_when: 请求主要是内容创作、办公文件、网页开发、系统配置或金融投资。+ - id: product-dev+ name: 开发产品+ description: 网页应用、产品需求、UX/UI、部署数据库、代码测试和工程质量。+ select_when: 用户要设计产品、写 PRD、做网页/应用、部署网站、接数据库、优化前端或测试代码。+ dont_select_when: 用户只是写营销文案、生成办公文件、做图片视频、查询资料或配置智能体。+ - id: finance-business+ name: 金融商业+ description: 股票行情、投资分析、金融新闻、量化交易、模拟交易和企业信息查询。+ select_when: 用户询问股票、基金、指数、黄金、行情、投资、金融新闻、企业工商或商业数据。+ dont_select_when: 用户只是做普通市场调研、表格分析、营销文案或产品竞品分析。+ - id: system-tools+ name: 系统工具+ description: 手机设备、文件云盘、智能体/技能管理、任务自动化、安全合规和连接配置。+ select_when: 用户请求操作设备系统、管理文件云盘、配置渠道、创建技能/智能体、切换人格、管理任务或做安全校验。+ dont_select_when: 用户主要要完成一个具体业务任务,如写文档、查资料、做图、出行或金融分析。+ max_workers: 2+ max_retries: 2+ request_timeout_seconds: 420+ total_timeout_seconds: 0+ classification_batch_limit: 32+ discovery_seed: 42+```++---++## 常见问题++### 为什么开启后模型没有调用技能检索工具?++可能原因:++- 当前任务已经明确指定了技能。+- 当前任务不需要已安装技能。+- 索引未构建,且模型尚未触发检索工具。+- 技能检索开关未开启。++可以在任务中明确说明“请优先利用当前已安装技能完成该任务”。++### 为什么工具提示索引未构建?++请进入:++```text+技能 → 技能索引 → 构建索引+```++或让模型在工具提示要求下调用 `skill_index_build`。构建完成后再次发起任务。++### 为什么构建时间较长?++构建会读取所有已安装技能,并调用模型生成分支和分类。技能越多、树越深,耗时越长。构建完成后索引会复用,不需要每轮对话重建。++### 为什么技能总谱构建时间较长?++总谱构建需要读取已安装技能,并分析技能之间的输入输出和语义衔接关系。技能越多、关系越复杂,耗时越长。构建完成后可以直接读谱,不需要每轮对话都重建。++### 技能检索和技能总谱有什么区别?++技能检索负责从大量已安装技能中找到候选技能;技能总谱负责描述候选技能之间是否能够衔接。前者像查目录,后者像看技能之间的连接图。++### 技能检索和技能编排是什么关系?++技能检索和技能编排都是 Symphony 的组成部分。技能检索负责缩小候选技能范围;技能编排负责根据任务目标、候选技能和技能总谱生成执行路线。++### 它会自动安装新技能吗?++不会。Symphony 只使用已安装技能。安装新技能仍需通过 **技能** 页面完成。++### 它会替代集群模式的 Leader 派发吗?++不会。Symphony 可以帮助 Leader 或普通智能体找到相关技能并形成技能链。具体如何拆解任务、读取技能、执行工具、组织团队,仍由 JiuwenSwarm 原有运行模式完成。++### 构建总谱和谱写执行乐谱是一回事吗?++这里有一个容易混淆的点:构建总谱不是谱写执行乐谱。构建总谱通常发生在任务到来之前,关注的是整个技能库里,哪些技能之间可能存在稳定的可衔接关系。谱写执行乐谱发生在任务到来之后,关注的是面对这次具体需求,应该从总谱中选出哪些技能、按什么顺序执行,以及哪里需要补充输入材料。++---++## 相关文档++- [技能系统](技能.md)+- [配置说明](配置信息.md)+- [Agent Team 使用指南](AgentTeam.md)+- [English: Symphony](../en/symphony.md)diff --git "a/docs/zh/\346\212\200\350\203\275.md" "b/docs/zh/\346\212\200\350\203\275.md"index 114172f238..f47d28d385 100644--- "a/docs/zh/\346\212\200\350\203\275.md"+++ "b/docs/zh/\346\212\200\350\203\275.md"@@ -181,8 +181,8 @@ ClawHub 访问地址:https://clawhub.ai/skills|--------|------|| **我的技能** | 浏览、检索已安装技能,支持按"全部 / 启用 / 禁用"筛选,可启停技能、进入详情 || **技能广场** | 安装新技能,含 **预置**(内置技能)、**SwarmSkills在线搜索**、**Skills在线搜索**(SkillNet / ClawHub)三个子页 |-| **技能总谱** | 可视化展示已安装技能之间的能力关系图谱 |-| **技能索引** | 构建本地技能检索索引,可按任务需求检索匹配的技能 |+| **技能总谱** | 可视化展示已安装技能之间的能力关系图谱,详见 [Symphony](symphony-技能编排与分发.md) |+| **技能索引** | 构建本地技能检索索引,可按任务需求检索匹配的技能,详见 [Symphony](symphony-技能编排与分发.md) |@@ -213,53 +213,9 @@ ClawHub 访问地址:https://clawhub.ai/skills> **用途说明**:技能经验反映自演进与真实使用中的改进沉淀,便于判断技能是否持续可用,也为技能维护者提供依据。-#### 技能总谱+#### 技能总谱与技能索引-技能总谱用于查看已安装技能之间的可衔接关系。图中的每个节点代表一个技能,边代表一个技能的输出可以作为另一个技能的输入,即 `can_feed` 关系。它既可以帮助用户理解技能之间如何组合,也会为 Symphony 编排提供可参考的候选关系。----#### 如何解读技能总谱--| 元素 | 说明 |-|------|------|-| **节点** | 一个已安装技能,节点名称通常对应技能名称或技能 ID |-| **边** | 两个技能之间的 `can_feed` 关系,表示上游技能的输出可以供下游技能使用 |-| **方向** | `A → B` 表示技能 A 的输出可以接到技能 B 的输入 |-| **置信度** | 系统判断该边可衔接的可信程度;置信度越高,越适合作为编排候选 |-| **入度** | 当前筛选条件下,有多少上游技能可以接入该技能 |-| **出度** | 当前筛选条件下,该技能可以接到多少下游技能 |--> **提示**:技能总谱展示的是“可衔接候选关系”,不是已经执行过的任务记录,也不保证所有场景都一定能直接串联。实际使用时仍需结合技能详情、输入参数和任务目标确认。--#### 页面区域说明--| 区域 | 用途 |-|------|------|-| **左侧面板** | 展示当前可见的技能数、边数;支持搜索技能、调整最小置信度、查看技能列表 |-| **中间画布** | 展示技能关系图;可拖拽平移、滚轮缩放,点击节点查看详情 |-| **右侧详情** | 展示选中技能的 ID、入度、出度、描述、输入、输出、任务信息以及相关边 |--右侧的 **相关边** 中:-- `→` 表示当前技能可以向目标技能提供输出-- `←` 表示当前技能可以接收上游技能的输出-- `can_feed · 85%` 这类信息表示边的类型与置信度--#### 常用操作--| 操作 | 说明 |-|------|------|-| **搜索技能** | 在左侧搜索框输入关键词,只显示匹配技能及其相关关系 |-| **调整最小置信度** | 过滤低置信度的边,便于聚焦更可靠的技能衔接关系 |-| **读谱** | 重新读取当前已经构建好的技能总谱 |-| **增量构建** | 在新增、删除或修改技能后,优先使用增量构建更新总谱 |-| **暂停构建** | 总谱构建耗时较长时可暂停,已完成的缓存和 checkpoint 会保留 |-| **全量重新构建** | 当总谱异常、关系明显过旧或需要彻底重算时使用 |-| **适配视图** | 将当前可见图谱重新居中并缩放到合适大小 |--#### 最小置信度说明--“最小置信度”滑块只会对已经加载的图谱做本地过滤。它可以隐藏低于当前阈值的边,但不会重新计算技能关系,也不会显示低于构图验收阈值的边。如果希望重新生成候选关系,需要执行增量构建或全量重新构建。+技能页中的 **技能总谱** 和 **技能索引** 属于 Symphony 能力:技能索引用来在大量已安装技能中逐步找到候选技能,技能总谱用 `can_feed` 关系展示技能之间是否能够衔接。多技能任务的编排、读谱、构建和对话使用方式,详见 [Symphony:技能检索、编排与分发](symphony-技能编排与分发.md)。---@@ -432,57 +388,9 @@ C:\Users\<用户名>\.jiuwenswarm\service_default\agent_default\jiuwenswarm_work请展示 gitcode-pr 技能的详情和 SKILL.md 内容```-### 如何在对话中使用技能交响乐--技能交响乐适合处理需要多个技能配合的任务,例如“先识别图片文字,再翻译,再写文案,最后发送邮件”。它会先根据已安装技能和技能总谱生成一条可执行路线,用户确认后再继续执行具体技能。--#### 使用前准备--1. 打开左侧导航栏 → **配置信息** → **其他配置**。-2. 展开 **技能交响乐** 配置项,开启 **启用技能交响乐**,然后点击右上角 **保存**。-3. 确认任务需要的技能已经安装;如果刚新增、删除或修改过技能,建议先到 **技能** → **技能总谱** 中执行一次 **增量构建** 或 **读谱**。----#### 推荐的提问方式--在对话里直接说明要使用技能,并把任务目标、输入材料、期望输出和后续动作一次说清楚。--**推荐模板:**--```text-使用 Skill,帮我完成 <最终目标>。-输入是 <文件、链接、文本或账号信息>。-需要输出 <结果格式或交付物>,然后 <是否继续执行下一步动作>。-```--**示例:**--```text-使用 Skill,将一张英文技术博客图片翻译成中文,-并写一段公众号介绍文案后发送到我的邮箱。-图片位置:https://gitcode.com/lin-xiaoyu/data/blob/main/blog.webp-```--更容易触发技能交响乐的写法:-- 明确写出“使用 Skill”或“使用技能”-- 描述完整目标,而不是只写单个步骤-- 提供必要输入,例如图片地址、文件路径、收件人、目标语言、输出格式-- 如果希望系统继续执行,明确说“按照编排结果执行”或“确认后继续执行”--#### 看懂编排结果--开启后,系统会先返回一张技能编排图和简短说明。图中的每个方块是一个技能,箭头表示执行顺序和结果传递关系。下面示例中,系统先规划出 `image-translate → yescan-ocr-universal → general-writing → imap-smtp-email` 的路线,再说明每个技能分别负责翻译图片、提取文字、撰写文案和发送邮件。----看到编排结果后,可以继续这样回复:-- **路线正确**:回复“按照编排结果执行”-- **缺少信息**:补充系统提示中缺少的文件、链接、邮箱、账号或参数-- **路线不合适**:说明要替换的目标,例如“不要发邮件,只生成文案”或“优先使用 OCR 后再翻译”-- **只想看方案**:不确认执行即可,编排结果本身可以作为技能组合建议+### 多技能任务:Symphony 技能编排-> **提示**:技能交响乐只会基于当前已安装技能和可用配置进行编排。如果结果提示没有合适技能,需要先安装对应技能,再刷新或重建技能总谱后重试。+如果任务需要多个技能配合,例如“先识别图片文字,再翻译,再写文案,最后发送邮件”,可以使用 Symphony 的技能编排生成技能链,再确认是否继续执行。完整准备步骤、推荐提问方式和编排结果解读,详见 [Symphony:技能检索、编排与分发](symphony-技能编排与分发.md)。---diff --git "a/docs/zh/\351\205\215\347\275\256\344\277\241\346\201\257.md" "b/docs/zh/\351\205\215\347\275\256\344\277\241\346\201\257.md"index 946a46b8ed..ee07a1ac8c 100644--- "a/docs/zh/\351\205\215\347\275\256\344\277\241\346\201\257.md"+++ "b/docs/zh/\351\205\215\347\275\256\344\277\241\346\201\257.md"@@ -21,8 +21,9 @@ JiuwenSwarm 的配置信息是您与智能体交互的基础设置。通过合- **上下文压缩**:对话历史管理策略(详见 [六、上下文压缩](#六上下文压缩))- **工具安全护栏**:工具调用权限检查(详见 [七、工具安全护栏](#七工具安全护栏))- **敏感信息过滤**:记忆系统隐私保护设置(详见 [八、记忆系统敏感信息过滤](#八记忆系统敏感信息过滤))+- **技能交响乐与技能检索**:控制技能检索和技能编排(详见 [九、技能交响乐与技能检索配置](#九技能交响乐与技能检索配置))-此外,面板中还包含 **免费搜索引擎配置**、**多Agent/Team 配置**、**A2UI**、**Agentic 技能检索**、**记忆系统敏感信息过滤**、**邮箱配置** 等区域,按需配置即可。+此外,面板中还包含 **免费搜索引擎配置**、**多Agent/Team 配置**、**A2UI**、**邮箱配置** 等区域,按需配置即可。> 💡 **提示**:模型配置(`api_base`、`api_key`、`model`、`model_provider`)为必填项,其他配置均为可选。@@ -331,11 +332,88 @@ permissions:----## 九、高级配置+## 九、技能交响乐与技能检索配置++技能交响乐(Symphony)相关配置用于控制两类能力:**技能检索**负责从已安装技能中找到候选技能,**技能编排**负责基于技能总谱把候选技能组织成可确认、可执行的技能链。++### 9.1 前端开关++配置面板中主要有两个相关开关:++| 开关 | 对应配置 | 默认值 | 作用 |+| --- | --- | --- | --- |+| **启用技能检索** | `symphony.skill_retrieval.enabled` | `false` | 注册 `skill_branch_explore`、`skill_branch_peek`、`skill_index_build` 等技能树检索工具 |+| **启用技能交响乐** | `symphony.enabled` | `false` | 注册 `symphony_read_score`、`symphony_refresh_score`、`symphony_compose_score` 等技能总谱与编排工具 |++两个开关相互独立:技能检索解决“怎么找到候选技能”,技能交响乐解决“怎么把候选技能编排成路线”。如果只开启技能检索,系统只会获得技能树检索能力;如果只开启技能交响乐,系统可以读取和刷新技能总谱,但候选技能范围不会自动来自技能树检索。++### 9.2 技能索引与技能总谱++相关页面位于左侧导航栏 **技能** 下:++| 页面 | 作用 |+| --- | --- |+| **技能索引** | 构建本地已安装技能树索引,用于运行时按目录逐层检索候选技能 |+| **技能总谱** | 构建和查看技能之间的可衔接关系,用于技能编排 |++安装、卸载或大量修改技能后,建议先重新构建技能索引;如果技能变化会影响技能之间的衔接关系,还需要在技能总谱页执行增量构建或全量重新构建。++### 9.3 主配置中的 Symphony 参数++更细的构建、检索和编排参数在用户运行时配置文件中配置:++```text+~/.jiuwenswarm/config/config.yaml+```++常用配置项如下:++| 配置项 | 默认值 | 说明 |+| --- | --- | --- |+| `symphony.paths.skills_root` | 空字符串 | 技能来源目录;为空时使用运行时默认目录 |+| `symphony.paths.score_dir` | 空字符串 | 技能总谱产物目录;为空时使用运行时默认目录 |+| `symphony.fingerprint.scan.max_depth` | 空 | 技能文件扫描最大深度;为空时使用运行时默认值 |+| `symphony.fingerprint.extraction.workers` | `4` | 技能指纹抽取并发数 |+| `symphony.fingerprint.extraction.batch_size` | `2` | 技能指纹抽取批大小 |+| `symphony.fingerprint.extraction.body_limit` | 空 | 单个技能正文参与抽取的长度限制;为空时使用运行时默认值 |+| `symphony.fingerprint.normalization.workers` | `4` | 技能指纹归一化并发数 |+| `symphony.fingerprint.normalization.batch_size` | `2` | 技能指纹归一化批大小 |+| `symphony.fingerprint.normalization.duplicate_name_similarity_threshold` | `0.8` | 判断技能名称近似重复的相似度阈值 |+| `symphony.fingerprint.normalization.max_vocab_size` | 空 | 动态词表最大规模;为空时使用运行时默认值 |+| `symphony.build.workers` | `4` | 技能总谱构建并发数 |+| `symphony.build.batch_size` | `16` | 技能总谱构建批大小 |+| `symphony.build.require_consensus` | `false` | 是否要求多个判断达成一致后再接受关系 |+| `symphony.build.min_edge_confidence` | `0.1` | 写入技能总谱的最低边置信度 |+| `symphony.orchestration.mode` | `fast` | 编排模式,当前运行时使用快速编排路径 |+| `symphony.orchestration.top_k` | `3` | 编排时保留的候选路线数量上限 |+| `symphony.orchestration.max_depth` | `4` | 技能链最大搜索深度 |+| `symphony.orchestration.min_edge_confidence` | `0.3` | 编排优先使用的技能总谱边最低置信度 |+| `symphony.skill_retrieval.artifact_root` | 空字符串 | 技能索引产物目录;为空时使用默认工作区,可由 `SYMPHONY_SKILL_RETRIEVAL_ROOT` 提供 |+| `symphony.skill_retrieval.build.branching_factor` | `128` | 技能树拆分阈值基数,影响树的粗细 |+| `symphony.skill_retrieval.build.max_depth` | `6` | 技能树最大深度 |+| `symphony.skill_retrieval.build.root_categories` | 空字符串 | 技能树根分类配置,可用于稳定第一层目录 |+| `symphony.skill_retrieval.build.max_workers` | `2` | 技能索引构建并发数 |+| `symphony.skill_retrieval.build.max_retries` | `2` | LLM 分类或分组失败后的重试次数 |+| `symphony.skill_retrieval.build.request_timeout_seconds` | `420` | 单次 LLM 构建请求超时时间 |+| `symphony.skill_retrieval.build.classification_batch_limit` | `32` | 单次分类调用最多放入多少个技能 |+| `symphony.skill_retrieval.build.discovery_seed` | `42` | 构建采样随机种子,用于提高可复现性 |+| `symphony.skill_retrieval.build.postprocess_enabled` | `true` | 构建后是否清理不清晰或过小的分支 |+| `symphony.skill_retrieval.build.postprocess_max_passes` | `1` | 构建后处理最多执行轮数 |+| `symphony.skill_retrieval.build.postprocess_min_skills` | `6` | 构建后处理时保留分支的最小技能数参考值 |+| `symphony.skill_retrieval.build.equivalence_enabled` | `false` | 是否启用语义重复分支合并 |+| `symphony.skill_retrieval.retrieve.compact_codes_enabled` | `false` | 检索时是否使用更紧凑的节点编码 |+| `symphony.skill_retrieval.retrieve.flatten_tree` | `false` | 检索时是否扁平化技能树 |+| `symphony.skill_retrieval.retrieve.max_exposure_depth` | `1` | 单次 `skill_branch_explore` 最多披露的树深度 |++> 📖 **详情**:关于技能检索、技能总谱和技能编排的完整说明,请参考 [Symphony:技能检索、编排与分发](symphony-技能编排与分发.md)。++---++## 十、高级配置除 **配置信息** 页中的表单项外,产品还可通过**主配置**调整超时、温度、心跳间隔、上下文窗口阈值等(与界面中的「上下文压缩」「权限」「记忆禁忌」等开关配合使用)。**本文不列出这些项在磁盘上的位置**;若您需要离线修改或批量下发,请咨询部署方或管理员。-### 9.1 主配置中常见的逻辑项(概念名)+### 10.1 主配置中常见的逻辑项(概念名)下列为**主配置**里常见的逻辑路径名称,仅供与运维文档或发行说明对照;**不是**「配置信息」页上的每一个字段。@@ -351,11 +429,11 @@ permissions:<a id="dotenv-configuration"></a>-### 9.2 与界面以外的运行参数+### 10.2 与界面以外的运行参数浏览器自动化、网络代理、部分搜索链路的细粒度开关等,可能由**运行环境或部署模板**提供,**不一定**出现在 **配置信息** 页。普通用户只需完成界面上的必填项与业务相关密钥即可;其余由管理员或运维处理。-### 9.3 配置生效的优先顺序(概念)+### 10.3 配置生效的优先顺序(概念)从高到低一般为:**您在 Web「配置信息」中保存的设置** → **运行环境注入的变量** → **产品内置默认**。具体行为以您使用的版本与部署方式为准。