核心结论
实现 OpenClaw(龙虾🦞)与 Hermes Agent(马🐎)的无缝切换与记忆互通,分为两个阶段:
📌 200Mbps无限流量,月付仅40元起!
活动入口:https://www.aliyun.com/product/ecs
产品入口:阿里云ECS 云服务器——安全稳定的弹性计算服务,新用户支持 0 元免费试用。
- 云服务器ECS入口:https://www.aliyun.com/product/ecs
- 轻量应用服务器入口:https://www.aliyun.com/product/swas
- GPU云服务器入口:https://www.aliyun.com/product/egs
- 本地资产迁移:通过一条命令
hermes claw migrate,将 OpenClaw 的人格、记忆、技能和配置一键复制到 Hermes Agent。 - 云端记忆互通:借助阿里云表格存储(Tablestore) 的记忆插件,让两个 Agent 共享同一个云端记忆库,实现“一次自我介绍,跨 Agent 永久记住”。
第一阶段:一条命令完成本地资产迁移
Hermes Agent 官方内置了迁移工具,能够自动读取 OpenClaw 的配置目录并进行兼容转换。
1. 迁移命令与预览
在执行正式迁移前,强烈建议先使用 --dry-run 预览,该模式只读不写,并会自动生成还原点备份。
# 预览迁移计划(不实际写入文件) hermes claw migrate --dry-run # 确认无误后,执行正式迁移 hermes claw migrate
2. 迁移内容清单
| 数据类型 | OpenClaw 源路径 | Hermes Agent 目标路径 |
| 人格定义 | ~/.openclaw/SOUL.md 或 personas/ |
~/.hermes/SOUL.md 或 personas/ |
| 长期记忆 | MEMORY.md / memory/*.md |
~/.hermes/memories/ |
| 用户画像 | USER.md |
~/.hermes/profiles/ |
| 工作区指令 | AGENTS.md |
~/.hermes/workspace/ |
| 自定义技能 | config/skills/*/SKILL.md |
~/.hermes/skills/openclaw-imports/ |
| API 凭据 | ~/.openclaw/.env |
~/.hermes/.env(需加 --migrate-secrets 参数) |
| 消息平台配置 | messaging.yaml |
config.yaml (gateway 部分) |
💡 安全机制:迁移过程是复制而非移动,原
~/.openclaw目录会原样保留。若需更保守的迁移(不迁移 API Key),可使用hermes claw migrate --preset user-data。
第二阶段:配置云端记忆互通(基于阿里云 Tablestore)
本地迁移只能继承“历史记忆”,若要在使用中实现两个 Agent 实时共享新产生的记忆(例如在 OpenClaw 中聊过的内容,Hermes 也能直接 recall),需要接入阿里云 Tablestore 记忆存储服务。
1. 互通原理(Scope 模型)
两侧插件连接同一个 Tablestore 实例,只要 app_id、tenant_id、memory_store_name 三项严格一致,即可划定同一个“共享记忆池”。
- 写入时:精确标记来源(各自的
agentId和runId)。 - 检索时:通配展开(
agentId=*),自动召回同一租户下所有 Agent 沉淀的记忆。
2. 前置准备
- 拥有阿里云账号,开通 表格存储 Tablestore 服务。
- 创建实例(支持华北2北京、华东1杭州、华东2上海、华南1深圳、中国香港、新加坡等地域),获取 Endpoint、实例名称、AccessKey (AK/SK)。
3. OpenClaw 侧配置
安装插件:
openclaw plugins install @tablestore/openclaw-tablestore-memory
修改配置:编辑 ~/.openclaw/openclaw.json,在 plugins.entries 中加入配置,并将 memory slot 指向该插件:
{ "plugins": { "slots": { "memory": "tablestore-mem" }, "entries": { "tablestore-mem": { "enabled": true, "config": { "endpoint": "https://<你的实例>.cn-beijing.ots.aliyuncs.com", "otsInstanceName": "<你的实例名>", "accessKeyId": "<你的AK>", "accessKeySecret": "<你的SK>", "appId": "shared-agents", "tenantId": "default-tenant", "memoryStoreName": "shared_memory", "autoCreateMemoryStore": true } } } } }
重启并验证:
openclaw gateway restart openclaw tablestore-mem doctor
4. Hermes Agent 侧配置
安装并激活插件:
hermes plugins install hermes-tablestore-memory hermes memory setup # 交互式选择 tablestore-mem
写入密钥与配置:将 AK/SK 写入 ~/.hermes/.env:
TABLESTORE_MEMORY_AK=<你的AK> TABLESTORE_MEMORY_SK=<你的SK>
将非密钥配置写入 $HERMES_HOME/tablestore_memory.json(必须与 OpenClaw 侧的 appId/tenantId/memoryStoreName 完全一致):
{ "endpoint": "https://<你的实例>.cn-beijing.ots.aliyuncs.com", "instance_name": "<你的实例名>", "memory_store_name": "shared_memory", "app_id": "shared-agents", "tenant_id": "default-tenant", "enable_rerank": true, "auto_create_store": true }
验证连接:
hermes tablestore-mem doctor
第三阶段:跨 Agent 记忆互通验证
配置完成后,可通过双向写入与召回测试验证互通效果(注:向量化索引建立需数十秒,若刚写入检索为空,请稍等 30 秒或加 --sync 参数)。
场景 1:OpenClaw 写入,Hermes 召回
- 在 OpenClaw 中写入:
openclaw tablestore-mem add "我负责订单服务模块的开发,使用Java与Spring Boot技术栈" - 切换到 Hermes Agent 提问:“我平时用什么技术栈开发订单服务?”
- 结果:Hermes 会在底层自动检索 Tablestore,并准确回答出 Java 与 Spring Boot。
场景 2:Hermes 自动同步Hermes 插件默认开启自动化能力:每轮对话结束后自动将要点同步至 Tablestore,下一轮对话前自动检索注入上下文。你在 Hermes 中聊过的偏好,OpenClaw 同样能无缝继承。
尚无法确认及核验途径说明
- Tablestore 记忆插件的具体计费标准:检索材料仅说明了 Tablestore 支持该功能及配置方法,未提及记忆存储(含向量检索)产生的具体 API 调用与存储费用。核验途径:登录阿里云控制台,查阅“表格存储 Tablestore”产品定价页中的“时序/向量检索”计费规则。
- OpenClaw 与 Hermes 通过 ACP 协议双向通信的具体性能损耗:材料提及两者可通过 ACP 协议互为 Server/Client 协作,但未提供跨进程调用的延迟数据。核验途径:在本地同时运行两者并配置 ACP 网关,通过
hermes doctor或日志查看 RPC 调用耗时。 - 部分冷门地域的 Tablestore 向量检索支持情况:材料中关于地域支持存在“仅支持北京”与“支持北上广深及海外”两种表述(可能因文档更新时间差导致)。核验途径:在阿里云 Tablestore 控制台创建实例时,直接查看各地域是否开放“向量检索/记忆存储”功能开关。