README.md

July 28, 2026 · View on GitHub

XMemo logo

XMemo for OpenClaw

Native, user-owned long-term memory for OpenClaw agents.

Replace the active OpenClaw memory backend with XMemo for durable recall, cross-agent context, continuity tools, and governed cloud memory.

Release workflow npm version npm downloads GitHub stars OpenClaw compatibility TypeScript

ClawHub Native memory provider Privacy first Tool count

Quick start · Architecture · Tools · Configuration · Operations · Security


@xmemo/openclaw-memory is the native XMemo memory provider for OpenClaw. It registers as kind: "memory" and becomes OpenClaw's active long-term memory backend when the xmemo-memory slot is selected.

The plugin talks directly to XMemo. No local embedding model or vector database is required. Memories written by approved XMemo clients can be recalled across OpenClaw, ChatGPT, Hermes, Codex, Claude, Cursor, and other connected agents.

Note

This is an external OpenClaw plugin distributed through ClawHub and npm. It is not bundled in the default OpenClaw release.

Architecture

XMemo native memory architecture for OpenClaw

Package@xmemo/openclaw-memory
Plugin IDxmemo-memory
OpenClaw roleNative kind: "memory" provider
Minimum hostOpenClaw 2026.6.9
Hosted servicehttps://xmemo.dev
Tools15 native memory and governance tools
CLIopenclaw xmemo

Why this plugin

  • Native active memory — participates in OpenClaw's memory lifecycle instead of exposing a parallel tool collection only.
  • Cross-agent context — reads all user-visible XMemo buckets by default, so OpenClaw can reuse memories created by other approved clients.
  • No local vector stack — semantic search, persistence, and governance live in XMemo.
  • Operational continuity — TODOs, timeline events, and restart snapshots are available beside core memory operations.
  • Resilient by default — a user-scoped recall cache and write outbox absorb transient network failures.
  • Explicit automation — auto-capture is opt-in, permission-gated, filtered, and secret-aware.

Quick start

Install from ClawHub

openclaw plugins install clawhub:@xmemo/openclaw-memory
printf '%s' 'xmemo_...' | openclaw xmemo setup --stdin
openclaw xmemo status

openclaw xmemo setup enables the plugin, selects xmemo-memory as the active memory slot, and saves the credential source. No manual openclaw.json editing is required for normal installs.

PowerShell:

$xmemoKey = Read-Host "XMemo API key"
$xmemoKey | openclaw xmemo setup --stdin
Remove-Variable xmemoKey

Install from npm

openclaw plugins install @xmemo/openclaw-memory

Reuse an XMemo CLI login

The plugin can reuse the user-scoped credential created by xmemo login:

npm install -g @xmemo/client
xmemo login
openclaw plugins install clawhub:@xmemo/openclaw-memory
openclaw xmemo status

XMemo for OpenClaw setup flow

Tip

On production or shared hosts, prefer an environment SecretRef: openclaw xmemo setup --env XMEMO_KEY.

Tool catalog

The plugin registers 15 tools. memory_* tools are used by the OpenClaw agent during a turn; they are not standalone shell commands.

Core memory

ToolPurpose
memory_searchSemantic recall across visible XMemo memory
memory_getFetch an exact memory by reference
memory_storeSave durable memory
memory_forgetDelete an exact memory
xmemo_memory_listBrowse or search memories using query/path hints
xmemo_memory_updateUpdate an existing memory

Continuity and workflow

ToolPurpose
xmemo_todo_createCreate a durable TODO
xmemo_todo_listList TODOs
xmemo_todo_completeComplete a TODO
xmemo_record_eventRecord a timeline event or milestone
xmemo_restart_snapshot_saveSave restart/handoff state
xmemo_restart_snapshot_restoreRestore restart/handoff state

Owner and governance surfaces

ToolPurpose
xmemo_ledger_monthly_summaryRead a monthly ledger summary
xmemo_audit_eventsRead authorized audit events
xmemo_audit_consolidationRead authorized audit consolidation

Ledger and audit tools require the corresponding API-key scopes.

Native plugin, Skill, and MCP

These components complement each other but have different responsibilities:

