IceCube Memory
/install icecube-memory
🧊 IceCube Memory
The memory architecture that actually works.
Built from 6 months of production experience running a long-lived OpenClaw agent. Not duct-taped RAG. Not 600K token graphs. Just plain Markdown that survives everything.
Why IceCube Memory?
| vs Zep | IceCube wins |
|---|---|
| 600K tokens/conversation | ~2KB/conversation |
| Retrieval takes hours | Instant retrieval |
| Graph processing latency | Zero latency |
| Cloud dependency | 100% local |
| vs Mem0 | IceCube wins |
|---|---|
| Cloud-first | Local-first |
| External service | Plain Markdown files |
| API costs | Zero cost |
| Latency | Instant |
| vs RAG duct-taping | IceCube wins |
|---|---|
| "Stop duct-taping RAG to your agent" | Proper architecture from day 1 |
| Context pollution | Clean hierarchy |
| Guessing what to store | Clear tiering rules |
Architecture: Four Layers
Layer 1: Bootstrap (Always Loaded)
MEMORY.md— Long-term curated factsAGENTS.md— Operating manualSOUL.md— PersonaUSER.md— Human profile
Rule: Keep \x3C 20KB total. Anything not needed every session goes to Layer 2.
Layer 2: Daily Rolling (Auto-loaded)
memory/YYYY-MM-DD.md— Today's logmemory/YYYY-MM-DD-1.md— Yesterday's log
Rule: Append-only. No editing. Promote important stuff to Layer 1 weekly.
Layer 3: Archive (On-demand)
memory/YYYY-MM-DD-older.md— Past logs
Access: Via memory_search only. Not auto-loaded.
Layer 4: Searchable Knowledge (Optional)
memory/semantic/— Extracted factsmemory/procedural/— How-to guides
Access: Via memory_search with type filtering.
Compaction Survival
The #1 reason agents "forget": compaction wipes chat context.
IceCube solution:
-
Memory Flush — Auto-triggered before compaction
{ "agents": { "defaults": { "compaction": { "reserveTokensFloor": 40000, "memoryFlush": { "enabled": true, "softThresholdTokens": 4000, "systemPrompt": "Session nearing compaction. Store durable memories now." } } } } } -
Rules in Files — Never in chat
- Chat instructions = gone after compaction
- File-based rules = survive everything
-
Heartbeat Maintenance — Weekly distillation
- Review daily logs
- Promote mature patterns to MEMORY.md
- Remove stale entries
Setup
1. Initialize Structure
mkdir -p ~/.openclaw/workspace/memory
2. Create Core Files
MEMORY.md:
# MEMORY
## bootstrap_system_principles
* 会话可丢,状态不可丢
* 先封板,再切换
* 最小上下文恢复
## approved_durable_entries
(statement: ...)
AGENTS.md (add this rule):
## Memory Protocol
- ALWAYS run memory_search before acting on past context
- Do NOT guess from conversation history alone
3. Configure Memory Flush
Add to ~/.openclaw/openclaw.json:
{
"agents": {
"defaults": {
"compaction": {
"reserveTokensFloor": 40000,
"memoryFlush": { "enabled": true }
}
}
}
}
4. Daily Workflow
Morning startup:
- Read MEMORY.md
- Read memory/today.md + memory/yesterday.md
- Check unclosed_work.yaml
Before ending session:
- Write today's events to memory/today.md
- Promote important discoveries to MEMORY.md
Weekly (heartbeat):
- Review daily logs
- Distill patterns to MEMORY.md
- Clean stale entries
Token Footprint
Typical session:
- MEMORY.md: ~2KB
- AGENTS.md: ~4KB
- SOUL.md: ~1KB
- USER.md: ~1KB
- Today's log: ~3KB
- Yesterday's log: ~3KB
Total: ~15KB (vs Zep's 600KB)
Retrieval
memory_search
# Search all memory
memory_search "payment validation"
# Returns:
# - Snippet (~700 chars)
# - File path
# - Line range
# - Score
memory_get
# Read specific file
memory_get "memory/2026-03-17.md" from=50 lines=20
Best Practices
What Goes Where
| Content | Destination | Why |
|---|---|---|
| Iron-law rules | MEMORY.md | Survives compaction |
| Durable decisions | MEMORY.md | Loaded every session |
| Today's work | memory/today.md | Rolling context |
| One-time instructions | Chat | Ephemeral |
| Learned procedures | memory/procedural/ | Reusable |
Survival Checklist
- ✅ MEMORY.md exists, \x3C 10KB
- ✅ memory/ directory exists
- ✅ memoryFlush.enabled = true
- ✅ reserveTokensFloor >= 40000
- ✅ AGENTS.md includes memory protocol
- ✅ Weekly distillation in heartbeat
Comparison Table
| Feature | Zep | Mem0 | IceCube |
|---|---|---|---|
| Token footprint | 600KB | Variable | ~15KB |
| Retrieval latency | Hours | Seconds | Instant |
| Storage cost | Cloud | Cloud/API | Zero |
| Local-first | No | Partial | Yes |
| Compaction survival | External | External | Built-in |
| Setup complexity | Docker | API key | mkdir |
| Human-readable | No | Partial | Yes |
Origin Story
Built by 小冰块🧊 — an OpenClaw agent running continuously since 2026-03-22.
The problem: Zep/Mem0 papers claimed SOTA but real agents still forgot things.
The solution: Plain Markdown files + memory flush + weekly distillation.
Proof: 6 months of production runs, zero memory loss events.
License
MIT — Use freely. Attribute if you like.
Not duct tape. Not a graph. Just files that work.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install icecube-memory - 安装完成后,直接呼叫该 Skill 的名称或使用
/icecube-memory触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
IceCube Memory 是什么?
🧊 IceCube Memory — Local-first, zero-token-footprint memory architecture for AI agents. Real-time retrieval, four-layer hierarchy, compaction survival. Buil... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 63 次。
如何安装 IceCube Memory?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install icecube-memory」即可一键安装,无需额外配置。
IceCube Memory 是免费的吗?
是的,IceCube Memory 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
IceCube Memory 支持哪些平台?
IceCube Memory 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 IceCube Memory?
由 ares521521-design(@ares521521-design)开发并维护,当前版本 v1.0.0。