返回列表
🧠 阿头学 · 💬 讨论题

AI Agent 长期记忆的“做梦”整理机制

Agent 长期记忆退化的根本解法并非盲目扩容上下文窗口,而是引入脱离热路径的后台数据整理机制,但该概念目前已被 Mem0 等厂商过度包装为营销话术。
打开原文 ↗

2026-08-07 原文链接 ↗
阅读简报
双语对照
完整翻译
原文
讨论归档

核心观点

  • 热路径写入必然导致记忆腐化:实时提取器受限于局部上下文窗口,无法感知全局存储状态,必然产生重复与矛盾数据,这是架构缺陷而非算法瓶颈。
  • 后台整理是工程必然而非生物学奇迹:Dreaming 本质是数据库 Compaction 机制在语义层的移植,通过合并、取代与综合操作恢复检索信噪比,其有效性已被基础设施领域反复验证。
  • 存储层方案优于权重层重训练:在现有 LLM 服务范式下,直接重写记忆记录比微调模型更符合多租户与低延迟的生产要求,这一技术选型具备扎实的工程合理性。
  • “绝不销毁”策略存在隐性成本:Mem0 采用软删除与版本链保留历史,虽满足审计需求,但将存储膨胀与索引维护成本转嫁给底层,长期经济性存疑。

跟我们的关联

  • 对 Neta 意味着记忆模块的竞争维度已从“容量大小”转向“治理频率”,下一步应在架构设计中强制剥离热路径写入与冷路径整理,采用 MSS 协议重构知识库。
  • 对 ATou 意味着需警惕厂商用“生物学隐喻”掩盖传统数据治理本质,下一步在选型时应要求供应商提供后台整理的误判率与物理存储成本,而非仅看召回率指标。
  • 对 Uota 意味着用户标签与 SOP 系统同样面临“只写不整”的熵增陷阱,下一步可借鉴 Supersede 机制建立带时间戳的标签版本链,定期清理失效规则以维持推送精准度。

讨论引子

  • 当事实发生更迭时,彻底重写(OpenAI 路线)与保留历史痕迹(Mem0 路线)哪种架构在长期运行中更能平衡召回准确率与存储成本?
  • 语义级“综合”操作极易引入模型幻觉,如何设定自动化整理的置信度阈值,才能避免后台进程制造比原始数据更难排查的“合成噪音”?
  • 如果“做梦”本质是传统数据库压缩的语义化包装,AI 团队是否应直接引入成熟的数据仓库分层治理方案,而非重复造轮子?

长期运行的 Agent 随着时间推移,记忆事实的能力会显著下降。

随着对话过程中上下文窗口(Context Window)被填满,尤其是在跨越长期任务时,Agent 会不断提取事实并将其写入记忆存储(Memory Store),却从未有任何机制清理该存储。

几周之内,同样的偏好会被以四种不同的方式保存;上个月的决策仍然与这个月的相矛盾;每次搜索现在都会返回一堆半陈旧、半重复的条目。存储在增长,召回质量随之下降,这与记忆应有的功能背道而驰。

为了解决这个问题,我们借鉴了生物学/日常生活中的概念:做梦。

我们的大脑全天记录信息,并在睡眠期间重新整理,保留重要的内容,让其余的逐渐淡忘。Agent 现在运行着类似流程的一个版本,即一个预定的后台通过,在没有请求等待时对记忆存储进行整理。

本文将探讨——什么是 Dreaming?为什么需要它?AI 实验室是如何做的?并介绍 Mem0 的 Dreaming 功能。

为什么 Agent 记忆会退化

根本原因是结构性的,归结于提取运行的时机。记忆是在对话过程中、在“热路径”上写入的,此时模型仍在生成回答。为了保持速度,提取器仅在一个极小的窗口中工作:当前的交互,加上检索恰好拉取的少量相似记忆。它从未看到存储的其余部分。

那个小窗口掩盖了一整类问题。假设用户在三月份提到他们住在里斯本,而今天说他们搬到了柏林。除非旧的“住在里斯本”的记忆恰好出现在当前上下文中,否则提取器根本不知道它的存在,因此它会写入“住在柏林”,并将“住在里斯本”留在那里,导致搜索结果中同时出现这两条记录。同样的盲点导致了重复,即以略微不同的措辞保存同一事实,并错过了只有通读数十个条目才能发现的模式。一条记忆是冗余的、陈旧的还是矛盾的,是整个存储的属性,而提取器只能看到切片。更好的提取无法弥补这一差距,因为决定性信息并不在该窗口中。

https://arxiv.org/abs/2606.03979

这在其他软件领域已是解决的问题。没有哪个严肃的数据系统会试图在写入时间的延迟压力下进行整理。它接受快速写入,随后在后台进行压缩:LSM 存储运行压缩,Postgres 运行 VACUUM,git 进行垃圾回收。Agent 记忆实现了快速写入路径,却跳过了后台通过。Dreaming 就是那个缺失的通过,终于被排入了日程。

Dreaming 的实际含义

Dream 是在空闲时间运行的预定任务,执行写入路径无法完成的整理工作。

https://arxiv.org/abs/2604.20943

