Skip to content

docs: cross-session memory design (P1-4) — kernel-first ownership split + research archive - #45

Draft
Tyan66666 wants to merge 3 commits into
mainfrom
docs/cross-session-memory-design
Draft

docs: cross-session memory design (P1-4) — kernel-first ownership split + research archive#45
Tyan66666 wants to merge 3 commits into
mainfrom
docs/cross-session-memory-design

Conversation

@Tyan66666

Copy link
Copy Markdown
Owner

跨会话长期记忆设计文档(P1-4)

模型驱动长期记忆的完整设计稿 + 三轮调研原始资料归档。

设计要点

  • 写入:nudge 时机 → memory_commit(type, note) 表态(纯意图表达)→ 引擎一次性 LLM 调用提取 → 写人类可读 markdown 记忆库(带 citation)→ 主对话继续压缩
  • 存储:markdown 目录(人可读可编辑 = 外部纠错通道)+ Ebbinghaus 保质期 + upsert 覆盖
  • 读回:延迟读回,两个时机——常驻索引(每次 turn)+ 自主取回(memory_recall 取全文);Claude Code 生产实践背书(源码核实)
  • 选择/衰减score = importance + min(days/30,5) + uniform(0,.5)——打破富者愈富,与保质期同一套字段
  • 用户侧:仅 /acp memory list;导入导出 = 自然语言,模型自主

Kernel 归属划分(核心决策)

算法进 kernel、集成留宿主,先改 kernel 再改宿主(§6A):

  • A 类进 acp-kernel(本次提 upstream):score 选择机制、Ebbinghaus 衰减、记忆条目数据模型(= tier-3 蒸馏块)、memory_recall 检索扩展、nudge 记忆提示文案
  • B 类留宿主:工具注册、一次性 LLM 调用、markdown 存储 + citation、索引注入、/acp memory list、时机接线
  • 实施顺序:Phase K(kernel 先行,upstream issue + PR)→ Phase H(宿主 bump kernel 后实现 B 类,全调 kernel API)

调研归档(docs/memory-research/)

文件 内容
01-autonomous-memory-papers.md 论文向 17 篇(触发六分类/Ebbinghaus/检索共识)
02-autonomous-memory-implementations.md 实现向 8 产品(5 工程模式)
03-memory-readback-timing.md 读回时机 25 源(四模式谱系)
04-claude-code-source-verification.md Claude Code 记忆机制源码核实

待定项(文档顶部标注,实现前补齐)

  1. memory_commit negative constraints 措辞
  2. 工具返回话术
  3. 索引条目精确 schema

纯文档 PR,无代码变更,不影响现有 152 tests。

…it + research archive

- docs/cross-session-memory-design.md: full design draft — write (memory_commit at nudge
  time → one-shot LLM extraction) / store (human-readable markdown memory bank with
  Ebbinghaus expiry) / readback (resident index + memory_recall, two-timing, delayed
  readback per Claude Code practice); §6A kernel ownership split (algorithms upstream to
  acp-kernel, host keeps DSH integration), Phase K → Phase H implementation order
- docs/memory-research/: 4 archived research docs — 17 papers (autonomous-memory-papers),
  8 products (autonomous-memory-implementations), readback timing 25 sources
  (memory-readback-timing), Claude Code source verification (claude-code-source-verification)
- docs/README.md: index table row for the new design doc
- 3 pending items marked at doc top (negative-constraints wording / tool return copy / index schema)
@Tyan66666
Tyan66666 marked this pull request as draft August 20, 2026 15:21
…nudge-gated fork), three-tool permission split (memory_write fork-only)

- §3 rewritten: path A (tier-1 block → memory candidate, zero overhead) + path B
  (memory_commit → fork extraction); three-tool table — memory_commit (main dialog,
  intent only), memory_recall (main dialog, read), memory_write (fork session ONLY,
  main dialog has no write permission)
- fork instruction uses {note} as the focus prompt
- §6A kernel/host split updated: three-tool interface semantics → kernel, tool
  registration + fork implementation + memory_write persistence → host
- 05-upstream-proposal.md: same dual-path + three-tool structure for the kernel author
…model-decided (nudge + fork only)

Path A (engine auto-archiving compressed blocks into the memory bank) was added
without user approval and violates decision 3 (no automatic policy). Removed from
both the design doc §3 and the upstream proposal; the core insight stays (tier-1
blocks are natural long-term memory candidates) but as background framing only —
sedimentation is always a model decision, never an engine side-effect.
@ranxianglei

Copy link
Copy Markdown
Contributor

我来协助看一下这个问题,请分析并回复处理结果。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants