Agent Memory Ops
Use this skill when you need to keep an agent's memory layer healthy instead of letting MEMORY.md rot.
What it does
- - scans
MEMORY.md + INLINECODE2 - detects duplicate / near-duplicate bullets
- extracts memory candidates from recent daily notes
- surfaces active follow-ups / TODOs
- filters obvious secrets from suggested memory output
- produces a concise maintenance report you can act on
Good use cases
- - "帮我整理 MEMORY.md"
- "检查记忆层有没有重复和过期信息"
- "把最近几天的重要内容沉淀到长期记忆"
- "做一次 agent memory audit"
- "维护长期记忆 / daily memory / notebook memory"
Commands
Run from the workspace root that contains MEMORY.md and memory/.
CODEBLOCK0
Recommended workflow
- 1. Run
report to see gaps, duplicates, and follow-ups. - Run
digest on the last 5-7 daily notes. - Promote only durable facts into
MEMORY.md. - Keep volatile chatter in daily notes.
- Never copy secrets into curated memory unless the user explicitly asks.
Output policy
- - Prefer
--format markdown for human review. - Prefer
--format json when another tool or script will consume the result. - The script intentionally redacts / skips likely secrets from digest suggestions.
References
Agent 记忆运维
当你需要保持智能体的记忆层健康,而不是让 MEMORY.md 腐烂时,请使用此技能。
功能说明
- - 扫描 MEMORY.md + memory/*.md
- 检测重复/近似重复的条目
- 从近期每日笔记中提取记忆候选
- 呈现活跃的待办事项/后续行动
- 从建议的记忆输出中过滤明显的机密信息
- 生成可供操作的简洁维护报告
适用场景
- - 帮我整理 MEMORY.md
- 检查记忆层有没有重复和过期信息
- 把最近几天的重要内容沉淀到长期记忆
- 做一次 agent memory audit
- 维护长期记忆 / daily memory / notebook memory
命令
在包含 MEMORY.md 和 memory/ 的工作区根目录下运行。
bash
python3 {baseDir}/scripts/memory_ops.py report --root .
python3 {baseDir}/scripts/memory_ops.py dedupe --root .
python3 {baseDir}/scripts/memory_ops.py digest --root . --days 7
python3 {baseDir}/scripts/memory_ops.py digest --root . --files 5 --format json
推荐工作流程
- 1. 运行 report 查看缺口、重复项和待办事项。
- 对最近 5-7 天的每日笔记运行 digest。
- 仅将持久性事实提升到 MEMORY.md。
- 将临时性讨论保留在每日笔记中。
- 除非用户明确要求,否则切勿将机密信息复制到整理后的记忆中。
输出策略
- - 人工审查时优先使用 --format markdown。
- 当其他工具或脚本需要消费结果时,优先使用 --format json。
- 脚本会主动从摘要建议中编辑/跳过可能的机密信息。
参考资料