Skip to main content
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.
# 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:
SourceMemoClaw field
Section bodycontent
Keywords in contentmemory_type (decision, preference, correction, etc.)
Header words + filename datetags (e.g., date:2026-01-30, migrated, openclaw)
Content heuristicsimportance (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
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:
openclaw gateway restart
Verify everything is wired up:
openclaw hooks list --verbose
The hooks automatically handle:
EventWhat happens
Session startRecalls relevant memories based on the first message
Context compactionSaves important context before the window is compressed
/new commandExtracts and stores key info before session reset
HeartbeatPeriodic 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