Hermes Agent 对接指南

通过 Hermes Agent 插件连接微织 Weave,实现 AI 智能对话

概览

Hermes Agent 是 Nous Research 开发的 AI Agent 系统。通过安装 Weave 平台插件,Hermes Agent 可以作为 AI 联系人接入微织 Weave,用户通过浏览器即可与 Hermes 对话。

Hermes Agent(内网)
↓ 反向 WebSocket
微织 Weave(weaveai.chat)
用户浏览器

前置条件

  • 已安装 Hermes Agent(安装文档
  • 已注册微织 Weave 账号(注册
  • 至少一个 LLM API Key(OpenRouter / Anthropic / DeepSeek 等)

步骤一:在 Weave 中添加 Hermes 联系人

  1. 登录 weaveai.chat
  2. 点击左侧「联系人」-> 添加 -> 选择「Hermes Agent」
  3. 输入联系人名称(如:我的 AI 助手)
  4. 系统自动生成 WS ID,记录此值
  5. 点击「完成」
WS ID 是 Hermes Agent 连接 Weave 的唯一标识,格式类似:df51c4ae-43fc-...

步骤二:安装 Weave 插件

方式一:一键安装(推荐)

macOS / Linux:

curl -sSL https://raw.githubusercontent.com/Weave-chat/hermes-weave-plugin/main/install.sh | bash

Windows (PowerShell):

irm https://raw.githubusercontent.com/Weave-chat/hermes-weave-plugin/main/install.ps1 | iex
一键安装是交互式的,会自动完成下载插件、启用插件、配置环境变量(WS URL / WS ID / API Key)。如果使用一键安装,可以直接跳到步骤五

方式二:手动安装

# 克隆插件
git clone https://github.com/Weave-chat/hermes-weave-plugin.git

# 复制到 Hermes 插件目录(替换 <profile> 为你的 profile 名)
cp -r hermes-weave-plugin ~/.hermes/profiles/<profile>/plugins/weave-platform

Windows 用户也可以从 GitHub Releases 下载 ZIP,解压到 %USERPROFILE%\.hermes\profiles\<profile>\plugins\weave-platform\

步骤三:启用插件

# 启用插件
hermes plugins enable weave-platform

# 验证插件已加载
hermes plugins
# 应显示 weave-platform [enabled]

步骤四:配置环境变量

编辑 ~/.hermes/profiles/<profile>/.env 文件,添加:

# Weave 连接配置
WEAVE_WS_URL=wss://www.weaveai.chat
WEAVE_WS_ID=your-ws-id-from-step-1
WEAVE_API_KEY=***
# LLM 配置(如尚未配置)
OPENROUTER_API_KEY=sk-or-...
如果你的 Weave 联系人没有设置 API Key,WEAVE_API_KEY 可以省略。

步骤五:启动 Gateway

# 启动 Hermes Gateway
hermes gateway

# 预期输出:
# [Weave] 适配器初始化: ws_id=df51c4ae-...
# [Weave] 连接中: wss://www.weaveai.chat/api/v1/ai-contacts/ws/agent/...
# [Weave] WebSocket 已连接

看到「WebSocket 已连接」即表示连接成功。返回 weaveai.chat,联系人状态应显示为「在线」。

步骤六:开始对话

  1. 在 weaveai.chat 中点击 Hermes 联系人
  2. 输入消息,如「你好」
  3. Hermes Agent 会流式回复

功能说明

功能支持说明
流式输出逐字流式显示回复
多轮对话完整的上下文记忆
工具调用文件读写、终端、浏览器等
斜杠命令/new、/title、/model 等
附件发送图片、文件(Base64 内嵌)
会话管理多会话切换、历史记录
审批/澄清工具调用审批、澄清对话
断线重连自动指数退避重连
Cron 定时任务定时消息推送

常见问题

连接失败怎么办?

检查以下几点:

  • WEAVE_WS_URLWEAVE_WS_ID 是否正确设置
  • 网络是否能访问 wss://www.weaveai.chat
  • 运行 hermes gateway status 查看状态
  • 查看日志 hermes logs --follow

插件未加载?

# 确认插件已启用
hermes plugins

# 如果显示 [disabled],执行:
hermes plugins enable weave-platform

# 重启 Gateway
hermes gateway --restart

如何升级插件?

# 下载最新版本覆盖
cp -r /tmp/weave-src/hermes-plugins/weave-platform ~/.hermes/plugins/platforms/weave

# 重启 Gateway
hermes gateway --restart

如何使用多个 Hermes Agent?

在 Weave 中添加多个 Hermes 联系人,每个联系人会生成不同的 WS ID。在每台 Hermes Agent 机器上使用对应的 WS ID 配置即可。

环境变量参考

变量必填说明
WEAVE_WS_URLWeave WebSocket 地址
WEAVE_WS_IDAgent 连接标识符
WEAVE_API_KEYAPI 密钥(如设置)
WEAVE_HOME_CHANNELCron 投递通道(默认同 WS_ID)
WEAVE_ALLOW_ALL_USERS允许所有用户(默认 true)