实际上,它执行三个操作。它将陈述同一事实的记忆合并为一个。当较新的记忆替换某个事实时,它会将该事实标记为被取代,因此当前的真相会在下次搜索中胜出。它还会进行综合,读取一组相关条目,并写出它们所隐含的高阶记忆,就像一系列细小的观察汇聚成一个单一的结论。

https://openai.com/index/chatgpt-memory-dreaming/

有一个分歧值得注意,因为同一个词现在涵盖了两种截然不同的事物。有些系统在权重层做梦,将模型学到的内容折叠回其参数中,这意味着重新训练。其他系统则在存储层工作,在模型本身保持冻结的情况下重写数据库中的记忆记录。

目前所有可投入生产的应用都属于存储层,因为它重组数据而不是重新训练模型,这也是本文所讨论的版本。

AI 实验室是如何做的

@OpenAI 将其引入 ChatGPT

ChatGPT 不会搜索你的历史记录。它维护一份关于你是谁的持续摘要,并在每条消息中将其注入上下文,这虽然快速但脆弱:随着事实的积累、过时和相互矛盾,一份长期存在的摘要会随着岁月的流逝而“腐烂”。

2026 年 6 月,@OpenAI 重构了该摘要的维护方式,并将其命名为 Dreaming (OpenAI)。现在,一个后台进程会通读你的历史记录并自行重写个人资料,无需保存按钮,它甚至允许事实随时间自我修正:“七月去新加坡”在旅行结束后会变成“2026 年 7 月去了新加坡”。

@OpenAI 报告称,在新架构下,内部事实召回率从 41.5% 上升到了 82.8%,这是其在一个未发布的评估上的内部数据,因此请将其视为一种方向而非证明。方向才是重点:地球上使用最广泛的 AI 产品认定,解决记忆问题的答案是清理通过,而不是更大的上下文窗口。

@AnthropicAI 将其引入其 Agent

几周前,@AnthropicAI 将 Dreaming 添加到了 Claude Managed Agents 中,面向开发者而非消费者。

这是一个预定的过程,“审查 Agent 会话和记忆存储,提取模式,并管理记忆,以便 Agent 随着时间的推移而改进”。它合并重复项并淘汰陈旧条目,而且由于它一次跨整个 Agent 群体运行,它可以发现单个 Agent 无法独自注意到的事情:几个 Agent 不断重复的错误、它们都趋同的工作流、团队共享的偏好。

你可以决定它是自动提交更改,还是暂存以供人工审查。法律 AI 公司 Harvey 报告称,一旦其 Agent 能够在会话之间携带这些经验,任务完成率大约提高了 6 倍。

@Google 将其引入平台

@Google 从基础设施的角度切入。其 Gemini Agent 平台提供了一个 Memory Bank,可为每个用户身份自动生成并维护持久的长期记忆,跨会话携带。

它更倾向于构建和检索干净的记忆,而不是 @OpenAI 和 @AnthropicAI 描述的那种激进的会话间整理,但目标是一致的:随着规模扩大保持记忆可用,而不是任其蔓延。

https://mem0.ai/

研究的发现

这些产品是 2026 年研究浪潮的下游产物,论文在隐喻之外有更多共识。

@Google 的《Language Models Need Sleep》是权重层的案例。睡眠阶段将上下文中的知识巩固到模型参数中,做梦阶段则让模型通过强化学习生成自己的合成练习(Behrouz et al.)。这有效,但需要训练,这也是目前它仅停留在实验室的原因。

Auto-Dreamer 最接近实际投产的产品。基于认知科学中的“快速捕获、慢速巩固”分离,它将一部分记忆视为只读,检查每个条目及其来源,然后编写一套紧凑的替代集来取代原始条目,整个过程针对任务成功进行端到端训练(Ye et al.)。回报才是有趣的部分:在 ScienceWorld 上,它在使用比最强基线小 12 倍的记忆库的同时,得分提高了 7 分,并且在无需重新训练的情况下迁移到了未见过的任务。清理存储不仅节省了 Token,还让 Agent 工作得更好。

还有两篇论文探讨了遗忘这一半,这是从业者最不信任的部分。SCM 赋予模型人类风格的睡眠阶段和基于价值的遗忘,并报告称在召回率无损失的情况下将记忆噪音削减了约 91%(SCM)。SleepGate 针对一种被称为“前摄干扰”的故障模式,即陈旧条目淹没了正确答案,并增加了一个睡眠周期,标记被取代的事实,清除死重,并合并幸存的内容(SleepGate)。

不同的团队,不同的层级,同一个结论:召回效果最好的系统并不是保留信息最多的那些。它们会巩固、有意遗忘,并将被取代的事实标记为已替换。

@mem0ai 是如何做的

@mem0ai 将其作为名为 Dream 的功能发布,并有一个其他方案未完全遵守的约束:绝不销毁任何内容。

它运行前面提到的三个操作。

  • Merge(合并)将重复项折叠为单一的标准记忆。

  • Supersede(取代)标记过时的事实并将其链接到替换它的记忆,因此之前提到的“里斯本-然后-柏林”案例现在解析为一个当前的答案“住在柏林”,而旧记忆仍可作为历史查询,不会污染搜索结果。

  • Synthesize(综合)将一组相关记忆提炼为高阶记忆,并保留指向其提取的每个来源的指针,这与 Auto-Dreamer 工作中发现值得构建的溯源信息相同。

