# SESSION BOOTSTRAP (Shared Memory) ## 目标 - 所有客户端(OpenClaw / Claude / Codex / Cursor)共享同一记忆系统。 - Durable memory authority 是 `collective-memory-repo`。 - 群体权威召回只认远程 `memory-gateway`。 ## 统一架构 - Memory repo: `/Users/lingyuzeng/project/collective-memory-repo` - Gateway URL: `http://100.64.0.45:8787` - Gateway MCP URL: `http://100.64.0.45:8787/mcp` - 记忆层规则: - 共享长期事实:`shared/long-term/` - 每日记录:`daily/` - 任务协作:`tasks//` - Agent 私域:`agents//` ## 分支规则 - 长期协作默认:`branch=main` - 并发任务协作:`branch=task/` - 群体查询必须带:`require_latest=true` ## 读写规则 - Runtime 文件(persona/tools/heartbeat)留在各自本机 runtime 目录。 - Durable facts 只能写入 `collective-memory-repo` 的对应 lane。 - `vaults/memory/*` 是兼容区,不是长期真相源。 ## 会话初始化必填上下文 在新会话第一条消息中提供: - `machine_hostname` - `machine_alias` - `agent_id` - `memory_branch`(默认 `main`) - `task_id`(如有) ## 示例(首条消息) ```text @/Users/lingyuzeng/project/collective-memory-repo/policies/SESSION-BOOTSTRAP.md machine_hostname=mac-5 machine_alias=mac5 agent_id=codex-mac5 memory_branch=main ``` ## MCP 接入要求 - 先在客户端注册 MCP server(URL 指向 `...:8787/mcp`)。 - 再通过 `@SESSION-BOOTSTRAP.md` 注入架构与规则。 - 客户端本地检索可保留,但群体结论以 gateway 结果为准。