Install
openclaw skills install @ares521521-design/icecube-memoryπ§ IceCube Memory β Local-first, zero-token-footprint memory architecture for AI agents. Real-time retrieval, four-layer hierarchy, compaction survival. Built from production experience. When users mention 'agent memory', 'context window', 'agent forgets', 'compaction', 'MEMORY.md', 'memory architecture', or want to set up reliable long-term memory for their OpenClaw agent.
openclaw skills install @ares521521-design/icecube-memoryThe 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.
| 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 |
MEMORY.md β Long-term curated factsAGENTS.md β Operating manualSOUL.md β PersonaUSER.md β Human profileRule: Keep < 20KB total. Anything not needed every session goes to Layer 2.
memory/YYYY-MM-DD.md β Today's logmemory/YYYY-MM-DD-1.md β Yesterday's logRule: Append-only. No editing. Promote important stuff to Layer 1 weekly.
memory/YYYY-MM-DD-older.md β Past logsAccess: Via memory_search only. Not auto-loaded.
memory/semantic/ β Extracted factsmemory/procedural/ β How-to guidesAccess: Via memory_search with type filtering.
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
Heartbeat Maintenance β Weekly distillation
mkdir -p ~/.openclaw/workspace/memory
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
Add to ~/.openclaw/openclaw.json:
{
"agents": {
"defaults": {
"compaction": {
"reserveTokensFloor": 40000,
"memoryFlush": { "enabled": true }
}
}
}
}
Morning startup:
Before ending session:
Weekly (heartbeat):
Typical session:
Total: ~15KB (vs Zep's 600KB)
# Search all memory
memory_search "payment validation"
# Returns:
# - Snippet (~700 chars)
# - File path
# - Line range
# - Score
# Read specific file
memory_get "memory/2026-03-17.md" from=50 lines=20
| 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 |
| 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 |
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.
MIT β Use freely. Attribute if you like.
Not duct tape. Not a graph. Just files that work.