https://docs.mem0.ai/platform/features/dream

其独特之处在于,每一个更改都是一个你可以阅读、追踪和撤销的差异,绝不是静默覆盖,且每条综合记忆都会引用其来源。这比听起来更重要。一个没有审计追踪的后台进程重写你的数据,这不算功能,而是一种悄悄丢失数据的方式。这些操作也不在热路径上运行:合并和取代在记忆写入时应用,综合则按计划运行,因此你的实时添加和搜索调用速度与之前完全一致。

在 Mem0 的生产数据中,活跃项目的中位数通常携带数百条与同项目中其他内容重复或矛盾的记忆,并在每次调用时被检索和计费。这就是 Dream 存在并要清理的混乱。它在 Pro 版上每周运行一次,在 Enterprise 版上每天运行一次,且仅在用户拥有足够多的记忆、值得寻找模式时才运行。

尚未解决的问题

当事实发生变化时,旧版本应该消失还是作为历史保持可见?@OpenAI 倾向于彻底重写;@mem0ai 保留痕迹并允许你请求仅当前视图,目前尚无人证明哪种方式召回效果更好。

综合的核心也存在张力:Dream 写入的摘要本身就是新的记忆,竞争着同样的检索位置,因此过于急切地进行合并的系统反而会使召回变差,而不是更好。频率也未定,因为大脑每晚运行,而产品范围从写入时到每周不等,正确的间隔几乎肯定取决于工作负载。

这一切之下的转变很简单。多年来,“让 Agent 记住更多”意味着更大的存储和更大的上下文窗口。Dreaming 是该领域承认更大的堆叠并不是更好的记忆。获胜的记忆是随着增长变得更干净的那种,这正是睡眠之夜为我们所做的工作。

参考文献

  • OpenAI: Dreaming, Better memory for a more helpful ChatGPT (June 2026)

  • Anthropic: New in Claude Managed Agents, dreaming, outcomes, and multiagent orchestration (May 2026)

  • Google Cloud: Gemini Enterprise Agent Platform, Memory Bank

  • Park et al.: Generative Agents, Interactive Simulacra of Human Behavior (arXiv:2304.03442)

  • Behrouz et al.: Language Models Need Sleep (arXiv:2606.03979)

  • Ye et al.: Auto-Dreamer, Learning Offline Memory Consolidation for Language Agents (arXiv:2605.20616)

  • SCM: Sleep-Consolidated Memory with Algorithmic Forgetting for Large Language Models (arXiv:2604.20943)

  • Learning to Forget: Sleep-Inspired Memory Consolidation for Resolving Proactive Interference (arXiv:2603.14517)

  • Mem0: Dream

  • Mem0

A long-running agent gets really worse at remembering facts over time.

长期运行的 Agent 随着时间推移,记忆事实的能力会显著下降。

As the context window fills up during the conversation, and especially across long-horizon tasks, the agent keeps extracting facts and writing them into its memory store, and nothing ever cleans that store out.

随着对话过程中上下文窗口(Context Window)被填满,尤其是在跨越长期任务时,Agent 会不断提取事实并将其写入记忆存储(Memory Store),却从未有任何机制清理该存储。

Within weeks the same preference is saved four different ways, last month's decision still contradicts this month's, and every search is now scoring a pile of half-stale, half-duplicate entries. The store grows and recall degrades with it, which is the opposite of what a memory is supposed to do.

几周之内,同样的偏好会被以四种不同的方式保存;上个月的决策仍然与这个月的相矛盾;每次搜索现在都会返回一堆半陈旧、半重复的条目。存储在增长,召回质量随之下降,这与记忆应有的功能背道而驰。

Well, to handle this, we just referenced from biology/daily life stuff: dreaming.

为了解决这个问题,我们借鉴了生物学/日常生活中的概念:做梦。

Our brain records all day and re-organizes during sleep, keeping what matters and letting the rest fade. Agents now run a version of the same process, a scheduled background pass that reconciles the memory store while no request is waiting on it.

我们的大脑全天记录信息,并在睡眠期间重新整理,保留重要的内容,让其余的逐渐淡忘。Agent 现在运行着类似流程的一个版本,即一个预定的后台通过,在没有请求等待时对记忆存储进行整理。

This article is about- What is Dreaming? Why? How AI labs do it? And introducing Dreaming feature from Mem0

本文将探讨——什么是 Dreaming?为什么需要它?AI 实验室是如何做的?并介绍 Mem0 的 Dreaming 功能。

Why agent memory degrades

为什么 Agent 记忆会退化

The root cause is structural, and it comes down to when extraction runs. Memories are written mid-conversation, on the hot path, while the model is still generating your answer. To keep that fast, the extractor works from a tiny window: the current exchange, plus a handful of similar memories that retrieval happened to pull in. It never sees the rest of the store.

根本原因是结构性的,归结于提取运行的时机。记忆是在对话过程中、在“热路径”上写入的,此时模型仍在生成回答。为了保持速度,提取器仅在一个极小的窗口中工作:当前的交互,加上检索恰好拉取的少量相似记忆。它从未看到存储的其余部分。

