Memory consolidation for AI agents β REM sleep for your coding assistant.
After 20+ sessions, your AI's MEMORY.md becomes a graveyard of duplicates, stale context, and noise. ai-dream fixes this by running a background consolidation process β like how your brain cleans up memories during REM sleep.
Two versions, same goal:
| Claude Code | OpenClaw | |
|---|---|---|
| Directory | claude-code/ |
openclaw/ |
| Mechanism | Built-in autoDreamEnabled setting |
Cron-triggered dream agent |
| Setup | One line in settings.json |
setup.sh or manual cron |
| Runs when | Background (Claude decides) | Nightly at 3:00 AM (configurable) |
| Config file | settings.json |
DREAM.md |
| Customizable rules | No (black box) | Yes (full control) |
Your AI assistant accumulates memory files over time. Without consolidation:
- Duplicates pile up β the same project status recorded 5 different ways
- Stale info lingers β completed tasks, old deadlines, superseded decisions
- Signal drowns in noise β important context gets buried under session artifacts
- MEMORY.md bloats β the index file grows past useful limits
ai-dream consolidates memory the way sleep consolidates human memory:
Session 1 β raw notes
Session 2 β raw notes
Session 3 β raw notes
β
[Dream cycle]
β
Clean MEMORY.md
(deduplicated, pruned, integrated)
# Add to your Claude Code settings
# ~/.claude/settings.json
{
"preferences": {
"autoDreamEnabled": true
}
}See claude-code/README.md for details.
# Clone and run setup
git clone https://github.com/VoidLight00/ai-dream.git
cd ai-dream/openclaw
chmod +x setup.sh
./setup.sh /path/to/your/workspaceSee openclaw/README.md for details.
Both versions follow the same core cycle:
- Collect β Gather recent memory files and session notes
- Compare β Diff against current
MEMORY.mdfor conflicts and duplicates - Consolidate β Merge, prune, and integrate based on priority rules
- Update β Write a clean
MEMORY.mdwith consolidated information - Log β Record what changed for auditability
The Claude Code version handles this internally. The OpenClaw version gives you full control over the rules via DREAM.md.
ai-dream/
βββ README.md # This file
βββ LICENSE # MIT
βββ CHANGELOG.md
βββ claude-code/
β βββ README.md # Claude Code setup guide
β βββ settings.example.json # Example configuration
β βββ how-it-works.md # Technical deep-dive
βββ openclaw/
βββ README.md # OpenClaw setup guide
βββ DREAM.md # Dream rules template
βββ dream-agent-prompt.md # Agent prompt template
βββ setup.sh # Automated setup
βββ cron-setup.md # Manual cron guide
Contributions are welcome. Please open an issue first to discuss what you'd like to change.
MIT β VoidLight00
νκ΅μ΄ μλ΄
20κ° μ΄μμ μΈμ
μ κ±°μΉλ©΄ AIμ MEMORY.mdλ μ€λ³΅, μ€λλ μ 보, λ
Έμ΄μ¦λ‘ κ°λ μ°Ήλλ€. ai-dreamμ μ¬λμ λ μλ©΄μ²λΌ λ°±κ·ΈλΌμ΄λμμ λ©λͺ¨λ¦¬λ₯Ό μ 리ν©λλ€.
λ κ°μ§ λ²μ :
- Claude Code β
settings.jsonμautoDreamEnabled: trueμΆκ° β μλ μ€ν - OpenClaw β
DREAM.mdκ·μΉ νμΌ + cron κΈ°λ° μΌκ° μ 리 μμ΄μ νΈ
κ° λλ ν 리μ READMEλ₯Ό μ°Έκ³ νμΈμ.
