The average developer session generates 80–300 memory writes: questions asked, decisions made, code explained, preferences stated, errors encountered. After a week of work, that's 500–2,000 raw fragments in your agent's graph. After a month: 2,000–8,000. Without consolidation, retrieval quality degrades as the noise floor rises — your agent spends increasing portions of its context window on low-signal fragments instead of high-density insight.
Based on the EverMemOS research (arXiv:2601.02163), which established that periodic memory consolidation in LLM agents reduces context-window token costs by 83–95% on long-running tasks while maintaining or improving task performance.
Read the paper →
98%
Context cost reduction
The 7 Phases of the Dream
A background cognitive process, not a deletion script
01
Scan
Identify weak, low-importance fragments — nodes with importance scores below threshold, accessed fewer than N times, or flagged as provisional during the original write. These are candidates for consolidation, not deletion.
02
Cluster
Group related fragments using Union-Find mathematics. Fragments that are semantically adjacent (cosine similarity > 0.85) and temporally co-located (written within the same session) are merged into clusters for synthesis.
03
Synthesize
Use an LLM to "dream" — compressing 50 related fragments into 1 core insight node. This is not summarization; it's distillation. The synthesized node captures the essential truth while stripping session noise, filler, and redundancy.
04
Archive
Move raw noise to cold storage. Nothing is permanently deleted — the source fragments remain accessible with full audit trail. They are simply deprioritized from active recall. This preserves provenance while cleaning the signal layer.
05
Implicit Edges
Discover new causal links between summary nodes that weren't visible in the raw fragments. Synthesis often reveals connections that individual fragments obscure — a pattern across 40 fragments that only becomes clear when they're compressed into one.
06
Prune
Clean up stale edges — connections between nodes where one or both nodes have been archived or superseded. A clean edge set is as important as a clean node set for retrieval quality.
07
Decay
Apply temporal fade to old importance scores. A memory from 6 months ago that hasn't been accessed or reinforced loses weight gradually. Recency is a signal. Decay makes room for the most current, relevant context to surface first.
What the Agent Wakes Up With
Before and after a REM cycle
Before REM: 1,400 fragments. Retrieval returns a mix of high-signal decisions and low-signal filler. Context window fills up fast. Agent has to guess at importance.
After REM: 28 high-density insight nodes. Each one a distilled truth. Retrieval is surgical. The agent's context window is dominated by the most relevant, current, contradiction-free information your project has ever produced. It wakes up smarter than it went to sleep.
The REM Guarantee
- 50:1 compression ratio on raw session fragments
- Nothing permanently deleted — full cold-storage audit trail
- Implicit edges discovered during synthesis — agent learns connections it never saw explicitly
- Runs overnight — zero impact on session performance
- 98% reduction in context-window token costs on long-running projects