That small window hides an entire class of problems. Say a user mentioned in March that they live in Lisbon, and today they say they moved to Berlin. Unless the old Lisbon memory happens to surface in the current context, the extractor has no idea it exists, so it writes "lives in Berlin" and leaves "lives in Lisbon" sitting there, both now returned by search. The same blind spot creates duplicates, the same fact saved in slightly different words, and misses patterns that only appear when you read across dozens of entries at once. Whether a memory is redundant, stale, or contradicted is a property of the whole store, and extraction only ever sees a slice. Better extraction cannot close that gap, because the deciding information is not in the window.

那个小窗口掩盖了一整类问题。假设用户在三月份提到他们住在里斯本,而今天说他们搬到了柏林。除非旧的“住在里斯本”的记忆恰好出现在当前上下文中,否则提取器根本不知道它的存在,因此它会写入“住在柏林”,并将“住在里斯本”留在那里,导致搜索结果中同时出现这两条记录。同样的盲点导致了重复,即以略微不同的措辞保存同一事实,并错过了只有通读数十个条目才能发现的模式。一条记忆是冗余的、陈旧的还是矛盾的,是整个存储的属性,而提取器只能看到切片。更好的提取无法弥补这一差距,因为决定性信息并不在该窗口中。

This is a solved problem everywhere else in software. No serious data system tries to reconcile at write time under latency pressure. It accepts writes fast and compacts later, in the background: LSM stores run compaction, Postgres runs VACUUM, git garbage-collects. Agent memory shipped the fast write path and skipped the background pass. Dreaming is that missing pass, finally scheduled.

这在其他软件领域已是解决的问题。没有哪个严肃的数据系统会试图在写入时间的延迟压力下进行整理。它接受快速写入,随后在后台进行压缩:LSM 存储运行压缩,Postgres 运行 VACUUM,git 进行垃圾回收。Agent 记忆实现了快速写入路径,却跳过了后台通过。Dreaming 就是那个缺失的通过,终于被排入了日程。

What dreaming actually means

Dreaming 的实际含义

A dream is a scheduled job that runs during idle time and does the reconciliation the write path could not.

Dream 是在空闲时间运行的预定任务,执行写入路径无法完成的整理工作。

In practice it performs three operations. It merges memories that state the same fact into one. It supersedes a fact when a newer memory replaces it, so the current truth wins the next search. And it synthesizes, reading a cluster of related entries and writing the higher-order memory they imply, the way a run of small observations adds up to a single conclusion.

实际上,它执行三个操作。它将陈述同一事实的记忆合并为一个。当较新的记忆替换某个事实时,它会将该事实标记为被取代,因此当前的真相会在下次搜索中胜出。它还会进行综合,读取一组相关条目,并写出它们所隐含的高阶记忆,就像一系列细小的观察汇聚成一个单一的结论。

One fork is worth flagging, because the same word now covers two very different things. Some systems dream at the weights layer, folding what the model learned back into its parameters, which means retraining. Others work at the store layer, rewriting the memory records in the database while the model itself stays frozen.

有一个分歧值得注意,因为同一个词现在涵盖了两种截然不同的事物。有些系统在权重层做梦,将模型学到的内容折叠回其参数中,这意味着重新训练。其他系统则在存储层工作,在模型本身保持冻结的情况下重写数据库中的记忆记录。

Everything you can put into production today is store-layer, because it re-organizes data instead of retraining a model, and that is the version this article is about.

目前所有可投入生产的应用都属于存储层,因为它重组数据而不是重新训练模型,这也是本文所讨论的版本。

How AI labs do it

AI 实验室是如何做的

@OpenAI put it in ChatGPT

@OpenAI 将其引入 ChatGPT

ChatGPT does not search your history. It keeps a running summary of who you are and injects it into context on every message, which is fast but fragile: a standing summary rots as facts accumulate, go stale, and contradict each other across years of chat.

ChatGPT 不会搜索你的历史记录。它维护一份关于你是谁的持续摘要,并在每条消息中将其注入上下文,这虽然快速但脆弱:随着事实的积累、过时和相互矛盾,一份长期存在的摘要会随着岁月的流逝而“腐烂”。

In June 2026 @OpenAI rebuilt how that summary is maintained and named it Dreaming (OpenAI). A background process now reads across your history and rewrites the profile on its own, with no save button, and it even lets facts correct themselves over time: "going to Singapore in July" becomes "went to Singapore in July 2026" once the trip has passed.

2026 年 6 月,@OpenAI 重构了该摘要的维护方式,并将其命名为 Dreaming (OpenAI)。现在,一个后台进程会通读你的历史记录并自行重写个人资料,无需保存按钮,它甚至允许事实随时间自我修正:“七月去新加坡”在旅行结束后会变成“2026 年 7 月去了新加坡”。

@OpenAI reports internal factual recall rising from 41.5% to 82.8% on the new architecture, its own number on an unreleased eval, so read it as a direction rather than a proof. The direction is the story: the most-used AI product on earth decided the answer to memory was a cleanup pass, not a bigger context window.

@OpenAI 报告称,在新架构下,内部事实召回率从 41.5% 上升到了 82.8%,这是其在一个未发布的评估上的内部数据,因此请将其视为一种方向而非证明。方向才是重点:地球上使用最广泛的 AI 产品认定,解决记忆问题的答案是清理通过,而不是更大的上下文窗口。

