Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ It complements platform memory; it does not replace it, import your old chats, o

- **Loads baseline context** — `load memory` reads your core files and index, not every project file.
- **Saves with review** — the AI proposes the content and destination; you approve before it writes.
- **Coordinates wrap-up updates** — one request lets the agent decide which project-context layers actually need changes.
- **Loads details on demand** — relevant project or note files are read only when the topic needs them.
- **Uses optional Summary-first loading** — for an active file with a reviewed `## Summary`, the agent reads the short summary first and opens the full file only when the request needs more detail. Files without a summary keep the existing behavior.
- **Manages lifecycle safely** — archive, trash, recovery, and memory health are confirmation-based.
Expand Down Expand Up @@ -77,7 +78,7 @@ If an agent cannot discover Skills automatically, add an equivalent instruction
|---|---|
| `load memory` | Loads baseline context: core files and the active index. |
| `remember this` / `save this` | Proposes a reviewed memory update. |
| `update memory` | Separates proposed facts and inferred patterns for approval. |
| `update memory` / `update project context` / `wrap this up` | Coordinates the necessary project-context changes behind one preview and confirmation. |
| `memory status` | Lists active memory structure and summaries. |
| `memory upgrade` | Previews and, after confirmation, creates missing lifecycle folders for an older memory root. |
| `archive <relative-path>` | Moves a completed low-frequency active file to archive after confirmation. |
Expand All @@ -89,7 +90,13 @@ If an agent cannot discover Skills automatically, add an equivalent instruction

For active projects, Persistent Memory distinguishes stable memory, one current-status source, source materials, and route-only indexes.

`update memory` updates reviewed stable memory. It does not automatically synchronize project status, source materials, or every index. When a request contains several kinds of change, the agent separates them, previews each destination, and waits for explicit user confirmation before writing.
`update memory` is a coordinated project-context update by default. The agent decides internally whether confirmed changes belong to stable memory, the canonical current-status source, material pointers, or a route-only index. It skips transient discussion, duplicates, unsupported inference, rejected options, obsolete facts, and layers with no necessary change.

The agent shows one consolidated preview with exact destinations and requests one confirmation for the complete non-destructive write set. Use `only update stable memory`, `only update status`, or `only register materials` when you want to restrict the scope explicitly.

If nothing remains after filtering, the agent reports that no update is needed and requests no confirmation.

This coordination does not run in the background. It uses the current conversation and declared relevant sources; it does not scan every workspace, poll live systems, bulk-migrate files, or write without confirmation.

Before claiming that a project is current or fully loaded, the agent checks the declared status source and any required live or first-party source.

Expand All @@ -105,11 +112,11 @@ Keep raw repositories, downloads, media files, and datasets in their original pr

## Privacy

All memory is stored as local Markdown files. Do not put passwords, API keys, or secrets in it. The v0.8 lifecycle and summary rules protect core files and require explicit confirmation before filesystem changes.
All memory is stored as local Markdown files. Do not put passwords, API keys, or secrets in it. Lifecycle, summary, and coordinated-update rules protect core files and require explicit confirmation before filesystem changes.

## Release Status

v0.8.1 is a reliability patch that clarifies the boundary between memory and project context. It does not add project-wide synchronization, background scanning or polling, automatic migration, or bulk migration.
v0.9.0 adds one-request coordinated project-context updates. It preserves v0.8.1 ownership and freshness safeguards and does not add background synchronization, scanning or polling, automatic migration, or bulk migration.

## License

Expand Down
15 changes: 11 additions & 4 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Claude 不会自动知道你告诉 Codex 的内容,Codex 也不会自动知道

