Skip to content
预计 1 分钟右侧目录可快速定位

Memory Maintenance ​

主路径与维护路径 ​

text
user-visible Turn settlement
        ↓
shouldRemember?
        ↓
runTurnMemory()
  ├─ runMemoryExtraction()
  └─ episode accumulation / summarizeEpisode()
Symbol作用失败是否应让 Turn 失败
runTurnMemory()组织本轮 memory maintenance否
runMemoryExtraction()gather → extract → apply否
gatherExtractionMemories()给 extraction 提供已有事实否
extractMemories()模型/规则提取候选记忆否
applyExtractedMemories()应用 extraction 结果否
summarizeEpisode()多 Turn 聚合 narrative否

两个错误隔离层 ​

runMemoryExtraction() 自己 catch extraction failure;runTurnMemory() 对 episode maintenance 也有独立 catch。源码直接把 memory maintenance 定义成 opportunistic path,而不是 turn settlement 的正确性前提。

这与 Durable State 的区别很重要:checkpoint 丢失可能影响恢复正确性;memory extraction 失败通常只降低未来质量。

本地定位 ​

bash
rg -n "runTurnMemory|runMemoryExtraction|gatherExtractionMemories|extractMemories|applyExtractedMemories|summarizeEpisode" source/host/runner/turn-memory.ts

固定源码 ​

关联知识文章 ​

AI Engineering · Agent · Harness · Backend Systems