ai-memory-durable-pages
它能做什么
该技能管理记忆知识库中的持久页面,智能体之后可以读取这些页面。适合希望把某些项目知识长期保留下来的人。
适用场景
- ✓当你明确要求智能体永久记住某件事的时候。
- ✓当你希望把某条规则、注释或项目笔记保存到记忆知识库中的时候。
- ✓当你希望更新或删除某个已有记忆页面的时候。
技能链接
https://github.com/akitaonrails/ai-memory/blob/main/crates/ai-memory-core/src/routing_skills/ai-memory-durable-pages/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请永久记住:我们的预发布数据库每周日晚上会重置。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会写一个简洁的页面,包含标题;或者修补已有页面中指定的章节;或者通过路径删除一个页面。日常的会话活动不会以这种方式保存。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
ai-memory durable pages
Use this skill only for deliberate durable wiki mutations. Routine session capture is automatic, and permanent notes require an explicit user request.
Tools in this cluster
memory_write_pagewrites or replaces a durable wiki page for permanent project knowledge.memory_patch_pageatomically changes named Markdown sections in an existing page without re-emitting its frontmatter or unrelated body.memory_delete_pageremoves a durable wiki page by exact path.memory_restore_pagelists a page's checkpoints (norev) or writes an earlier version back (withrev), including a deleted page. It is admin only on a multi-user server and does not reachscope: "profile"pages.
Writing durable memory
Write a page only when the user explicitly asks to remember something permanently, save a note, add an annotation, or record project knowledge. Do not use durable pages for transient progress, normal status updates, or next-session context.
Put the page title as a # H1 on the first line of the body and omit the separate title argument. ai-memory derives the title from that H1. Keep the content concise and fact-like, with enough context that a future agent can apply it without rereading the whole session.
Optional top-level metadata: kind (64 characters), entities (10 names,
64 characters each, normalized and deduplicated), abstract (1,024 characters),
and relations (an object mapping causes, fixes, or contradicts to page
target arrays, 32 targets total, 1,024 characters each). Relation targets use
path, project:path, or workspace/project:path; extensionless page paths
resolve with .md, and scope components must already be trimmed. Limits apply
to raw values before trimming, normalization or deduplication. Arbitrary
frontmatter and author fields are not editable.
Every memory_write_page call replaces the whole page and its metadata;
omitted fields are cleared. Read the current page first when preserving
existing content matters, and pass its returned page_id as
expected_page_id so a concurrent change fails without writing. Use
create_only: true when the page must not already exist; do not combine the
two preconditions.
For a targeted edit, prefer memory_patch_page: read the page, pass its
required page_id as expected_page_id, and submit one bounded batch.
append_to_section and add_section use heading anchors from the read
response; replace_section must also carry that section's returned sha256.
All edits resolve against the same captured body and either commit together or
write nothing. Missing, duplicate, stale, or conflicting anchors fail closed.
Use memory_write_page when replacing the whole document.
When the user explicitly wants a note to be temporary, pass expires_at as an
RFC3339 instant or a bare YYYY-MM-DD (the end of that day in UTC). After the
TTL, normal search, recent, and briefing reads hide the page; the next forget
sweep deletes it. A TTL outranks pinned, so do not combine them unless the user
has deliberately requested that behavior.
Writing a session's pages yourself
When the user asks to consolidate the session you are taking part in, write its pages with your own model instead of the server's: read the session's raw observations first (the retrieval skill covers that read), then write each page with memory_write_page passing the same session_id, which records the session as evidence and settles its queued consolidation job. Match the server's multi-page layout, at most five pages:
sessions/<session_id>.md: the session narrative,tier: "episodic",kind: "fact".concepts/<slug>.md: evergreen concept pages,tier: "semantic",kind: "fact".decisions/<short>.md: ADR-style records of a choice made,tier: "semantic",kind: "decision".gotchas/<slug>.md: failure modes and surprises,tier: "semantic",kind: "gotcha"._rules/<slug>.md: a durable project convention written as a standalone instruction,tier: "semantic",kind: "rule".
Only split out what the session actually established; a short session is one session page. Record what was said and done, and never turn a user's question into a confirmed decision.
Project rules belong in instructions first
If the user asks to create a durable project rule such as always do X or never do Y, update the project's canonical agent instruction file when the repository
常见问题
它会保存我聊天中的所有内容吗?
不会。只有在你明确要求时,它才会写入持久页面,并会跳过临时的进度信息。
它能恢复旧版本吗?
能。它可以列出某个页面的早期版本,并把其中一个写回,包括已删除的页面。
页面需要单独的标题吗?
不需要。标题取自页面正文中的第一个标题。
详情
作者的原始描述
Use this skill for any explicit wiki mutation in ai-memory: saving durable or time-bounded project knowledge, recording a rule or annotation, updating a note, or deleting a memory page. Trigger by semantic intent rather than exact wording; routine session capture is not a durable-page request.
repo: akitaonrails/ai-memory
热度
- GitHub 星标
- 15k
- 排名
- #11037
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
ai-memory-handoff
15k帮你的智能体把上下文传递给下一次会话,让你可以从上次停下的地方继续、保存收尾笔记,或取消一次误发的交接。
ai-memory-learning-maintenance
15k帮你的智能体整理记忆知识库:把会话笔记转化为主题页面,检查矛盾之处,并在你要求时清理过时的条目。
ai-memory-messaging
15k帮你的智能体向另一个项目的收件箱发送一条自成一体的请求,检查你项目的收件箱,或取消你已发送的消息。
ai-memory-retrieval
15k帮你的智能体在项目的记忆知识库中搜索过去的决定、规则和陷阱,并阅读完整页面,同时不改动任何内容。