← Back to Skills Marketplace
177
Downloads
1
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install context-memory
Description
解决AI记忆混乱问题——"今天讲明天忘"。通过文件系统和规则流程实现持久记忆,确保新任务开始时自动回顾上下文,而不是靠"想"。核心机制:任务开始判断→读取记忆→执行→保存。适用于频繁切换话题或任务的AI协作场景。
README (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的记忆靠文件,不靠"想"。写下来的才是真的记住了。
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install context-memory - After installation, invoke the skill by name or use
/context-memory - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of context-memory: 持久化文件体系解决AI记忆混乱问题。
- 提供分层记忆文件架构,包括SOUL/AGENTS/MEMORY/TOOLS/ERRORS/LEARNINGS等
- BOOTSTRAP流程:新任务自动判断、读取必需记忆,再执行与保存
- 明确场景分类和写入规范,防止遗漏或记错
- 提供每日日志和纠错模板,促进长期学习
- 适用于高频话题切换、多任务并行和长期AI协作
Metadata
Frequently Asked Questions
What is context-memory?
解决AI记忆混乱问题——"今天讲明天忘"。通过文件系统和规则流程实现持久记忆,确保新任务开始时自动回顾上下文,而不是靠"想"。核心机制:任务开始判断→读取记忆→执行→保存。适用于频繁切换话题或任务的AI协作场景。 It is an AI Agent Skill for Claude Code / OpenClaw, with 177 downloads so far.
How do I install context-memory?
Run "/install context-memory" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is context-memory free?
Yes, context-memory is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does context-memory support?
context-memory is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created context-memory?
It is built and maintained by long57777 (@long57777); the current version is v1.0.0.
More Skills