🦞 Hermes 养虾记
🤖 龙虾分身术
每天用 Hermes 龙虾聊天,有时需要切换多个话题,或者同时处理多个任务。
使用同一个龙虾会造成上下文混在一起,记忆互相污染。
我要做的是让同一个 Agent 以两个独立身份同时在线,互不干扰。
━━━━━━━━━━━━━━━━━━━━
🎯 一、解决的痛点
一个 Bot 什么都在一个会话里聊——查行情、改代码、写报告、随便聊天,上下文混在一起,记忆互相污染。/new 清空了历史,不 /new 越来越卡。
分身解决:领域拆开,各管各的。
━━━━━━━━━━━━━━━━━━━━
🔧 二、配置原理
Profiles 是 Hermes 内置的多实例机制。每个 Profile 有自己独立的配置文件、密钥、会话数据库、记忆存储。唯一共享的是技能文件(只读)。
~/.hermes/
├── config.yaml # Profile A
├── .env # Profile A
├── sessions/ # Profile A
├── memory/ # Profile A
└── profiles/
└── octobot/ # 分身:配置/密钥/会话/记忆全独立
━━━━━━━━━━━━━━━━━━━━
📋 三、操作步骤
以下是手动操作步骤,当然你也可以让你的 Hermes 自动操作
① 建 Bot: @BotFather → /newbot → 拿 Token
② 克隆:
hermes profile create octobot --clone
③ 换 Token(必须):
hermes config set telegram.bot_token <新Token> -p octobot
④ 启动:
hermes -p octobot gateway run
⑤ 后台常驻:
hermes -p octobot gateway install
搞定。现在两个 Bot 同时在线。
━━━━━━━━━━━━━━━━━━━━
📋 四、日常管理
- hermes profile list — 查看所有分身
- hermes -p octobot chat -q "xxx" — 用分身干活
- hermes -p octobot config set model.default xxx — 给分身换模型
- hermes profile rename octobot xxx — 改名
- hermes profile export octobot — 导出打包
━━━━━━━━━━━━━━━━━━━━
💡 五、你能用它做什么
- 分身 A(日常) — 轻量模型,查资料、监控、闲聊
- 分身 B(深度) — 强力模型,写代码、DeFi 分析、改服务器配置
- 分身 C(自动化) — 只跑 cron 任务
- 分身 D(对外) — 限制工具权限的低成本公共 Bot
━━━━━━━━━━━━━━━━━━━━
⚠️ 六、注意
- 不换 Token = 两个 Bot 抢一个连接,轮流掉线
- 端口冲突:两个 Gateway 默认都占 11020,第二个设 gateway.api_port 11021
- 双进程 = 双倍内存,日常分身用轻量模型
核心原则:领域隔离比上下文管理可靠。
#Profiles #AIAgent #Hermes