diff --git a/honcho/share-multi-client.md b/honcho/share-multi-client.md index e500184..12d7c20 100644 --- a/honcho/share-multi-client.md +++ b/honcho/share-multi-client.md @@ -1,17 +1,17 @@ # Honcho 多 Hermes 客户端共享方案 -> 状态: 📝 草案 (2026-06-20) -> 适用: 家里 vm61 部署 honcho + 3 个 hermes 客户端共享同一份记忆 +> 状态: 📝 草案 (2026-06-20, 06-26 拓扑修正) +> 适用: vm61 (10.8.0.9, 备用/测试环境) 部署 honcho + 3 个 hermes 客户端共享同一份记忆 --- ## 1. 场景 -| 客户端 | 位置 | 网络到 vm61 | peer 名 | -|---|---|---|---| -| mypc03 (WSL Debian) | 🏠 家里 LAN | 同网段直连 | `laodeng-mypc03` | -| gov-pc (公司机器) | 🏢 公司 | WireGuard → vm61 | `laodeng-govpc` | -| macbook | ☕ 任意位置 | WireGuard → vm61 | `laodeng-mac` | +| 客户端 | 位置 | WireGuard IP | 网络到 vm61 | peer 名 | +|---|---|---|---|---| +| mypc03 (WSL Debian) | 🏠 家里 LAN | `10.8.0.112` | WireGuard → vm61 | `laodeng-mypc03` | +| gov-pc (公司机器) | 🏢 公司 | `10.8.0.143` | WireGuard → vm61 | `laodeng-govpc` | +| macbook | ☕ 任意位置 | `10.8.0.144` | WireGuard → vm61 | `laodeng-mac` | **3 个客户端都是老登本人**用,所以希望: - ✅ **共享 workspace**(`home`):在 A 上聊的事,B 上能召回 @@ -31,8 +31,8 @@ flowchart LR C[macbook
peer: laodeng-mac
key: tok_gamma] end - subgraph Vm61["vm61 (192.168.10.61)"] - WG[WireGuard
10.0.0.1] + subgraph Vm61["vm61 (192.168.10.61 / WG 10.8.0.9, 备用)"] + WG[WireGuard
10.8.0.9 入口] API[honcho-api:8000
AUTH ON] DB[(postgres+pgvector)] DERIVER[honcho-deriver
~2 done/min] @@ -56,7 +56,7 @@ flowchart LR class DB,REDIS store ``` -**网络**:3 客户端 → WireGuard 隧道 (10.0.0.x) → vm61 8000 +**网络**:3 客户端 (10.8.0.112/143/144) → WireGuard 隧道 (10.8.0.x) → vm61 (10.8.0.9) 8000 --- @@ -67,7 +67,7 @@ flowchart LR | **AUTH 开** | ✅ ON | OFF(内网) | 可审计 + 可撤销 + 可限流;WireGuard 内网本身已加密 | | **Workspace** | `home` 一个共用 | 每个 peer 独立 ws | 老登本人用,跨设备回忆体验更好 | | **Peer** | 带设备后缀 | 统一 `laodeng` | 审计需要知道"哪台设备写的";peer 概念在 honcho 里是身份,不影响记忆语义 | -| **API URL** | `http://10.0.0.1:8000`(WireGuard 内网 IP) | 公网 IP / 域名 | WireGuard 已加密 + 认证,没必要再绕公网 | +| **API URL** | `http://10.8.0.9:18000`(vm61 WireGuard IP) | 公网 IP / 域名 | WireGuard 已加密 + 认证,没必要再绕公网 | | **LLM 凭据** | 客户端本地保留 | 共享到 honcho | deriver 已经持有全局 LLM key;客户端 hermes 自己的对话 LLM 不应上送 honcho | | **deriver 后台** | 共享 vm61 上现有 | 每客户端本地跑 | honcho deriver 设计就是单实例后台,集中推理更省 API 配额 | @@ -91,7 +91,7 @@ docker inspect honcho-api | grep -A2 -E "HostPort|NetworkMode" docker logs honcho-api 2>&1 | grep -i "listening" # 1.4 从 WireGuard 网卡验证 -curl -s http://10.0.0.1:8000/health +curl -s http://10.8.0.9:18000/health # 期望: {"status":"ok"} ``` @@ -131,7 +131,7 @@ scp /root/.honcho-keys/mac.key macbook:~/.honcho-keys/ ```bash # 通用(3 台都跑) hermes config set memory.provider honcho -hermes config set memory.honcho.api_url http://10.0.0.1:8000 +hermes config set memory.honcho.api_url http://10.8.0.9:18000 hermes config set memory.honcho.workspace home # mypc03 额外 @@ -156,7 +156,7 @@ hermes config set memory.honcho.api_key "$(cat ~/.honcho-keys/mac.key)" ```bash curl -s -o /dev/null -w "HTTP %{http_code}\n" \ -H "Authorization: Bearer $(cat ~/.honcho-keys/xxx.key)" \ - http://10.0.0.1:8000/v2/workspaces/home + http://10.8.0.9:18000/v2/workspaces/home # 期望: HTTP 200 ``` @@ -189,7 +189,7 @@ docker exec honcho-database psql -U honcho -d honcho -c \ docker logs honcho-deriver --since 1h | grep -E "queue|processed|done" # 队列深度 -curl -s http://10.0.0.1:8000/v2/admin/queues \ +curl -s http://10.8.0.9:18000/v2/admin/queues \ -H "Authorization: Bearer $(cat /root/.honcho-keys/admin.key)" | jq ``` @@ -209,7 +209,7 @@ curl -s http://10.0.0.1:8000/v2/admin/queues \ |---|---|---| | `curl HTTP 401` | key 不对 / expired | 重新跑 `create-multi-keys.sh` | | `curl HTTP 404` | workspace 名错 | `hermes config get memory.honcho.workspace` 必须 = `home` | -| `curl timeout` | WireGuard 没拨上 | `wg show` 看握手时间;`ping 10.0.0.1` | +| `curl timeout` | WireGuard 没拨上 | `wg show` 看握手时间;`ping 10.8.0.9` | | 召回不到 mypc03 写的 | peer 不在同一 workspace | 三台 `hermes config get memory.honcho.workspace` 都该是 `home` | | deriver 队列暴涨 | LLM 限流(SiliconFlow) | 临时调低 deriver 并发;或加备份 LLM endpoint | | honcho-api OOM | 写入太频繁 | `docker stats honcho-api`;考虑加 limit | @@ -242,7 +242,7 @@ DELETE FROM peers WHERE name = 'laodeng-govpc'; | 资源 | 路径 | 说明 | |---|---|---| | honcho stack | `deploy.stack/honcho/` | 当前部署 | -| WireGuard 部署 | `deploy.stack/WireGuardVPN/wg-easy/` | 已有,给 3 客户端分配 10.0.0.2/3/4 | +| WireGuard 部署 | `deploy.stack/WireGuardVPN/wg-easy/` | 已有,给 3 客户端分配 10.8.0.112/143/144,honcho 服务端在 10.8.0.9 | | honcho deriver 调试 | honcho memory (2026-06-19/20) | deriver 修复历史 | | Hermes memory provider 切换 | hermes-agent skill | `memory.provider honcho` 配法 | | 凭据管理 | `~/.honcho-keys/` | chmod 600,绝不入 git |