
Letter2025/dsh-tool-search
30最近提交 2026年8月14日
dsh-tool-search DSH 插件
当工具目录过大时,每次交互都会注入所有工具的 JSON schema,浪费大量 token。此插件将长尾工具折叠为三个桥接工具,让模型通过配置的 rerank 模型按需发现和加载。支持分层暴露、对话式设置以及用户级或项目级配置。
如何安装 dsh-tool-search DSH 插件
dsh plugin --profile web add dsh-tool-search复制不会执行命令。安装 dsh-tool-search DSH 插件前请核对仓库和版本。
dsh-tool-search DSH 插件数据来源
dsh-tool-search DSH 插件快照日期:2026年8月16日
discovered
dsh-tool-search DSH 插件能做什么
- 核心工具(文件/Shell/基本工具)始终直接显示在上下文中。
- 提供三个桥接工具:tool_search、tool_describe、tool_call,用于延迟并按需加载长尾工具。
- 根据 token 预算(上下文窗口的 thresholdPct%,上限为 listingMaxTokens)自动调整可见工具列表。
- 支持运行时配置文件(~/.dsh/dsh-tool-search.json)的热重载,用于分组、重排序模型和预加载。
- 内置 skill(tool-slimmer-setup),可通过对话方式完成工具分组和 rerank 配置。
dsh-tool-search DSH 插件适合哪些场景
- 在 DSH 中使用大量 MCP 服务器或插件工具时减少 token 消耗。
- 将庞大的工具目录分组管理,便于查找和使用。
- 让模型仅在需要时动态搜索和加载工具,节省上下文预算。
- 通过 JSON 文件按项目或全局配置工具可见性。
- 使用 rerank 模型在首次对话时预加载语义相关的工具。
dsh-tool-search DSH 插件适合谁
- 管理大量工具(如来自 MCP 服务器或插件)的 DSH 用户。
- 希望在智能体工作流中优化 token 使用和模型上下文占用的开发者。
dsh-tool-search DSH 插件的限制
- 需要配置兼容 OpenAI 的 rerank 模型端点(/v1/rerank)才能获得最佳排序;关键词回退效果较差。
- 仅支持 OpenAI 兼容的 rerank 端点,不支持其他匹配器类型。
- 插件处于早期阶段,详见 DESIGN.md 了解架构细节和潜在问题。
- 配置更改需要重启或等到下一次交互(运行时文件支持热重载)。
dsh-tool-search DSH 插件的仓库 README 摘录
以下文字摘自 dsh-tool-search DSH 插件的上游仓库 Letter2025/dsh-tool-search 的 README,版权归原作者,仅作引用。
Tool search & slimming for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH): Hermes-style progressive disclosure. When your tool catalog gets large (many MCP servers or plugin tools), every tool's JSON schema is injected into the model context on every turn — wasting tokens on tools the task never uses. This plugin collapses the long tail behind three bridge tools and lets the model discover and load them on demand through a configured **rerank model**. - **Core tools stay eager** — file/shell/essential tools are always directly visible. - **Bridge tools** — `tool_search`, `tool_describe`, `tool_call` replace the deferred schemas. - **Tiered disclosure** — the visible listing shrinks automatically as the catalog grows. - **Conversational setup** — the bundled `tool-slimmer-setup` skill groups your tools by talking to you, and guides configuring the rerank model. - **User or project config** — groups/matcher live in `~/.dsh/dsh-tool-search.json` (global) or `<workspace>/.dsh/dsh-tool-search.json` (per project), your choice. ## Install ```sh dsh plugin --profile web add dsh-tool-search ``` ## How it works Inspired by [Hermes Agent's Tool Search](https://
阅读完整 README仓库未声明许可,使用前请先与作者确认。
dsh-tool-search DSH 插件常见问题
如何配置 dsh-tool-search 的 rerank 模型?
需要在运行时配置文件(全局使用 ~/.dsh/dsh-tool-search.json,项目级使用 <workspace>/.dsh/dsh-tool-search.json)中添加 `matcher` 部分。matcher 需要兼容 OpenAI 的 /v1/rerank 端点,包括 `endpoint`、`apiKey`、`model` 和 `topN`。例如:`{"endpoint": "https://dashscope.aliyuncs.com/compatible-mode/v1/rerank", "apiKey": "sk-...", "model": "qwen3-reranker", "topN": 20}`。如果没有配置 matcher,`tool_search` 会退化为关键词匹配,并提示你进行设置。
如何使用对话式设置对工具进行分组?
向你的智能体提问:'帮我配置 dsh-tool-search 的工具分组'。内置的 `tool-slimmer-setup` skill 会读取你的工具目录,提出分组建议,与你确认,并询问配置是全局还是仅当前项目。然后还会引导你配置 rerank 匹配器。对话结束后,分组会保存到运行时配置文件中,在下一轮对话时生效。
没有 rerank 模型可以使用 dsh-tool-search 吗?
可以,但功能有限。如果没有配置 rerank 匹配器,`tool_search` 会退化为关键词匹配(精确名称匹配 > 名称分词匹配 > 描述分词匹配)。这种回退方式准确性较低,可能无法返回相关结果。插件会显示设置引导,直到你配置了匹配器。建议设置 rerank 端点以获得最佳效果。
如何临时启用或禁用插件?
可以在 profile 的 `cordis.patch.yml` 中设置 `enabled` 配置项为 `auto`、`on` 或 `off`。默认是 `auto`,表示当工具目录较大时自动激活。设置为 `on` 强制启用,`off` 完全禁用。修改后需要重启 DSH 才能生效。
用户作用域和项目作用域的配置有什么区别?
用户作用域的配置存储在 `~/.dsh/dsh-tool-search.json`,适用于所有项目。项目作用域的配置存储在 `<workspace>/.dsh/dsh-tool-search.json`,仅适用于该项目。默认情况下,插件会优先检查项目文件,如果存在则项目作用域优先。你也可以在 `cordis.patch.yml` 中设置 `configScope` 为 `user` 或 `project` 来强制指定作用域。