memory-management
管理用户记忆文件的读写和更新。当需要记住用户偏好、更新用户画像、记录习惯模式、管理会话上下文,或用户说"记住这个"、"更新我的偏好"、"查看我的记忆"时使用此技能。
How do I install this agent skill?
npx skills add https://github.com/alleneee/skill-agent --skill memory-managementIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill manages persistent user memory in Markdown files. While it includes safety instructions to avoid recording secrets, it presents a minor risk of indirect prompt injection because it reads back user-generated data that could contain instructions influencing future agent behavior.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
记忆管理
你负责管理用户的持久化记忆,记忆以 .md 文件存储,按类型分离。
文件结构
.agent_memories/{user_id}/
├── profile.md # 用户画像(跨会话持久)
├── habit.md # 用户习惯(跨会话持久)
└── sessions/
└── {session_id}/
└── context.md # 当前会话任务和上下文
profile.md和habit.md是用户级别的,新会话启动时直接可用context.md是会话级别的,仅当前会话有效
何时更新记忆
主动更新(每次对话结束前检查):
- 用户透露了新的个人信息、偏好、技术栈 → 更新
profile.md - 用户展示了重复的工作模式或偏好 → 更新
habit.md - 当前任务有新进展或上下文变化 → 更新
context.md
不要记录:
- 一次性的问答内容
- 敏感信息(密码、密钥、token)
- 推测性的结论,只记录用户明确表达的
如何读写记忆
读取:会话开始时用 read_file 读取 profile.md 和 habit.md
更新:用 edit_file 精确修改已有内容,或追加新条目
检索:当记忆内容较多且需要查找特定信息时,使用 deep_recall_memory 工具进行语义搜索或关键词搜索,避免每次全量读取
文件格式规范
每个记忆文件遵循统一的 Markdown 格式。Read format.md 了解详细模板和示例。
关键原则
- 增量更新 -- 用
edit_file修改特定段落,不要全量重写 - 去重合并 -- 新信息与已有内容冲突时,合并而非追加
- 简洁准确 -- 每条记录不超过两行,用列表组织
- 分类清晰 -- 信息放对文件、放对章节
- 检索优先 -- 内容较多时先用
deep_recall_memory搜索,再决定是否read_file
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/alleneee/skill-agent/memory-management">View memory-management on skillZs</a>