- **加载基础上下文**:`加载记忆` 只读取核心文件和索引,不会读取所有项目文件。
- **经审核后保存**:AI 先提议内容和位置,用户确认后才写入。
- **协调收尾更新**:用户只需提出一次请求,agent 自行判断哪些项目上下文层确实需要修改。
- **按需读取细节**:只有当前话题需要时,才读取相关项目或笔记。
- **可选摘要优先加载**:活跃文件含有经审核的 `## 摘要` 时,agent 先读短摘要;只有问题需要更多细节才读取全文。没有摘要的文件保持原有行为。
- **安全管理生命周期**:归档、回收站、恢复和体检都需要确认。
Expand Down Expand Up @@ -77,7 +78,7 @@ Claude 不会自动知道你告诉 Codex 的内容,Codex 也不会自动知道
|---|---|
| `加载记忆` | 加载基础上下文:核心文件和活跃索引。 |
| `记住这个` / `save this` | 提议一项经审核的记忆更新。 |
| `更新记忆` | 将建议保存的事实与推断模式分开,等待确认。 |
| `更新记忆` / `更新项目上下文` / `帮我收尾` | 在一次预览和确认背后协调必要的项目上下文改动。 |
| `记忆状态` | 显示活跃记忆结构和摘要。 |
| `升级记忆` | 预览旧记忆目录缺少的生命周期结构;确认后创建。 |
| `归档 <相对路径>` | 确认后将完成且低频的活跃文件移至归档。 |
Expand All @@ -89,7 +90,13 @@ Claude 不会自动知道你告诉 Codex 的内容,Codex 也不会自动知道

对于活跃项目,Persistent Memory 区分稳定记忆、唯一当前状态源、来源材料和只负责路由的索引。

`更新记忆` 只更新经过确认的稳定记忆,不会自动同步项目状态、来源材料或所有索引。当一次请求包含多类变化时,AI 会先分类并展示每个目标位置,等待用户明确确认后才写入。
`更新记忆` 默认表示一次协调式项目上下文更新。Agent 在内部判断已确认的变化应进入稳定记忆、唯一当前状态源、材料指针还是只负责路由的索引,并跳过临时讨论、重复内容、无证据推断、已否决方案、过时事实和无需修改的层。

Agent 只展示一次合并预览,列出准确目标,并针对完整的非破坏性写入集合请求一次确认。需要主动限制范围时,可以说“只更新稳定记忆”“只更新状态”或“只登记材料”。

如果过滤后没有内容需要修改,Agent 会直接说明无需更新,不请求确认。

这种协调不会在后台运行,只使用本轮对话和已声明的相关来源;不会扫描所有工作区、轮询实时系统、批量迁移文件或未经确认直接写入。

在声称项目状态是当前或已经完整加载前,AI 必须检查声明的状态源,以及任何所需的实时或一手来源。

Expand All @@ -105,11 +112,11 @@ Claude 不会自动知道你告诉 Codex 的内容,Codex 也不会自动知道

## 隐私

所有记忆都保存在本地 Markdown 文件中。请勿放入密码、API key 或其他密钥。v0.8 的生命周期与摘要规则会保护核心文件,并要求所有文件系统改动获得用户明确确认。
所有记忆都保存在本地 Markdown 文件中。请勿放入密码、API key 或其他密钥。生命周期、摘要和协调更新规则会保护核心文件,并要求所有文件系统改动获得用户明确确认。

## 版本状态

v0.8.1 是一项可靠性补丁,明确记忆与项目上下文之间的边界;不包含项目范围同步、后台扫描或轮询、自动迁移或批量迁移。
v0.9.0 新增一次请求完成协调式项目上下文更新;保留 v0.8.1 的所有权和新鲜度保护,不包含后台同步、扫描或轮询、自动迁移或批量迁移。

## 许可

Expand Down
28 changes: 18 additions & 10 deletions SKILL.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: persistent-memory
description: Use when a user wants cross-session personal context shared by compatible AI agents, or asks to load, save, inspect, archive, recover, clean up, or upgrade local memory files.
description: Use when a user wants cross-session personal context shared by compatible AI agents; asks to load, save, inspect, archive, recover, clean up, or upgrade local memory files; or asks to wrap up work and update relevant project context.
---

# Persistent Memory System

Persistent Memory is a transparent local context layer. It stores reviewed user context as Markdown files so compatible agents can read the same source of truth.

**v0.8.1:** This reliability patch defines project context ownership and freshness checks for current-state claims. It does not add automatic synchronization, directory migration, or live-source polling.
**v0.9.0:** This release coordinates project-context updates behind one user request while preserving explicit confirmation, one-fact/one-owner boundaries, and freshness checks. It does not add background synchronization, directory migration, or live-source polling.

