← 返回 Skills 市场
177
总下载
1
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install context-memory
功能描述
解决AI记忆混乱问题——"今天讲明天忘"。通过文件系统和规则流程实现持久记忆,确保新任务开始时自动回顾上下文,而不是靠"想"。核心机制:任务开始判断→读取记忆→执行→保存。适用于频繁切换话题或任务的AI协作场景。
使用说明 (SKILL.md)
Context Memory - AI记忆持久化技能
核心问题
AI经常"今天讲明天忘":
- 新会话开始时丢失之前的信息
- 切换话题后忘记用户偏好
- 重复犯错(没有从错误中学习)
解决方案
AI的记忆靠文件,而不是靠"想"。
所有重要信息必须写入文件,新会话/新任务开始时主动读取。
记忆文件体系
workspace/
├── SOUL.md # 行为准则、个性偏好
├── AGENTS.md # 工作流程、代理规则
├── MEMORY.md # 长期记忆(用户偏好、项目背景)
├── TOOLS.md # 工具配置、集成注意事项
├── BOOTSTRAP.md # 会话启动规则(今天的主角)
├── .learnings/
│ ├── ERRORS.md # 错误记录
│ └── LEARNINGS.md # 纠正案例
└── memory/
└── YYYY-MM-DD.md # 每日记忆日志
核心规则:BOOTSTRAP.md
每次接新任务时,严格执行:
第一步:判断是否是新任务
出现以下任意情况 = 新任务:
- 🔄 话题跨度大(从A项目跳到B项目)
- 🔄 任务类型变(查LIMS → 发邮件)
- 🔄 关键词第一次出现(人名、编号、项目名)
- 🔄 你自己不确定
第二步:分类处理
| 情况 | 行动 |
|---|---|
| ✅ 明确是新任务 | 直接执行,不需要问用户 |
| ❓ 不确定 | 先问用户:"这是新任务吗?我需要确认一下" |
| ❌ 禁止 | 明明知道是新任务还跑去问(浪费用户时间) |
| ❌ 禁止 | 不确定还不问直接执行 |
第三步:确认后读取
SOUL.md+AGENTS.md+MEMORY.md+TOOLS.md.learnings/ERRORS.md+.learnings/LEARNINGS.md
第四步:执行 + 保存
- 执行任务
- 重要信息立即写入对应文件(不要"等会再记")
- 用户纠正时,立即记入
.learnings/LEARNINGS.md
记忆写入规则
什么时候必须写文件
| 场景 | 写入文件 | 格式 |
|---|---|---|
| 用户纠正你 | .learnings/LEARNINGS.md |
纠正日期+内容+正确做法 |
| 犯错误时 | .learnings/ERRORS.md |
错误描述+解决方法 |
| 用户偏好 | MEMORY.md 或 SOUL.md |
简短规则 |
| 工具配置 | TOOLS.md |
配置+注意事项 |
| 工作流程 | AGENTS.md |
步骤规范 |
| 每日总结 | memory/YYYY-MM-DD.md |
日志 |
写入原则
- 立即写 — 不要说"我记住了",context结束后就忘了
- 写具体 — 写"用户叫xiaolong"比写"用户有偏好"更有用
- 分类存 — 用户偏好→SOUL/MEMORY,错误→ERRORS,纠正→LEARNINGS
- 带日期 — 方便追溯
BOOTSTRAP.md 模板
# BOOTSTRAP.md - 会话启动规则
*每次新会话/新任务开始时,必须先读这个文件,然后严格遵守。*
## 铁律:判断 → 确认 → 读取 → 执行
**判断是否是新任务:**
- 话题跨度大(从A项目跳到B项目)
- 任务类型变(查LIMS → 发邮件)
- 关键词第一次出现
- 任何不确定的情况 → 问我确认
**分类处理:**
- ✅ 明确是新任务 → 直接做,不废话
- ❓ 不确定 → 先问我确认
- ❌ 禁止跳步
**确认后读取:**
1. SOUL.md + AGENTS.md + MEMORY.md + TOOLS.md
2. .learnings/ERRORS.md + LEARNINGS.md
3. 相关技能文档
## 用户偏好
- 称呼:(用户的称呼偏好)
- 时区:(时区)
- 邮箱:(邮箱)
每日记忆日志模板
# memory/YYYY-MM-DD.md
## 今日完成
- 任务1:...
- 任务2:...
## 重要决策
- 决策1:...(原因)
- 决策2:...
## 新学到的
- 教训1:...(从错误中学到)
- 教训2:...(用户纠正)
## 待跟进
- ...
技能使用场景
- 用户频繁切换话题 — 每次切换自动读取记忆文件
- 多任务并行 — 任务间隔离,靠文件传递上下文
- 长期项目配合 — 重要规则写入MEMORY.md,新会话直接加载
- 错误不再重犯 — 错误写入ERRORS.md,下次自动回顾
效果验证
使用这个技能后,AI应该做到:
- ✅ 新会话开始时,自动知道用户称呼偏好
- ✅ 新任务开始时,自动读取相关项目背景
- ✅ 犯过的错误不再犯(从ERRORS.md中学习)
- ✅ 用户纠正一次后,记住正确的做法
配套技能
- self-improving-agent — 提供
.learnings/文件格式和写入规范 - 其他业务技能按需加载
核心心法:AI的记忆靠文件,不靠"想"。写下来的才是真的记住了。
安全使用建议
This skill is coherent and low-risk from an install/credential perspective, but it will persistently write user- and task-related data to files. Before installing, decide where the workspace/ directory will live and who can read it. Avoid writing secrets (passwords, API keys, private PII) into these memory files or ensure they are encrypted and access-controlled. Consider tightening BOOTSTRAP.md rules so ambiguous cases require explicit user confirmation (to avoid unintended autonomous actions), and set a retention/deletion policy and audit process for the memory files. Finally, test the behavior in a sandboxed agent environment to verify it only reads/writes the intended workspace paths.
功能分析
Type: OpenClaw Skill
Name: context-memory
Version: 1.0.0
The 'context-memory' skill is designed to provide persistent state for an AI agent by utilizing a structured set of local markdown files (e.g., MEMORY.md, SOUL.md, and .learnings/ directory) within the workspace. While the instructions in SKILL.md direct the agent to store user preferences such as names and emails, the behavior is entirely local, transparent, and aligned with the stated purpose of maintaining context across sessions. There are no indicators of data exfiltration, unauthorized command execution, or malicious prompt injection.
能力评估
Purpose & Capability
Name/description match the actual instructions: the skill defines a file-based persistent memory layout and prescribes read/write rules for new tasks. No unrelated binaries, env vars, or installs are requested.
Instruction Scope
Instructions are focused on reading/writing files under a declared workspace layout (SOUL.md, MEMORY.md, .learnings/, memory/YYYY-MM-DD.md). This is coherent for a memory skill. However, the instructions mandate immediate persistent writes of potentially sensitive user data and allow the agent to auto-load '相关技能文档' and '其他业务技能按需加载' (related skill docs), which is somewhat open-ended and could cause the agent to access other skill documentation or persist unexpected information unless the workspace boundaries and content rules are enforced.
Install Mechanism
Instruction-only skill with no install spec and no code files—no artifacts will be downloaded or written by an installer, so install risk is minimal.
Credentials
The skill requests no environment variables, credentials, or config paths. The file access it prescribes is limited to a workspace directory, which is proportional to its stated purpose.
Persistence & Privilege
The skill intentionally creates and writes persistent files (this is its purpose). It is not force-enabled (always:false) and does not request elevated platform privileges. Users should note the privacy and retention implications of persistent storage.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install context-memory - 安装完成后,直接呼叫该 Skill 的名称或使用
/context-memory触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of context-memory: 持久化文件体系解决AI记忆混乱问题。
- 提供分层记忆文件架构,包括SOUL/AGENTS/MEMORY/TOOLS/ERRORS/LEARNINGS等
- BOOTSTRAP流程:新任务自动判断、读取必需记忆,再执行与保存
- 明确场景分类和写入规范,防止遗漏或记错
- 提供每日日志和纠错模板,促进长期学习
- 适用于高频话题切换、多任务并行和长期AI协作
元数据
常见问题
context-memory 是什么?
解决AI记忆混乱问题——"今天讲明天忘"。通过文件系统和规则流程实现持久记忆,确保新任务开始时自动回顾上下文,而不是靠"想"。核心机制:任务开始判断→读取记忆→执行→保存。适用于频繁切换话题或任务的AI协作场景。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 177 次。
如何安装 context-memory?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install context-memory」即可一键安装,无需额外配置。
context-memory 是免费的吗?
是的,context-memory 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
context-memory 支持哪些平台?
context-memory 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 context-memory?
由 long57777(@long57777)开发并维护,当前版本 v1.0.0。
推荐 Skills