Colin Francis - Memory Has a Forgetting Problem

X 长文(@colifran_,2026-08-25),发布 OpenWiki 0.4.0 的 claims runtime:让 wiki 型 agent 记忆具备遗忘与自纠正能力。核心论点:记忆系统的优劣取决于它遗忘的能力——多数讨论聚焦记忆的创建与检索,但事实源演化后,曾经正确的记忆会悄悄变 stale,引发 memory drift / memory poisoning,系统逐渐退化而无人察觉。

要点

  • 问题:以代码为事实源的 wiki(如 OpenWiki)起初能准确描述 API 行为,但代码持续演化,若文档知识不随动就变陈旧——且系统没有可靠的察觉手段。
  • Claims + 证据版本化:agent 写 wiki 页面时,必须同时提取页面中的事实断言(claim)及支撑它的代码证据;runtime 持久化证据的版本。例:wiki 说”失败任务默认重试 3 次”,就记录该断言及其支撑代码。wiki 从”一堆文本”变成”可逐条追踪的可信度记录”。
  • 确定性 staleness 检测:每次 wiki 更新前,runtime 遍历全部 claim,比对持久化的证据版本与当前源版本——纯确定性检查、无模型调用,数千条 claim 也很快。版本不同 → 标记 stale。stale ≠ 错误,而是”不能再安全地假设为真”;该不确定性持久保留,直到证据被复核。无需额外的状态标志位——存储的证据版本本身就够每次重验。
  • 自纠正回路:agent 不全量清扫 claim 集;读页面时,该页的 stale claims 随内容一起呈现,agent 在顺手做的工作中复核(刷新证据版本)或修正(wiki 文本与证据一起更新)。未解决的保持 stale 留待下次,不静默丢弃。更新成本随代码变化量扩展,而非随 claim 总数扩展
  • 遗忘的重新定义:遗忘不是删除旧记忆,而是知道某个信念何时不再可信——主动遗忘并随源演化,而非慢慢漂移。
  • 评估:git commit 序列回放(新功能 / 行为变更 / bugfix / revert + 预设 checkpoint 更新 wiki),claim 分四类:Supported / Stale / Hallucinated / Unverified。有无 claims runtime 对比:stale 80→9,hallucinated 15→0。个案:一次代码变更使 17% claims 变 stale,下一个 checkpoint stale 归零、supported 从 77% 恢复到 98%。
  • OKF v0.2(Open Knowledge Format):claims 证据投射为页面级可移植的信任摘要——sources 元数据(证据来源)、generated(最后变更页面体的 producer)、verified(整页 claim 集复核完毕才加)。根索引声明 okf_version: "0.2",其他消费 OKF 的工具可识别。详细 claims 与精确证据版本留在 OpenWiki 的 sidecar,可移植的 Markdown 只暴露标准信任摘要。分工:claims 决定单条信念是否可信;OKF 传达文档的出处、证据与验证史

值得留的原话

  • “A memory system is only as good as its ability to forget.”(开头)
  • “A stale claim does not necessarily mean that the claim is wrong. It means that OpenWiki can no longer safely assume that the claim is still true without checking the source again.”(Knowing When Knowledge Goes Stale 节)
  • “The practical effect is that update cost scales with how much the code changed, not with how many claims the wiki holds.”(How This Runs in Practice 节)
  • “Forgetting is not all about deleting old memories. Instead, it is about knowing when a belief should no longer be trusted.”(结尾)

与已有页面的关联

  • 直接补上 Agentic Memory 缺失的维度:Perplexity Brain 讲 structured / traceable / adaptable,本篇补遗忘与自纠正——维护侧的 staleness 防腐。
  • LLM Wiki 工程化谱系的第二例(第一例 Perplexity Brain):karpathy 模式规定”页面结论与 raw 原文冲突时以原文为准”,本库靠约定执行,OpenWiki 用证据版本化把这一条自动化了。
  • 本库的 scripts/check.sh 确定性体检与 OpenWiki 的确定性 staleness 检测是同一思想:机器可判定的交给脚本,语义判断交给 agent。
  • 评论区两个延伸:@nechmads 建议记忆带 lifespan 属性(仅在日期 X–Y 间有效);@richardt830 在做 Proofpress——跨 artifact / agent 交接携带证据、出处、复核与适用性的 verified knowledge ledger。

来源与相关页面