Skip to content
API Blog

Memory plugin

@lobu/openclaw-plugin gives an OpenClaw agent persistent, structured memory backed by Lobu over MCP. It recalls relevant facts before each prompt and captures new observations after each session, so a coding agent (or any OpenClaw agent) remembers across runs instead of starting cold every time.

This page is the package reference. For the click-through install flow with screenshots, see Install to OpenClaw; for the memory model the plugin reads and writes, see Memory.

Terminal window
openclaw plugins install @lobu/openclaw-plugin

Then log in and point the plugin at your Lobu memory MCP endpoint:

Terminal window
lobu login
lobu memory configure --url <mcp-url> --org <org-slug>
lobu memory health --url <mcp-url> --org <org-slug>

Replace <mcp-url> with your workspace MCP URL: https://lobu.ai/mcp/acme for cloud, or http://localhost:8787/mcp for the local runtime. lobu memory configure writes a tokenCommand that shells out to lobu token --raw, so the plugin reuses your top-level Lobu CLI login rather than holding its own credential.

FieldDescription
mcpUrlFull MCP endpoint URL. Required.
webUrlPublic web URL for the Lobu instance. Used to render links the agent can show the user.
tokenBearer token for MCP requests. Optional: if unset, the plugin runs interactive device login.
tokenCommandShell command that prints a bearer token to stdout. Alternative to token (what lobu memory configure wires up).
headersExtra HTTP headers for MCP requests.
autoRecallSearch Lobu memory for relevant memories before each prompt. Default true.
recallLimitMaximum recalled records per request. Default 6.
autoCaptureCapture conversation observations as long-term memories after each session. Default true.
agentIdAgent this plugin instance is bound to. When set, autoCapture stamps metadata.agent_id on every save so recall can scope to this agent’s own writes. Falls back to the LOBU_AGENT_ID env var.

The full schema lives in the package’s openclaw.plugin.json.

The plugin wraps the Lobu memory MCP server and adds two automatic hooks around each turn:

  • Recall (before the prompt). When autoRecall is on, the plugin calls search_memory for context relevant to the incoming prompt and injects up to recallLimit records. The recall round-trip is deliberately bounded well under OpenClaw’s ~15s hook budget; a slow search degrades to “no recall” rather than letting OpenClaw kill the hook.
  • Capture (after the session). When autoCapture is on, the plugin distills the conversation into observations and saves them with save_memory, stamping metadata.agent_id when agentId is set so each agent’s writes stay attributable.

The plugin registers each Lobu MCP server tool with OpenClaw under a lobu_ prefix (search_memory becomes lobu_search_memory, and so on). Tools the server advertises but the plugin doesn’t yet know are skipped rather than registered. The current set:

ToolUse
search_memoryHybrid (vector + full-text) search across the org’s events.
save_memoryAppend a new memory/event (with entity links, semantic type, metadata).
list_organizationsList the orgs the authenticated user belongs to; marks the bound org.
search_sdkDiscover ClientSDK methods and docs (doesn’t query workspace data).
query_sdkRun read-only TypeScript over the ClientSDK in a sandboxed isolate.
run_sdkFull-SDK TypeScript, including writes. Destructive; the agent should confirm first.
query_sqlPaginated read-only SQL, auto-scoped to the bound org.

In standalone mode the plugin also registers auth tools, lobu_login and lobu_login_check, so an agent that hits a not-yet-authenticated memory instance can drive the device-login flow itself (show the user the login URL + code, then finish auth) instead of failing.