@AnthropicAI put it in its agents

@AnthropicAI 将其引入其 Agent

Weeks earlier, @AnthropicAI added Dreaming to Claude Managed Agents, aimed at developers instead of consumers.

几周前,@AnthropicAI 将 Dreaming 添加到了 Claude Managed Agents 中,面向开发者而非消费者。

It is a scheduled process that "reviews agent sessions and memory stores, extracts patterns, and curates memories so agents improve over time" (Anthropic). It merges duplicates and retires stale entries, and because it runs across a whole fleet of agents at once, it can surface things no single agent could notice on its own: a mistake several agents keep repeating, a workflow they all converge on, a preference shared across the team.

这是一个预定的过程,“审查 Agent 会话和记忆存储,提取模式,并管理记忆,以便 Agent 随着时间的推移而改进”。它合并重复项并淘汰陈旧条目,而且由于它一次跨整个 Agent 群体运行,它可以发现单个 Agent 无法独自注意到的事情:几个 Agent 不断重复的错误、它们都趋同的工作流、团队共享的偏好。

You decide whether it commits changes automatically or stages them for a human to review first. Harvey, a legal-AI company, reported task-completion rates rising roughly 6x once its agents could carry these learnings between sessions.

你可以决定它是自动提交更改,还是暂存以供人工审查。法律 AI 公司 Harvey 报告称,一旦其 Agent 能够在会话之间携带这些经验,任务完成率大约提高了 6 倍。

@Google put it in the platform

@Google 将其引入平台

@Google comes at it from the infrastructure side. Its Gemini agent platform ships a Memory Bank that automatically generates and maintains durable long-term memories for each user identity, carried across sessions (Google Cloud).

@Google 从基础设施的角度切入。其 Gemini Agent 平台提供了一个 Memory Bank,可为每个用户身份自动生成并维护持久的长期记忆,跨会话携带。

It leans more toward building and retrieving a clean memory than toward the aggressive between-session reconciliation @OpenAI and @AnthropicAI describe, but the objective is the same: keep memory usable as it scales instead of letting it sprawl.

它更倾向于构建和检索干净的记忆,而不是 @OpenAI 和 @AnthropicAI 描述的那种激进的会话间整理,但目标是一致的:随着规模扩大保持记忆可用,而不是任其蔓延。

What the research is finding

研究的发现

The products are downstream of a 2026 research wave, and the papers agree on more than the metaphor.

这些产品是 2026 年研究浪潮的下游产物,论文在隐喻之外有更多共识。

@Google's "Language Models Need Sleep" is the weights-layer case. A sleep phase consolidates in-context knowledge into the model's parameters, and a dreaming phase has the model generate its own synthetic practice through reinforcement learning (Behrouz et al.). It works, but it requires training, which is why it stays in the lab for now.

@Google 的《Language Models Need Sleep》是权重层的案例。睡眠阶段将上下文中的知识巩固到模型参数中,做梦阶段则让模型通过强化学习生成自己的合成练习(Behrouz et al.)。这有效,但需要训练,这也是目前它仅停留在实验室的原因。

Auto-Dreamer is the closest to what production actually ships. Built on the fast-capture, slow-consolidate split from cognitive science, it treats a region of memory as read-only, inspects each entry and where it came from, then writes a compact replacement set that supersedes the originals, all trained end-to-end on task success (Ye et al.). The payoff is the interesting part: it gained 7 points on ScienceWorld while running a memory bank 12x smaller than the strongest baseline, and it carried over to unseen tasks with no retraining. Cleaning the store did not just save tokens, it made the agent better at the job.

Auto-Dreamer 最接近实际投产的产品。基于认知科学中的“快速捕获、慢速巩固”分离,它将一部分记忆视为只读,检查每个条目及其来源,然后编写一套紧凑的替代集来取代原始条目,整个过程针对任务成功进行端到端训练(Ye et al.)。回报才是有趣的部分:在 ScienceWorld 上,它在使用比最强基线小 12 倍的记忆库的同时,得分提高了 7 分,并且在无需重新训练的情况下迁移到了未见过的任务。清理存储不仅节省了 Token,还让 Agent 工作得更好。

Two more papers tackle the forgetting half, the part practitioners trust least. SCM gives a model human-style sleep stages and value-based forgetting and reports cutting memory noise by roughly 91% with no loss of recall (SCM). SleepGate targets a failure mode it calls proactive interference, where stale entries drown out the correct answer, and adds a sleep cycle that tags superseded facts, evicts the dead weight, and merges what survives (SleepGate).

还有两篇论文探讨了遗忘这一半,这是从业者最不信任的部分。SCM 赋予模型人类风格的睡眠阶段和基于价值的遗忘,并报告称在召回率无损失的情况下将记忆噪音削减了约 91%(SCM)。SleepGate 针对一种被称为“前摄干扰”的故障模式,即陈旧条目淹没了正确答案,并增加了一个睡眠周期,标记被取代的事实,清除死重,并合并幸存的内容(SleepGate)。

Different groups, different layers, one conclusion: the systems that recall best are not the ones that keep the most. They consolidate, forget on purpose, and mark superseded facts as replaced.