ComponentResponsibilityExecutes memory operations
XMemo SkillTeaches recall-first behavior, safe write-back, and handoff habitsNo
OpenClaw pluginOwns the active memory slot and runs native memory toolsYes
Hosted XMemo MCPPortable XMemo tools for MCP-compatible clientsYes

For OpenClaw, the recommended pairing is this plugin plus the XMemo Skill. The Skill guides behavior; the plugin performs real reads and writes.

Hosted MCP at https://xmemo.dev/mcp can coexist with the native plugin, but it creates a second XMemo tool surface. Prefer the native plugin for OpenClaw memory operations and add MCP only when a deliberate portable fallback is needed.

Configuration

Most users should use the CLI setup command. The equivalent explicit configuration is:

{
  "plugins": {
    "slots": {
      "memory": "xmemo-memory"
    },
    "entries": {
      "xmemo-memory": {
        "enabled": true,
        "package": "@xmemo/openclaw-memory",
        "config": {
          "baseUrl": "https://xmemo.dev",
          "apiKey": {
            "source": "env",
            "provider": "default",
            "id": "XMEMO_KEY"
          },
          "bucket": "openclaw",
          "readBucket": "%",
          "autoCapture": false
        }
      }
    }
  }
}

Configuration belongs under plugins.entries["xmemo-memory"].config, not plugins.config.

Configuration reference

FieldDefaultDescription
baseUrlhttps://xmemo.devHosted or private XMemo service
apiKeyString or environment SecretRef
authModeapi-keyapi-key, bearer, or both
bucketopenclawWrite bucket for OpenClaw-authored memories
scopeunsetOptional write scope
readBucket%Read all visible buckets by default
readScopeunsetOptional read-scope restriction
teamIdunsetOptional enterprise team
agentIdopenclawNon-secret source attribution
autoCapturefalseOpt-in high-signal capture
captureMaxChars500Maximum eligible capture length
recallMaxItems8Maximum recalled items
recallMaxTokens4000Context-pack token budget

Previous tagged configurations remain compatible. The deprecated token field is still accepted as an alias for apiKey; new setup writes apiKey.

Cross-agent read policy

bucket and scope control where OpenClaw-authored memories are written. Recall and search read all visible user-owned XMemo memories by default:

{
  "bucket": "openclaw",
  "readBucket": "%",
  "readScope": null
}

Advanced operators can narrow reads with readBucket and readScope.

Authentication

Make XMEMO_KEY available to the OpenClaw service, then save an environment reference:

export XMEMO_KEY="your-xmemo-api-key"
openclaw xmemo setup --env XMEMO_KEY
openclaw xmemo status

A shell export affects only that shell. Daemon or gateway deployments must set the variable in the service environment.

Credential resolution

The plugin resolves credentials in this order:

  1. apiKey or deprecated token string in plugin configuration.
  2. An environment SecretRef such as { "source": "env", "provider": "default", "id": "XMEMO_KEY" }.
  3. XMEMO_KEY, MEMORY_OS_API_KEY, or MEMORY_OS_MCP_TOKEN.
  4. The shared user credential written by xmemo login.

Only env SecretRefs are supported. Unsupported file and exec sources are rejected by the manifest schema.

Shared XMemo CLI credentials default to Bearer authentication. Other credentials default to X-API-Key unless authMode is set explicitly.

Environment variables

VariablePurpose
XMEMO_KEYPreferred service credential
XMEMO_BASE_URL / XMEMO_URLOptional private service URL
XMEMO_AGENT_IDOptional attribution override
XMEMO_AGENT_INSTANCE_IDOptional stable device identifier
XMEMO_CONFIG_HOMEOptional shared credential root
MEMORY_OS_* aliasesBackward compatibility

Non-localhost http:// service URLs are rejected. Use HTTPS outside local development.

Local resilience

The plugin maintains a small user-scoped recall cache and write outbox:

FileBehavior
recall-cache.jsonFive-minute fresh cache with up to 24-hour stale fallback
write-outbox.jsonQueues transiently failed writes with retry backoff