## Runtime Contract

Expand Down Expand Up @@ -95,7 +95,7 @@ For an active on-demand file selected through `_index.md`:

## Saving

Trigger: `remember this`, `记住这个`, `save this`, `更新记忆`, `update memory`, `update my profile`, or `add to notes`.
Trigger: `remember this`, `记住这个`, `save this`, `更新记忆`, `update memory`, `update project context`, `wrap this up`, `update what needs updating`, `update my profile`, or `add to notes`.

1. Read the target file first if it already exists.
2. Propose the exact content, destination, and index change.
Expand All @@ -104,16 +104,22 @@ Trigger: `remember this`, `记住这个`, `save this`, `更新记忆`, `update m

When a confirmed update to an active on-demand file changes a fact represented in its `## Summary` / `## 摘要`, include the exact summary revision in the same preview and obtain the same explicit user confirmation before writing. Do not automatically create a Summary for an existing file and do not bulk-migrate memory files.

For a vague update request, list explicit facts and inferred patterns separately, then wait for the user to approve individual items.
### Coordinated Project Context Update

“Update memory” changes stable memory only. It does not automatically synchronize project status, source materials, or every routing file.
Treat broad requests such as “update memory,” “update project context,” “wrap this up,” or “update what needs updating” as one coordinated project-context update. Do not require the user to choose among stable memory, current status, materials, or index.

When a request mixes project progress, new materials, durable decisions, and routing changes:
Inspect the current conversation and declared relevant sources. This workflow does not add background scanning, live polling, bulk migration, destructive lifecycle actions, or unconfirmed writes.

1. Classify the proposed changes as stable memory, current status, materials, or index.
2. Identify the canonical owner for each fact.
3. Show the user the exact per-layer preview.
4. Wait for confirmation before writing.
1. Collect candidate changes from confirmed conversation facts and the declared sources needed for the active topic.
2. Classify the proposed changes as stable memory, current status, materials, or index.
3. Identify the canonical owner for each fact.
4. Route confirmed phase, task, blocker, owner, and next-action changes to the single current-status source. Route durable reviewed decisions, constraints, results, and learned boundaries to stable memory. Register first-party artifacts as material pointers instead of copying raw artifacts into memory. Change the index only when routing changes.
5. Skip transient discussion, duplicates, unsupported inferences, rejected options, obsolete facts, and layers with no necessary change.
If no candidate remains after filtering, report that no update is needed and do not request confirmation.
6. Show one consolidated preview containing only the layers that need changes, with the exact destination and content for each change. Include concise skip reasons only when omission could surprise the user.
7. Request one confirmation for the complete non-destructive write set, then apply only the confirmed changes and verify cross-file consistency.

Ask a targeted question only when facts conflict, ownership is ambiguous, or a new source's authority cannot be determined. Keep explicit scope overrides available: “Only update stable memory,” “only update status,” and “only register materials.”

Do not create duplicate current-status sources or copy volatile facts into `_index.md`.

Expand Down Expand Up @@ -227,3 +233,5 @@ Read `_core/` and `_index.md`, then report active file count, approximate size,
8. Keep one canonical current-status source per active project.
9. Keep indexes route-only; do not duplicate volatile project facts in them.
10. Apply the Freshness Gate before making current-state claims.
11. Treat broad update intent as one coordinated project-context update; do not make the user choose the internal storage layer.
12. Bundle non-destructive context changes into one preview and one confirmation.
28 changes: 18 additions & 10 deletions SKILL_zh.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: persistent-memory
description: Use when 用户需要让兼容 AI agent 共享跨对话个人上下文,或要求加载、保存、查看、归档、恢复、体检或升级本地记忆文件。
description: Use when 用户需要让兼容 AI agent 共享跨对话个人上下文,要求加载、保存、查看、归档、恢复、体检或升级本地记忆文件,或要求在工作结束时收尾并更新相关项目上下文
---

# 持久化记忆系统

Persistent Memory 是透明的本地上下文层:它把经用户确认的上下文保存为 Markdown,让兼容 agent 读取同一份事实源。

