OpenClaw stores memories as local markdown files (memory/YYYY-MM-DD.md, MEMORY.md). MemoClaw can import these directly — each ## section becomes a separate, searchable memory with auto-detected importance, tags, and type.
CLI migration (recommended)
# Install & init (skip if already done)
npm install -g memoclaw
memoclaw init
# Migrate your memory files
memoclaw migrate ~/.openclaw/workspace/memory/
The CLI reads all .md files in the directory, splits them by ## headers, and sends them to the /v1/migrate endpoint.
✔ Scanned 42 files
✔ Created 187 memories (12 deduplicated)
✔ Migration complete
Migration is idempotent — running it twice won’t create duplicates. Each memory chunk is content-hashed and checked against existing memories.
What gets imported
Each ## section in a markdown file becomes one memory:
| Source | MemoClaw field |
|---|
| Section body | content |
| Keywords in content | memory_type (decision, preference, correction, etc.) |
| Header words + filename date | tags (e.g., date:2026-01-30, migrated, openclaw) |
| Content heuristics | importance (0.6–0.9 based on keywords) |
Files without ## headers are stored as a single memory.
API migration
If you prefer direct API access, use POST /v1/migrate:
curl -X POST https://api.memoclaw.com/v1/migrate \
-H "Content-Type: application/json" \
-d '{
"files": [
{
"filename": "2026-01-30.md",
"content": "## Project Setup\nDecided to use PostgreSQL with pgvector.\n\n## Editor Config\nUser prefers vim keybindings and dark mode."
},
{
"filename": "MEMORY.md",
"content": "## Long-term preferences\nAlways use TypeScript over JavaScript."
}
]
}'
Response
{
"files_processed": 2,
"memories_created": 3,
"memories_deduplicated": 0
}
If any files fail, partial results are returned with an errors array:
{
"files_processed": 1,
"memories_created": 2,
"memories_deduplicated": 0,
"errors": [
{ "filename": "bad-file.md", "error": "Content too short" }
]
}
Limits
- Max 50 files per request
- Each section truncated to 8,000 characters
- Sections shorter than 10 characters are skipped
- Requires x402 payment or free tier credits
Install OpenClaw hooks (recommended)
After migrating your files, install the MemoClaw hooks so your agent automatically stores and recalls memories going forward — no manual commands needed.
# Install the hook pack
openclaw hooks install memoclaw-hooks
openclaw hooks enable memoclaw
Set your wallet key in your environment (same wallet you used for migration):
export MEMOCLAW_PRIVATE_KEY=0x...
Restart the gateway:
Verify everything is wired up:
openclaw hooks list --verbose
The hooks automatically handle:
| Event | What happens |
|---|
| Session start | Recalls relevant memories based on the first message |
| Context compaction | Saves important context before the window is compressed |
| /new command | Extracts and stores key info before session reset |
| Heartbeat | Periodic consolidation to merge duplicate memories |
With hooks installed, you can remove memory-related instructions from your AGENTS.md and SOUL.md — MemoClaw handles it automatically.
After migration
Your memories are now searchable by meaning:
memoclaw recall "What database are we using?"
# [0.92] Decided to use PostgreSQL with pgvector.
# tags: date:2026-01-30, project, setup, migrated, openclaw