Setup
1
Start agentmemory
2
Wire MCP
~/.openclaw/, backs up openclaw.json, merges the standard mcpServers.agentmemory entry, and verifies it after writing.3
Install the memory plugin (optional, deeper)
From a repo checkout:The installer copies the plugin into
~/.openclaw/extensions/agentmemory and switches OpenClaw’s exclusive memory slot from memory-core to agentmemory. Then allow conversation access in ~/.openclaw/openclaw.json (config below) — without it, OpenClaw silently blocks the agent_end hook and turn capture never fires.4
Restart OpenClaw
Restart so both the MCP server and the plugin load.
5
Verify
http://localhost:3113 and confirm observations appear after an agent run.What connect writes
~/.openclaw/openclaw.json
The memory-slot plugin
The plugin inintegrations/openclaw/ claims OpenClaw’s memory slot. hooks.allowConversationAccess is required: OpenClaw blocks conversation-reading hooks from non-bundled plugins by default, and without it the plugin loads but never captures turns. Enable it with:
~/.openclaw/openclaw.json
- claims
plugins.slots.memory = "agentmemory"viaapi.registerMemoryCapability({ promptBuilder }), the documented API for occupying the slot - recalls relevant long-term memory before the agent starts (
before_agent_starthook) - captures completed conversation turns after the agent finishes (
agent_endhook) - shares the same backend with every other connected agent
The plugin registers a
promptBuilder only, not a full memory-runtime adapter. OpenClaw’s MemoryRuntimeBackendConfig currently accepts only its internal builtin and qmd backends, which do not fit agentmemory’s external REST shape. Hook-driven recall plus capture is the working integration path.Troubleshooting
Plugin validates but does not load
Plugin validates but does not load
The extension folder must contain
package.json, openclaw.plugin.json, and plugin.mjs, and plugins.slots.memory must be set to agentmemory. Copy the whole integrations/openclaw folder, not just the plugin file.Connection refused on port 3111
Connection refused on port 3111
The agentmemory server is not running. Start it with
npx @agentmemory/agentmemory. With fallback_on_error: true the agent keeps working without memory until the server returns.src/cli/connect/openclaw.ts (shared JSON adapter). Plugin: integrations/openclaw/plugin.mjs and its README.