| name | memorybox |
| description | Diagnoses bloated MEMORY.md files, splits oversized sections into domain-specific files, archives stale daily logs, and deduplicates content using a 3-tier hierarchy (MEMORY.md → domains/ → archive/). Use when MEMORY.md exceeds 10KB, context pressure is high, or the user asks to clean up, organize, or maintain agent memory files. Works alongside Mem0, Supermemory, QMD, or standalone. |
MemoryBox
Zero-dependency memory maintenance tool for OpenClaw agents.
What It Does
Prevents MEMORY.md bloat by organizing memory into 3 tiers:
- Tier 1: MEMORY.md (≤10KB, loaded every session)
- Tier 2: memory/domains/*.md (searched on-demand)
- Tier 3: memory/archive/ (old daily logs)
Works alongside Mem0, Supermemory, QMD, or standalone. Only touches file structure — never configs or plugins.
Install
git clone https://github.com/Ramsbaby/openclaw-memorybox.git
cd openclaw-memorybox && chmod +x bin/memorybox
sudo ln -sf "$(pwd)/bin/memorybox" /usr/local/bin/memorybox
Recommended Workflow
- Run
memorybox doctor ~/openclaw — full diagnostic (start here)
- Run
memorybox split ~/openclaw — move flagged sections to domain files
- Verify with
memorybox health ~/openclaw — target score above 80
- Run
memorybox archive ~/openclaw — archive daily logs older than 14 days
- Run
memorybox dedupe ~/openclaw — remove duplicate content
Additional commands:
memorybox stale ~/openclaw
memorybox analyze ~/openclaw
memorybox suggest ~/openclaw
memorybox report ~/openclaw
memorybox init ~/openclaw
Teach Your Agent
Add to AGENTS.md:
## Memory Protocol
- **MEMORY.md** (≤10KB): Core facts only. Loaded everywhere — keep it lean.
- **memory/domains/*.md**: Detailed reference. Use `memory_search` to find.
- **memory/archive/**: Old logs. Rarely needed.
Results
Tested on production (7 Discord channels, 48 crons):
- MEMORY.md: 20KB → 3.5KB (-83%)
- Context pressure: 98% → 7%
- Setup time: 5 minutes
Links