Files
2026-06-06 10:40:48 +08:00

38 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Session Start Protocol
> 每次会话开始时按此清单加载上下文。
> **适配 OpenClaw 机制**OpenClaw 自动注入 MEMORY.md + HEARTBEAT.md + 项目上下文文件。
> 本协议定义我收到第一条用户消息后**应该主动做的加载动作**。
## 必做(每次会话首条消息后)
1. **检查当前日期**`date` 命令,不靠 LLM 知识
2. **加载 Core Memory**`bash scripts/memory-auto.sh on-start`
3. **读今天的 daily/**`memory/daily/YYYY-MM-DD.md`
4. **读 open-loops**`memory/registers/open-loops.md`
## 搜索记忆
统一入口:`bash scripts/memory-search.sh "查询"`
参数:
- `--deep` — 深度搜索(含远程+实体扩展)
- `--context "场景"` — 上下文匹配
- `--type decision` — 类型过滤
- `--json` — JSON 输出
替代旧的 memory-router.sh search 和 memory-recall.sh。
## 按需(根据话题触发)
- 提到人 → `memory/registers/people.md`
- 提到项目 → `memory/projects/<name>.md`
- 技术选型 → `memory/vault.md` #重要决策
- 偏好相关 → `memory/registers/preferences.md`
## 会话结束 / 上下文压缩前
- 检查纠正、决策、承诺、新偏好 → 写入 daily/ 带 `[session-flush]`
- Write Gate 判断是否提升到 registers/
- 更新 open-loops 状态