**v0.8.1:** 此可靠性补丁定义了项目上下文的所有权和当前状态声明的新鲜度检查;不包含自动同步、目录迁移或实时来源轮询。
**v0.9.0:** 此版本在一次用户请求后协调项目上下文更新,同时保留明确确认、一个事实一个所有者和新鲜度检查;不包含后台同步、目录迁移或实时来源轮询。

## 运行契约

Expand Down Expand Up @@ -95,7 +95,7 @@ Persistent Memory 是透明的本地上下文层:它把经用户确认的上

## 保存

触发词:`remember this`、`记住这个`、`save this`、`更新记忆`、`update memory`、`update my profile`、`add to notes`。
触发词:`remember this`、`记住这个`、`save this`、`更新记忆`、`更新项目上下文`、`帮我收尾`、`把该更新的处理好`、`update memory`、`update my profile`、`add to notes`。

1. 目标文件已存在时,先读取。
2. 提议准确内容、保存位置和索引改动。
Expand All @@ -104,16 +104,22 @@ Persistent Memory 是透明的本地上下文层:它把经用户确认的上

如果一次已确认的更新改变了活跃按需文件 `## Summary` / `## 摘要` 中已经表达的事实,必须在同一次预览里提出准确的摘要修订,并在同一次用户明确确认后才写入。不得自动创建已有文件的摘要,也不得批量迁移记忆文件。

如果用户只说“更新记忆”,要把显性事实和推断出的模式分开列出,再等待逐项确认。
### 协调式项目上下文更新

“更新记忆”只修改稳定记忆,不会自动同步项目状态、来源材料或全部路由文件
“更新记忆”“更新项目上下文”“帮我收尾”或“把该更新的处理好”等宽泛请求视为一次协调式项目上下文更新。不得要求用户先在稳定记忆、当前状态、材料和索引之间做选择

当请求同时包含项目进展、新材料、长期决策和路由变化时:
检查本轮对话和已声明的相关来源。本流程不会引入后台扫描、实时轮询、批量迁移、破坏性生命周期操作或未经确认的写入。

1. 将拟修改内容分类为稳定记忆、当前状态、材料或索引。
2. 为每项事实确定唯一所有者。
3. 展示按层拆分的精确预览。
4. 等待用户确认后再写入。
1. 从本轮对话中已确认的事实,以及当前话题所需的已声明来源中收集候选变化。
2. 将拟修改内容分类为稳定记忆、当前状态、材料或索引。
3. 为每项事实确定唯一所有者。
4. 将已确认的阶段、任务、阻塞、负责人和下一步变化写入唯一当前状态源;将持久且经过审阅的决策、约束、结果和经验边界写入稳定记忆;材料只登记一手文件的路径和作用,不把原始材料复制进记忆;只有路由发生变化时才修改索引。
5. 跳过临时讨论、重复内容、无证据推断、已否决方案、过时事实和无需修改的层。
如果过滤后没有候选变化,说明无需更新,不请求确认。
6. 只展示一份合并预览,仅包含需要修改的层,并列出每项修改的准确目标和内容。只有在省略某项可能让用户意外时,才简要说明跳过原因。
7. 针对完整的非破坏性写入集合只请求一次确认;确认后只执行获批改动,并核验跨文件一致性。

只有在事实冲突、所有权不明确或无法判断新来源的权威性时,才提出一个针对性问题。保留精确范围指令:“只更新稳定记忆”“只更新状态”和“只登记材料”。

不得创建重复的当前状态源,也不得把易变事实复制进 `_index.md`。

Expand Down Expand Up @@ -227,3 +233,5 @@ Persistent Memory 是透明的本地上下文层:它把经用户确认的上
8. 每个活跃项目只保留一个权威当前状态源。
9. 索引只负责路由,不复制高频变化的项目事实。
10. 声称当前状态前必须执行新鲜度闸门。
11. 将宽泛更新意图视为一次协调式项目上下文更新,不让用户选择内部存储层。
12. 将非破坏性上下文改动合并为一次预览和一次确认。
Loading
Loading