AI REM
Most AI assistants forget you the moment the conversation ends. They have no yesterday. No last week. No memory of what you decided three months ago. Every interaction starts from zero.
This is fine for "summarize this PDF." It is not fine when you are trying to build an AI that actually knows you.
I have been running an AI agent system for over a year now. 18 specialized agents that handle everything from code to email to health tracking. The CEO agent - Wayne - coordinates the rest, makes judgment calls, and talks to me directly.
But Wayne had amnesia. Every session was a blank slate.
So I built him a memory.
The daily log
The first layer is simple. Every night at 21:00, a job runs and collects everything that happened that day:
- My Telegram messages (the raw input)
- The full conversation between me and Wayne (both sides)
- Calendar events
- Completed tasks across all agents
- Structured learnings (facts the system has extracted about me)
An LLM distills all of this into a concise daily log. Not a transcript - a memory. Decisions I made, preferences I expressed, projects I discussed, people I mentioned.
The result is a markdown file. One per day. 1,055 of them now, going back to January 2021.
The problem with accumulation
Having 1,055 daily logs is great for lookup. But memory does not work by accumulation.
If you just keep piling up memories, you get noise. Contradictions. Stale context. The AI starts performing worse because it is drowning in outdated information.
I said I wanted to sell Treendly in 2021. I am also actively building new features for it in 2026. Both are true - I am building value while keeping the sale option open. But if the AI treats the 2021 "sell it" statement as current truth, it gives bad advice.
Humans solve this during sleep. Your brain does not just store memories during the day - it processes, prunes, and consolidates them overnight. REM sleep is literally a garbage collector for your mind. It resolves contradictions, strengthens important memories, and lets go of noise.
Dream consolidation
So I built the AI equivalent of REM sleep.
Every Sunday at 03:00, a "dream consolidation" job runs. Two phases:
Phase 1: Analysis. The system reads recent daily logs and compares them against its existing consolidated memories. It flags contradictions, stale information, and new insights that are not captured yet.
Phase 2: Update. Based on the analysis, it generates create, update, or delete operations for its consolidated memory files. Each memory has YAML frontmatter (name, type, description) and structured content with "Why" and "How to apply" sections.
The first time I ran this, it found seven things it had wrong about me. It thought I abandoned a product by choice (I got a cease and desist from Meta). It thought I was deciding between selling Treendly or building it (I am doing both). It thought my burnout was from overwork (it was an identity crisis caused by AI democratizing my core skill).
I corrected the record, and the dream system learned from those corrections.
The result
Now Wayne has:
- 1,055+ daily memory files spanning five years
- Consolidated memory files that get pruned and updated weekly
- Dream logs for audit trails
- Five data sources feeding into each daily summary
When I ask "what did I decide about X?", the answer comes from real context, not hallucination. When I say "email Valentina", the system knows which Valentina, her email, her phone, her relationship to me.
This is not RAG. RAG retrieves documents. This is closer to how a human brain works - daily encoding, periodic consolidation, contradiction resolution, and structured long-term memory.
The bigger pattern
Anthropic quietly shipped something similar in Claude Code recently. They call it "Auto Dream" - it reviews past sessions, prunes stale memories, and consolidates them into organized files. Same concept, same name, built independently.
That is not a coincidence. It is convergent evolution. When you actually try to make AI remember things across sessions, you inevitably arrive at the same architecture: daily logs plus periodic consolidation. Because that is how memory works.
The real unlock is not giving AI more context. It is giving AI the ability to forget the right things.