不同的团队,不同的层级,同一个结论:召回效果最好的系统并不是保留信息最多的那些。它们会巩固、有意遗忘,并将被取代的事实标记为已替换。

How @mem0ai does it

@mem0ai 是如何做的

@mem0ai ships this as a feature called Dream, with one constraint the others do not fully hold: nothing is ever destroyed.

@mem0ai 将其作为名为 Dream 的功能发布,并有一个其他方案未完全遵守的约束:绝不销毁任何内容。

It runs the three operations from earlier.

它运行前面提到的三个操作。

  • Merge collapses a duplicate into a single canonical memory.
  • Merge(合并)将重复项折叠为单一的标准记忆。
  • Supersede flags an outdated fact and links it to its replacement, so the Lisbon-then-Berlin case from before now resolves to one current answer, "lives in Berlin," while the old memory stays queryable as history instead of polluting search.
  • Supersede(取代)标记过时的事实并将其链接到替换它的记忆,因此之前提到的“里斯本-然后-柏林”案例现在解析为一个当前的答案“住在柏林”,而旧记忆仍可作为历史查询,不会污染搜索结果。
  • Synthesize distills a cluster of related memories into a higher-order one and keeps a pointer back to every source it drew from, the same provenance the Auto-Dreamer work found was worth building.
  • Synthesize(综合)将一组相关记忆提炼为高阶记忆,并保留指向其提取的每个来源的指针,这与 Auto-Dreamer 工作中发现值得构建的溯源信息相同。

What sets it apart is that every one of those changes is a diff you can read, trace, and undo, never a silent overwrite, and every synthesized memory cites its sources. That matters more than it sounds. A background process that rewrites your data with no audit trail is not a feature, it is a way to lose data quietly. None of it runs on the hot path either: merge and supersede apply as memories are written, and synthesis runs on a schedule, so your live add and search calls stay exactly as fast as before.

其独特之处在于,每一个更改都是一个你可以阅读、追踪和撤销的差异,绝不是静默覆盖,且每条综合记忆都会引用其来源。这比听起来更重要。一个没有审计追踪的后台进程重写你的数据,这不算功能,而是一种悄悄丢失数据的方式。这些操作也不在热路径上运行:合并和取代在记忆写入时应用,综合则按计划运行,因此你的实时添加和搜索调用速度与之前完全一致。

In Mem0's own production data, the median active project is carrying a few hundred memories that duplicate or contradict something else in the same project, retrieved and billed on every call. That is the mess Dream exists to clear. It runs weekly on Pro and daily on Enterprise, and only once a user has enough memories for a pattern to be worth finding.

在 Mem0 的生产数据中,活跃项目的中位数通常携带数百条与同项目中其他内容重复或矛盾的记忆,并在每次调用时被检索和计费。这就是 Dream 存在并要清理的混乱。它在 Pro 版上每周运行一次,在 Enterprise 版上每天运行一次,且仅在用户拥有足够多的记忆、值得寻找模式时才运行。

What is still unsolved

尚未解决的问题

When a fact changes, should the old version disappear or stay visible as history? @OpenAI leans toward a clean rewrite; @mem0ai keeps the trail and lets you ask for the current-only view, and nobody has yet shown which one recalls better.

当事实发生变化时,旧版本应该消失还是作为历史保持可见?@OpenAI 倾向于彻底重写;@mem0ai 保留痕迹并允许你请求仅当前视图,目前尚无人证明哪种方式召回效果更好。

There is also a tension at the core of synthesis: the summaries a dream writes are themselves new memories competing for the same retrieval slots, so a system that consolidates too eagerly makes recall worse, not better. And cadence is unsettled, because the brain runs nightly while products range from write-time to weekly, and the right interval almost certainly depends on the workload.

综合的核心也存在张力:Dream 写入的摘要本身就是新的记忆,竞争着同样的检索位置,因此过于急切地进行合并的系统反而会使召回变差,而不是更好。频率也未定,因为大脑每晚运行,而产品范围从写入时到每周不等,正确的间隔几乎肯定取决于工作负载。

The shift underneath all of it is simple. For years, "make the agent remember more" meant a larger store and a larger context window. Dreaming is the field conceding that a larger pile is not a better memory. The memory that wins is the one that gets cleaner as it grows, which is exactly the job a night of sleep does for us.

这一切之下的转变很简单。多年来,“让 Agent 记住更多”意味着更大的存储和更大的上下文窗口。Dreaming 是该领域承认更大的堆叠并不是更好的记忆。获胜的记忆是随着增长变得更干净的那种,这正是睡眠之夜为我们所做的工作。

References

