Anthropic:智能体记忆的关键是懂得遗忘

Anthropic 测试了 Claude 如何跨会话将信息存储在笔记文件中,并在后续任务中检索这些信息。
测试表明,有选择地记录策略和规则比记录每一步效果更好,后者会用过时数据让模型不堪重负。
通过一个名为“Dreaming”的会话后流程,系统在空闲时段分析早前会话的记录,以自主修正有误的笔记并构建结构化的知识集合。
Anthropic 研究了 Claude 如何跨会话保留知识。其测试表明,有选择性的笔记优于详尽无遗的归档,而让 Claude 事后回顾自身记忆可以纠正错误。
任何与 AI 智能体在项目上合作数天的人,很快就会碰壁,因为每个新会话都从头开始。在一篇研究文章中,Anthropic 描述了 Claude 应如何在模型保持不变的情况下跨会话保留知识。Claude 会将笔记写入一个文件夹,之后可以读回。
据 Anthropic 称,核心问题在于选择。在它知道接下来会发生什么之前,智能体必须在当下决定哪些内容以后可能重要,因此每一条笔记都是对未来的押注。
一条关于 Pokémon Center 位置的错误笔记,导致 Claude 反复从一处边缘跌落。 | 图片:Anthropic
保存一切的智能体会失去头绪
在 Anthropic 一项以《宝可梦 红》(Pokémon Red)进行的测试中,较老的 Claude Sonnet 3.7 把所有信息都当作可能重要,在大约 10,000 个游戏步骤里,于 225 个文件夹中创建了 413 个文件,往往为它遇到的每一场战斗和每一件物品单独建一个文件夹。由于游戏状态不断变化,这些存档很快就过时了。有时该模型什么都不做,只是在重新整理笔记而不是继续玩游戏,最终只拿到一枚徽章。
较新的 Claude Fable 5 则把记忆限制在少数几个文件内,拿到了四枚徽章。Fable 5 不记录屏幕上已经可见的信息,而是写下计划、策略以及它验证过的规则。不过,Anthropic 的这项对比每个模型只覆盖了一次完整游玩过程。
Sonnet 3.7 在玩《宝可梦》时几乎保存了一切,而 Fable 5 只保存策略和验证过的规则,却走得更远。| 图片:Anthropic
Anthropic 建议向 Claude 说明记忆的用途,并让模型自行决定如何使用。据 Anthropic 称,在一项基准测试中,诸如“只记录错误”这类硬性指令抹掉了更强模型的大部分优势。相比之下,较老的模型则受益于明确的指令,比如被告知在每次回复前真正读一读自己的笔记。
具体的记忆规则对较老的模型有帮助,而更强的模型在僵硬的指令下表现更差。| 图片:Anthropic
Dreaming 旨在修正错误记忆
更大的风险来自智能体日后盲目信任的错误笔记。Dreaming 这一构想基于 Letta 和 UC Berkeley 的研究,正是为解决这一问题而设计。就像人脑在睡眠中处理经历一样,Claude 会在休息期间回顾早前会话的记录,并据此核对自己的笔记。
在“Dreaming”过程中,Claude 会在空闲时段处理旧的对话记录,并据此构建其记忆的上层结构。| 图片:Anthropic
在 Pokémon 测试中,Claude 错误地记录了某个地标位于山的哪一侧。由于依赖这条有误的笔记,Claude 三次落入同一个陷阱,最终想要放弃,未能达成目标。经过一次 Dreaming 处理后,Claude 将笔记与对话记录核对,发现了错误,并找到了正确的路径。
Claude 只有在借助 Dreaming 修正后的笔记后,才得以越过 Mt. Moon 抵达 Cerulean City。| 图片:Anthropic
据 Anthropic 介绍,Dreaming 还能整理更大的知识库。Claude 利用 Anthropic 收购的软件公司 Stainless 约 35 万份内部文档,构建了一个带链接的 wiki。Dreaming 的设想是在生成新页面的同时,修补内容缺口、重复内容和失效链接。当 Claude 能将 wiki 与搜索结合使用时,收益最大,因此 wiki 起到的是补充而非替代的作用。
Claude 在 Stainless 文档 wiki 上工作的时间越长,回答问题就越好,而将 wiki 与搜索结合时效果最佳。| 图片:Anthropic
在 Anthropic 的另一项法律领域测试中,对于答案分散在多个文档中的问题,wiki 的帮助最大。使用 wiki 时 Claude 的得分为 87%,而仅用搜索时为 73%。对于简单的查找任务,wiki 的表现与搜索大致相当,而且在一种情况下,它的体量甚至超过了源文档。
记忆能力仍在完善之中
Anthropic承认,一些关键问题仍悬而未决。在任务执行中途记录笔记会让智能体分心,Dreaming会消耗额外算力,而且其结果要延迟一段时间才会返回。维基和笔记也需要定期维护,否则错误和幻觉会不断堆积。Anthropic还警告说,不要自动把过多记忆加载到每一次会话中,因为它们会占用上下文,并把任何一条糟糕的笔记传递给未来的每一次会话。
所有这些测试都来自Anthropic。总体结论是,一个有用的智能体记忆,与其说取决于尽可能多地存储,不如说取决于保留正确的信息并在之后纠正错误。
Anthropic于5月推出Dreaming,作为Claude Managed Agents的研究预览版,后者是该公司面向AI智能体的云平台。该服务会读取现有记忆存储以及最多100次过往会话,删除重复和过时条目,并创建一个重新整理过的存储,同时保持原始存储不变。发布时,Dreaming仅支持Claude Opus 4.7和Sonnet 4.6。
OpenAI也把ChatGPT的记忆功能称为“Dreaming”,并在6月对其进行了全面改造。该系统在后台维护用户画像,并自动纠正过时信息。据OpenAI称,这将时间准确率从52.2%提升到了75.1%。
Google和Google DeepMind的研究人员也让AI智能体“做梦”,但他们用“做梦”来改进智能体的搜索策略。他们的智能体利用已经存储的结果来尝试替代解决方案,而无需再次调用模型。Google还构建了WikiSkill,一个面向智能体的维基。与Anthropic的系统一样,WikiSkill将原始记录、蒸馏后的知识和具体指令分层存放。
没有炒作的AI新闻——由人类精选
译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。
查看英文原文(Anthropic says the key to agent memory is knowing what to forget, not how much to store)
Anthropic tested how Claude can store information in note files across sessions and retrieve it for later tasks.
The tests showed that selectively recording strategies and rules works better than logging every step, which overwhelms models with outdated data.
Through a post-session process called "Dreaming," the system analyzes earlier session transcripts during idle periods to independently correct faulty notes and build structured knowledge collections.
Anthropic studied how Claude retains knowledge across sessions. Its tests show that selective notes outperform exhaustive archives and that having Claude review its own memories after the fact can correct errors.
Anyone who works with an AI agent on a project over several days hits a wall fast, because every new session starts from scratch. In a research post, Anthropic describes how Claude is supposed to retain knowledge across sessions while the model stays unchanged. Claude writes notes to a folder that it can read back later.
The core problem, according to Anthropic, is selection. Before it knows what comes next, the agent has to decide in the moment what might matter later, so every note is a bet on the future.
A wrong note about the Pokémon Center's location caused Claude to repeatedly fall back over a ledge. | Image: Anthropic
Agents that save everything lose track
In an Anthropic test with Pokémon Red, the older Claude Sonnet 3.7 treated everything as potentially important and, across roughly 10,000 game steps, created 413 files in 225 folders, often a separate one for each battle and item it found. Because the game state keeps changing, the archive goes stale fast. At times, the model did nothing but reorganize its notes instead of playing, and it finished with just a single badge.
The newer Claude Fable 5 limited its memory to a few files and earned four badges. Fable 5 didn't record information already visible on screen and instead wrote down plans, strategies, and rules it had tested. Anthropic's comparison, however, covers only a single playthrough per model.
Sonnet 3.7 saved nearly everything while playing Pokémon, whereas Fable 5 saved only strategies and verified rules and got much further. | Image: Anthropic
Anthropic recommends explaining the purpose of memory to Claude and letting the model decide how to use it. In one benchmark, according to Anthropic, rigid instructions such as "only record mistakes" wiped out most of the advantage for stronger models. Older models, by contrast, benefited from clear instructions, such as being told to actually read their notes before every response.
Specific memory rules help older models, while stronger models perform worse with rigid instructions. | Image: Anthropic
Dreaming aims to fix false memories
The bigger risk comes from faulty notes that the agent blindly trusts later. Dreaming, an idea that builds on research from Letta and UC Berkeley, is designed to address this. Much like the human brain processes experiences during sleep, Claude goes through transcripts of earlier sessions during a break and checks its notes against them.
During "Dreaming," Claude processes old transcripts in idle periods and builds the upper layers of its memory from them. | Image: Anthropic
In the Pokémon test, Claude had incorrectly noted which side of a mountain a landmark was on. Relying on that faulty note, Claude fell into the same trap three times, eventually wanted to give up, and missed its goal. After a Dreaming pass, Claude caught the error by checking the note against the transcript and found the right path.
Claude made it past Mt. Moon to Cerulean City only with the note Dreaming had corrected. | Image: Anthropic
According to Anthropic, Dreaming can also organize larger knowledge bases. Claude built a linked wiki from about 350,000 internal documents from Stainless, a software company Anthropic acquired. Dreaming is supposed to generate new pages while fixing gaps, duplicates, and broken links. The payoff was greatest when Claude could combine the wiki with search, so the wiki worked as a complement rather than a replacement.
The longer Claude worked on the wiki of Stainless documents, the better it answered questions, with the best results coming from combining the wiki with search. | Image: Anthropic
In a separate legal test by Anthropic, a wiki helped most with questions whose answers were spread across multiple documents. Claude scored 87 percent with the wiki, compared to 73 percent with search alone. For simple lookup tasks, the wiki performed roughly on par with search, and in one case it even grew larger than the source documents.
Memory is still a work in progress
Anthropic acknowledges that key questions remain open. Taking notes mid-task distracts the agent from its work, Dreaming costs extra compute, and its results arrive only after a delay. Wikis and notes also need regular upkeep, or errors and hallucinations pile up. Anthropic also warns against automatically loading too many memories into every session, because they eat up context and pass any bad note along to every future session.
All of these tests come from Anthropic. The overall takeaway is that a useful agent memory depends less on storing as much as possible than on keeping the right information and correcting mistakes later.
Anthropic introduced Dreaming in May as a research preview for Claude Managed Agents, the company's cloud platform for AI agents. The service reads an existing memory store and up to 100 past sessions, removes duplicate and outdated entries, and creates a reorganized store, leaving the original untouched. At launch, Dreaming supported only Claude Opus 4.7 and Sonnet 4.6.
OpenAI also calls ChatGPT's memory, which it overhauled in June, "Dreaming." That system maintains a user profile in the background and automatically corrects outdated information. According to OpenAI, this raised temporal accuracy from 52.2 to 75.1 percent.
Researchers at Google and Google DeepMind also let AI agents dream, but they use dreaming to improve an agent's search strategy. Their agent works through alternative solutions using results it has already stored, without calling the model again. Google has also built WikiSkill, a wiki for agents. As in Anthropic's system, WikiSkill keeps raw transcripts, distilled knowledge, and specific instructions in separate layers.
AI News Without the Hype – Curated by Humans
原文为英文,正文由自动抓取并保留原文。
原文发布于 The Decoder(Anthropic says the key to agent memory is knowing what to forget, not how much to store),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。