智能体
dev.to ·
@Cogweald
摘要会漂移,事实不应漂移:Agent 长期记忆的分层设计
文章指出,摘要是对历史的压缩解释而非原始事实,经过多次摘要后细节可能改变、可能性会被写成确定性,形成长期 Agent 版的'传话游戏'。作者介绍 Cogweald 将长期记忆分为章节摘要与事实两层,事实携带重要性、创建章节和失效元数据,世界变化时显式失效旧事实而非静默覆盖,并称该模式可用于客服、编码和游戏 Agent。
AI推荐理由 文章指出长期 Agent 记忆中的摘要漂移问题:摘要经多次压缩后细节会变化,可能性被写成确定性,类似'传话游戏'。作者提出 Cogweald 将长期记忆分为章节摘要与事实两层,事实带重要性、创建章节和失效元数据,世界变化时显式失效而非静默覆盖,并列举客服、编码、游戏 Agent 的适用场景。属于具体的设计模式分享,但为单一项目自述,缺少评测证据。
60
正文
Summaries are useful for helping a model understand a long history quickly. But a summary is a compressed interpretation, not the original fact.
After an event is summarized seven times, details can slowly change. A character’s motivation shifts. The order of events changes. A possibility becomes a certainty. This is the long-term agent version of the telephone game.
Cogweald separates long-term memory into two layers:
Chapter summaries preserve narrative flow.
Story facts preserve important state that must remain consistent.
Facts carry importance, creation chapter, and invalidation metadata. When the world changes, an old fact is explicitly invalidated instead of being silently overwritten.
This pattern is useful far beyond stories:
A support agent can store approved customer terms as facts.
A coding agent can store the current migration strategy.
A game agent can store the abilities a player has unlocked.
A summary tells an agent what happened. A fact tells it what it must not casually change.