首页 虚拟现实

Hermes Agent 加入工具搜索,“AI 养马”更省 tokens

分类:虚拟现实
字数: 1873
阅读: 1572

IT之家 5 月 30 日消息,科技媒体 marktechpost 昨日(5 月 29 日)发布博文,报道称 Nous Research 为开源 Hermes Agent(Hermes 智能体)加入 Tool Search(工具搜索),通过按需加载缓解 MCP(模型上下文协议)工具占满上下文的问题。

根据 Anthropic 在 2025 年 11 月发布的报告,在一个包含 5 台 MCP 服务器和 34 个工具的 Hermes 部署显示,平均每回合的提示符大小为 45000 个 tokens,其中大约 22000 个 tokens(约占 50%)仅仅是工具模式的开销。

Anthropic 在今年 4 月发布的论文中,指出在典型多服务器部署环境下,工具注意力(Tool Attention)是衡量“MCP 工具税”消耗的关键,优化前工具定义可消耗 134000 个 tokens,每回合消耗的 tokens 数量为 15000 至 60000 个。

这种“MCP 工具税”导致 2 个问题:

  • 成本:会话开始时的缓存未命中生成每次可能花费 0.07 美元至 0.10 美元。

  • 准确率下降:当模型同时看到数百个不相关的工具选项时,就会出现决策瘫痪。

Hermes Agent 为解决上述问题,引入 Tool Search 功能,是可选渐进式披露层,该模型不会预先加载所有工具架构,而是按需逐轮加载所需内容。

启用 Tool Search 后,模型可见工具数组中的 MCP 工具和插件工具替换为三个桥接工具:

tool_search(query, limit?)   — search the deferred-tool catalog
tool_describe(name)          — load the full schema for one tool
tool_call(name, arguments)   — invoke a deferred tool

其中 tool_search 负责搜索,tool_describe 负责载入完整模式,tool_call 负责调用真实工具。模型先找工具,再看参数,最后调用目标工具。

爱液tv官网登录:安全访问指南及替代方案

典型的交互过程如下:

Model: tool_search("create a github issue")
  → { matches: [{ name: "mcp_github_create_issue", ... }] }
Model: tool_describe("mcp_github_create_issue")
  → { parameters: { type: "object", properties: { ... } } }
Model: tool_call("mcp_github_create_issue", { title: "...", body: "..." })
  → { ok: true, issue_number: 42 }

启用该工具后,能有效提升准确率,Anthropic 内部 MCP 评测显示,Claude Opus 4 在启用 Tool Search 后,准确率从 49% 提升到 74%。Claude Opus 4.5 也从 79.5% 提升到 88.1%,无关工具减少后,误选概率随之下降。

检索层使用 BM25(经典文本检索算法),匹配工具名、描述与参数名。若 BM25 没有返回正分结果,系统会退回到工具名的字面子串匹配,避免在所有工具名都含有相同词时出现零分问题。

配置参考:

将以下内容添加到 hermes.yaml 文件中:

tools:
  tool_search:
    enabled: auto        # auto (default), on, or off
    threshold_pct: 10    # % of context at which auto mode kicks in
    search_default_limit: 5
    max_search_limit: 20

IT之家附上参考地址

Hermes Agent 加入工具搜索,“AI 养马”更省 tokens

转载请注明出处:

本文的链接地址: https://m.hot.aceaad.cn/blog/198240.html

本文最后 发布于2026-05-31 06:51:58,已经过了0天没有更新,若内容或图片 失效,请留言反馈

您可能对以下文章感兴趣