
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)