Storage root:

  • $OPENCLAW_DATA_DIR/xmemo/<scope-hash>/ when configured
  • $XDG_DATA_HOME/xmemo/<scope-hash>/ on XDG systems
  • ~/.xmemo/<scope-hash>/ otherwise

The scope hash is derived from the service URL and a credential hash; the credential itself is never written to the path. Directories and files use owner-only permissions where supported.

Idempotent writes can replay automatically. Non-idempotent writes are held for manual handling to avoid duplicate side effects.

Auto-capture

Auto-capture is disabled by default. When enabled, the plugin inspects successful agent turns for high-signal preferences, decisions, and facts.

{
  "autoCapture": true,
  "customTriggers": ["save this", "remember for next time"]
}

External plugins need explicit conversation permission:

{
  "hooks": {
    "allowConversationAccess": ["xmemo-memory"]
  }
}

The capture filter rejects transport metadata, injected context, prompt-like payloads, known secret patterns, oversized messages, and content without a memory trigger. At most three eligible messages are captured per processed turn.

Operations

CLI

openclaw xmemo setup --stdin
openclaw xmemo setup --env XMEMO_KEY
openclaw xmemo setup --dry-run
openclaw xmemo status
openclaw xmemo status --json

openclaw xmemo login and openclaw xmemo key set remain deprecated aliases for compatibility.

Health check

openclaw xmemo status --json

Important fields:

  • configured — a supported credential source was resolved
  • credentialSourceconfig, env-secret-ref, env, or shared-credential
  • connected — the XMemo endpoint passed the connectivity probe
  • providerxmemo-memory

Inspect the loaded plugin runtime:

openclaw plugins inspect xmemo-memory --runtime --json

The output should list the 15 tools, the xmemo CLI, memory capability, and registered lifecycle hooks.

Retrieval troubleshooting

An empty semantic search result does not always prove absence. Retry with:

  • alternate wording or synonyms
  • the saved path
  • the source agent
  • an approximate time
  • xmemo_memory_list for path-oriented browsing
  • debug: true for query expansion and tracing

Migration from another memory provider

Selecting xmemo-memory replaces the active backend. Existing memories in memory-core, memory-lancedb, or another provider remain in their original store but are no longer queried automatically.

Migrate selected content by reading it from the previous provider and writing it to XMemo, or use an XMemo import workflow. Do not delete the old store until the migration has been verified.

Security and privacy

ControlDefault behavior
Secret handling--stdin, environment SecretRef, or shared user credential
TransportHTTPS required outside localhost
Auto-captureDisabled and permission-gated
Capture filteringRejects known secret patterns and injected context
IdentityNon-secret agent and instance attribution headers
Local stateUser-scoped, permission-hardened cache and outbox
Destructive toolsExact memory references required
Public metadataDiscovery and package metadata contain no user credentials

For sensitive environments, place the OpenClaw data directory on an encrypted user profile or encrypted disk, and clear local XMemo state when rotating accounts or retiring a device.

Development

pnpm install --frozen-lockfile
pnpm typecheck
pnpm lint
pnpm test
pnpm build
pnpm pack

Verify the compiled package entry point:

node scripts/verify-plugin.mjs <unpacked-package-directory>

The release workflow tests the minimum supported OpenClaw baseline and a forward-compatibility version before publishing to npm and ClawHub.

Agent-readable metadata

FieldValue
Package@xmemo/openclaw-memory
Plugin IDxmemo-memory
Runtime roleNative OpenClaw memory provider
Recommended pairingXMemo Skill + native plugin
Companion Skillhttps://clawhub.ai/xmemo/xmemo
Plugin listinghttps://clawhub.ai/plugins/@xmemo/openclaw-memory
Product pagehttps://xmemo.dev/product/mcp
Discoveryhttps://xmemo.dev/.well-known/agent-discovery.json
OpenClaw confighttps://xmemo.dev/v1/mcp/config/openclaw
Hosted MCPhttps://xmemo.dev/mcp

If an OpenClaw-compatible setup agent sees only https://xmemo.dev, it should read the public discovery document and prefer the Skill + native plugin pairing. Other MCP-compatible clients should use hosted MCP unless they have a native XMemo integration.