参考文献

  • OpenAI: Dreaming, Better memory for a more helpful ChatGPT (June 2026)
  • OpenAI: Dreaming, Better memory for a more helpful ChatGPT (June 2026)
  • Anthropic: New in Claude Managed Agents, dreaming, outcomes, and multiagent orchestration (May 2026)
  • Anthropic: New in Claude Managed Agents, dreaming, outcomes, and multiagent orchestration (May 2026)

  • Google Cloud: Gemini Enterprise Agent Platform, Memory Bank
  • Google Cloud: Gemini Enterprise Agent Platform, Memory Bank
  • Park et al.: Generative Agents, Interactive Simulacra of Human Behavior (arXiv:2304.03442)
  • Park et al.: Generative Agents, Interactive Simulacra of Human Behavior (arXiv:2304.03442)
  • Behrouz et al.: Language Models Need Sleep (arXiv:2606.03979)
  • Behrouz et al.: Language Models Need Sleep (arXiv:2606.03979)

  • Ye et al.: Auto-Dreamer, Learning Offline Memory Consolidation for Language Agents (arXiv:2605.20616)
  • Ye et al.: Auto-Dreamer, Learning Offline Memory Consolidation for Language Agents (arXiv:2605.20616)
  • SCM: Sleep-Consolidated Memory with Algorithmic Forgetting for Large Language Models (arXiv:2604.20943)
  • SCM: Sleep-Consolidated Memory with Algorithmic Forgetting for Large Language Models (arXiv:2604.20943)

  • Learning to Forget: Sleep-Inspired Memory Consolidation for Resolving Proactive Interference (arXiv:2603.14517)
  • Learning to Forget: Sleep-Inspired Memory Consolidation for Resolving Proactive Interference (arXiv:2603.14517)
  • Mem0: Dream
  • Mem0: Dream

  • Mem0
  • Mem0

A long-running agent gets really worse at remembering facts over time.

As the context window fills up during the conversation, and especially across long-horizon tasks, the agent keeps extracting facts and writing them into its memory store, and nothing ever cleans that store out.

Within weeks the same preference is saved four different ways, last month's decision still contradicts this month's, and every search is now scoring a pile of half-stale, half-duplicate entries. The store grows and recall degrades with it, which is the opposite of what a memory is supposed to do.

Well, to handle this, we just referenced from biology/daily life stuff: dreaming.

Our brain records all day and re-organizes during sleep, keeping what matters and letting the rest fade. Agents now run a version of the same process, a scheduled background pass that reconciles the memory store while no request is waiting on it.

This article is about- What is Dreaming? Why? How AI labs do it? And introducing Dreaming feature from Mem0

Why agent memory degrades

The root cause is structural, and it comes down to when extraction runs. Memories are written mid-conversation, on the hot path, while the model is still generating your answer. To keep that fast, the extractor works from a tiny window: the current exchange, plus a handful of similar memories that retrieval happened to pull in. It never sees the rest of the store.

That small window hides an entire class of problems. Say a user mentioned in March that they live in Lisbon, and today they say they moved to Berlin. Unless the old Lisbon memory happens to surface in the current context, the extractor has no idea it exists, so it writes "lives in Berlin" and leaves "lives in Lisbon" sitting there, both now returned by search. The same blind spot creates duplicates, the same fact saved in slightly different words, and misses patterns that only appear when you read across dozens of entries at once. Whether a memory is redundant, stale, or contradicted is a property of the whole store, and extraction only ever sees a slice. Better extraction cannot close that gap, because the deciding information is not in the window.

https://arxiv.org/abs/2606.03979

This is a solved problem everywhere else in software. No serious data system tries to reconcile at write time under latency pressure. It accepts writes fast and compacts later, in the background: LSM stores run compaction, Postgres runs VACUUM, git garbage-collects. Agent memory shipped the fast write path and skipped the background pass. Dreaming is that missing pass, finally scheduled.

What dreaming actually means

A dream is a scheduled job that runs during idle time and does the reconciliation the write path could not.

https://arxiv.org/abs/2604.20943

In practice it performs three operations. It merges memories that state the same fact into one. It supersedes a fact when a newer memory replaces it, so the current truth wins the next search. And it synthesizes, reading a cluster of related entries and writing the higher-order memory they imply, the way a run of small observations adds up to a single conclusion.

https://openai.com/index/chatgpt-memory-dreaming/

One fork is worth flagging, because the same word now covers two very different things. Some systems dream at the weights layer, folding what the model learned back into its parameters, which means retraining. Others work at the store layer, rewriting the memory records in the database while the model itself stays frozen.

Everything you can put into production today is store-layer, because it re-organizes data instead of retraining a model, and that is the version this article is about.

How AI labs do it

@OpenAI put it in ChatGPT

ChatGPT does not search your history. It keeps a running summary of who you are and injects it into context on every message, which is fast but fragile: a standing summary rots as facts accumulate, go stale, and contradict each other across years of chat.

In June 2026 @OpenAI rebuilt how that summary is maintained and named it Dreaming (OpenAI). A background process now reads across your history and rewrites the profile on its own, with no save button, and it even lets facts correct themselves over time: "going to Singapore in July" becomes "went to Singapore in July 2026" once the trip has passed.

@OpenAI reports internal factual recall rising from 41.5% to 82.8% on the new architecture, its own number on an unreleased eval, so read it as a direction rather than a proof. The direction is the story: the most-used AI product on earth decided the answer to memory was a cleanup pass, not a bigger context window.

@AnthropicAI put it in its agents

Weeks earlier, @AnthropicAI added Dreaming to Claude Managed Agents, aimed at developers instead of consumers.

It is a scheduled process that "reviews agent sessions and memory stores, extracts patterns, and curates memories so agents improve over time" (Anthropic). It merges duplicates and retires stale entries, and because it runs across a whole fleet of agents at once, it can surface things no single agent could notice on its own: a mistake several agents keep repeating, a workflow they all converge on, a preference shared across the team.

