Bootstrapping a new agent from existing memories
Every new OpenClaw agent starts blank. No context about your projects, your preferences, your weird naming conventions. You either stuff everything into AGENTS.md and burn context tokens every single session, or you accept that the first few days will be rough while the agent figures things out.
There’s a third option: pre-load MemoClaw with everything the agent needs, and let it recall on demand.
The problem with AGENTS.md
OpenClaw’s workspace files (AGENTS.md, MEMORY.md, USER.md) get loaded into the context window every session. That works fine when they’re small. But as your agent accumulates knowledge, these files grow. I’ve seen MEMORY.md files hit 40-50KB. That’s context window space eaten before the agent does anything useful.
Most of that context is irrelevant to any given task. If your agent is fixing a bug in the auth module, it doesn’t need the three paragraphs about your CSS preferences. But it’s loading them anyway. Every time.
With MemoClaw, the agent only pulls what’s relevant. The rest sits in storage, costing nothing until it’s needed.
Setting up pre-loaded memories
Start with what you already have
If you’ve been running an OpenClaw agent for a while, you probably have markdown files full of accumulated knowledge. The migrate command turns those into searchable memories in one shot:
# Import your existing MEMORY.md
memoclaw migrate MEMORY.md
# Import a whole directory of notes
memoclaw migrate ~/notes/project-docs/
# Import into a specific namespace
memoclaw migrate ~/notes/ --namespace onboarding
# Speed it up with parallel imports
memoclaw migrate ~/docs/ --concurrency 4
The migrate command splits your markdown into chunks, generates embeddings, and stores each chunk as a separate memory. Headings become natural boundaries. After migration, each chunk is independently searchable by meaning, not just keywords.
Store structured knowledge manually
Migration works for bulk imports, but you’ll want to store specific pieces of knowledge with proper tags and importance scores:
# Store a high-importance preference
memoclaw store "Always use pnpm, never npm or yarn. All projects use pnpm workspaces." \
--importance 0.9 --tags "preference,tooling"
# Store a project convention
memoclaw store "API routes follow the pattern /api/v1/{resource}/{id}. Never nest deeper than two levels." \
--importance 0.8 --tags "convention,api"
# Store a correction the agent should never forget
memoclaw store "The staging database is on Neon, NOT Supabase. I corrected this on Feb 10." \
--importance 1.0 --tags "correction,infrastructure" --immutable
Notice the --immutable flag on that last one. Immutable memories can’t be modified or deleted. Use this for facts you never want the agent to accidentally overwrite.
Batch import from a structured file
If you have a lot of structured knowledge to load at once, prepare a JSON file and use import:
# Import memories from a JSON file
memoclaw import < memories.json
# Import into a specific namespace
memoclaw import --namespace onboarding < memories.json
Each imported memory costs $0.005 (same as a regular store), but it’s a single command instead of dozens of individual calls.
Tagging strategy for pre-loaded memories
Tags make recall precise. Without them, semantic search still works, but tags let you filter hard when you need to.
A tagging pattern that works well for onboarding:
preference— how you like things doneconvention— project-specific rulesinfrastructure— where things live, how they connectcorrection— mistakes the agent should avoidprocess— how to do recurring tasksperson— info about team members or contacts
When the agent recalls, it can filter:
# Agent needs to deploy something — pull only infra context
memoclaw recall "how to deploy" --tags infrastructure
# Agent is writing code — pull conventions
memoclaw recall "API endpoint structure" --tags convention
Integrating with the OpenClaw skill
Once memories are pre-loaded, your agent uses the MemoClaw skill to recall them during conversations. Install it:
clawhub install anajuliabit/memoclaw
The skill gives your agent memoclaw_recall and memoclaw_store as tools. When you ask “deploy the new feature,” the agent recalls deployment procedures from memory instead of relying on whatever’s crammed into AGENTS.md.
The cost math is straightforward. Loading 50KB of AGENTS.md every session means paying for those tokens on every single message. A MemoClaw recall costs $0.005 and pulls back only the 5-10 memories that actually matter for the current task.
Moving knowledge between agents
Here’s where it gets interesting. Once your knowledge lives in MemoClaw instead of workspace files, you can share it.
All agents using the same wallet address share the same memory pool. Spin up a second agent for a different task, point it at the same wallet, and it has access to everything the first agent learned.
Want to fork the knowledge instead of sharing it? Export and re-import:
# Export from agent A
memoclaw export -O knowledge-dump.json
# Import into agent B (different wallet)
MEMOCLAW_PRIVATE_KEY=$AGENT_B_KEY memoclaw import < knowledge-dump.json
Namespaces help here too. If both agents share a wallet but work on different projects, give each project its own namespace. Shared knowledge (your preferences, general conventions) lives in the default namespace. Project-specific context goes into --namespace project-a or --namespace project-b.
To selectively transfer only the best memories:
# Export from agent A, filter for high-importance, import to agent B's namespace
memoclaw export --namespace agent-a | \
jq '[.[] | select(.importance >= 0.7)]' > filtered.json
memoclaw import --namespace agent-b < filtered.json
What to pre-load (and what to skip)
Pre-load:
- Your preferences — coding style, tools, communication style
- Project conventions — naming patterns, file structure, deployment processes
- Infrastructure details — database hosts, service locations, environment setup
- Past corrections — mistakes you’ve already fixed once
- Team context — who does what, how to reach them
Skip:
- Secrets — no API keys, passwords, or tokens. MemoClaw isn’t a secrets manager.
- Large documents — memories max out at 8192 characters. Use migration for docs; it auto-chunks.
- Rapidly changing info — things that go stale in hours aren’t worth storing.
What actually changes
Without this setup, a new agent loads 50KB of workspace files every session. Most of it is irrelevant. Context window fills up before the agent does anything useful.
With pre-loaded memories, the agent starts with a slim AGENTS.md (just personality and core rules). When it needs specific knowledge, it recalls from MemoClaw. Only relevant memories enter the context.
The onboarding difference is real too. Instead of a new agent fumbling through its first week, it starts with your accumulated knowledge from day one. Same recall quality as an agent that’s been running for months.
Setup takes maybe 30 minutes. Mostly just running memoclaw migrate on your existing files and storing a handful of high-importance preferences manually.