You decide whether it commits changes automatically or stages them for a human to review first. Harvey, a legal-AI company, reported task-completion rates rising roughly 6x once its agents could carry these learnings between sessions.

@Google put it in the platform

@Google comes at it from the infrastructure side. Its Gemini agent platform ships a Memory Bank that automatically generates and maintains durable long-term memories for each user identity, carried across sessions (Google Cloud).

It leans more toward building and retrieving a clean memory than toward the aggressive between-session reconciliation @OpenAI and @AnthropicAI describe, but the objective is the same: keep memory usable as it scales instead of letting it sprawl.

https://mem0.ai/

What the research is finding

The products are downstream of a 2026 research wave, and the papers agree on more than the metaphor.

@Google's "Language Models Need Sleep" is the weights-layer case. A sleep phase consolidates in-context knowledge into the model's parameters, and a dreaming phase has the model generate its own synthetic practice through reinforcement learning (Behrouz et al.). It works, but it requires training, which is why it stays in the lab for now.

Auto-Dreamer is the closest to what production actually ships. Built on the fast-capture, slow-consolidate split from cognitive science, it treats a region of memory as read-only, inspects each entry and where it came from, then writes a compact replacement set that supersedes the originals, all trained end-to-end on task success (Ye et al.). The payoff is the interesting part: it gained 7 points on ScienceWorld while running a memory bank 12x smaller than the strongest baseline, and it carried over to unseen tasks with no retraining. Cleaning the store did not just save tokens, it made the agent better at the job.

Two more papers tackle the forgetting half, the part practitioners trust least. SCM gives a model human-style sleep stages and value-based forgetting and reports cutting memory noise by roughly 91% with no loss of recall (SCM). SleepGate targets a failure mode it calls proactive interference, where stale entries drown out the correct answer, and adds a sleep cycle that tags superseded facts, evicts the dead weight, and merges what survives (SleepGate).

Different groups, different layers, one conclusion: the systems that recall best are not the ones that keep the most. They consolidate, forget on purpose, and mark superseded facts as replaced.

How @mem0ai does it

@mem0ai ships this as a feature called Dream, with one constraint the others do not fully hold: nothing is ever destroyed.

It runs the three operations from earlier.

  • Merge collapses a duplicate into a single canonical memory.

  • Supersede flags an outdated fact and links it to its replacement, so the Lisbon-then-Berlin case from before now resolves to one current answer, "lives in Berlin," while the old memory stays queryable as history instead of polluting search.

  • Synthesize distills a cluster of related memories into a higher-order one and keeps a pointer back to every source it drew from, the same provenance the Auto-Dreamer work found was worth building.

https://docs.mem0.ai/platform/features/dream

What sets it apart is that every one of those changes is a diff you can read, trace, and undo, never a silent overwrite, and every synthesized memory cites its sources. That matters more than it sounds. A background process that rewrites your data with no audit trail is not a feature, it is a way to lose data quietly. None of it runs on the hot path either: merge and supersede apply as memories are written, and synthesis runs on a schedule, so your live add and search calls stay exactly as fast as before.

In Mem0's own production data, the median active project is carrying a few hundred memories that duplicate or contradict something else in the same project, retrieved and billed on every call. That is the mess Dream exists to clear. It runs weekly on Pro and daily on Enterprise, and only once a user has enough memories for a pattern to be worth finding.

What is still unsolved

When a fact changes, should the old version disappear or stay visible as history? @OpenAI leans toward a clean rewrite; @mem0ai keeps the trail and lets you ask for the current-only view, and nobody has yet shown which one recalls better.

There is also a tension at the core of synthesis: the summaries a dream writes are themselves new memories competing for the same retrieval slots, so a system that consolidates too eagerly makes recall worse, not better. And cadence is unsettled, because the brain runs nightly while products range from write-time to weekly, and the right interval almost certainly depends on the workload.

The shift underneath all of it is simple. For years, "make the agent remember more" meant a larger store and a larger context window. Dreaming is the field conceding that a larger pile is not a better memory. The memory that wins is the one that gets cleaner as it grows, which is exactly the job a night of sleep does for us.

References

  • OpenAI: Dreaming, Better memory for a more helpful ChatGPT (June 2026)

  • Anthropic: New in Claude Managed Agents, dreaming, outcomes, and multiagent orchestration (May 2026)

  • Google Cloud: Gemini Enterprise Agent Platform, Memory Bank

  • Park et al.: Generative Agents, Interactive Simulacra of Human Behavior (arXiv:2304.03442)

  • Behrouz et al.: Language Models Need Sleep (arXiv:2606.03979)

  • Ye et al.: Auto-Dreamer, Learning Offline Memory Consolidation for Language Agents (arXiv:2605.20616)

  • SCM: Sleep-Consolidated Memory with Algorithmic Forgetting for Large Language Models (arXiv:2604.20943)

  • Learning to Forget: Sleep-Inspired Memory Consolidation for Resolving Proactive Interference (arXiv:2603.14517)

  • Mem0: Dream

  • Mem0

📋 讨论归档

讨论进行中…