Skip to contentMemoryRouterDocs
IntegrationsCoding agents

MemoryRouter / Documentation

OpenClaw

Give OpenClaw persistent memory in under a minute.

Use the published mr-memory npm plugin for relay-based recall/capture and an optional, separate historical workspace/session upload. ClawHub listing status is unverified; the explicit npm source below is the audited path.


Prerequisites

  • A working OpenClaw gateway with its model provider already configured.
  • Node/npm and permission to install plugins and restart that gateway.
  • A MemoryRouter account and writable key for the intended vault.
  • HTTPS access to api.memoryrouter.ai; inference keys remain configured in OpenClaw.

Treat the historical upload below as optional. Review the files it will read before uploading private workspaces or old conversations.

Quick Start (under a minute)

Step 1: Install the plugin

openclaw plugins install npm:mr-memory

Step 2: Add your memory key

openclaw mr <your-memory-key>

Step 3: Upload your existing history

openclaw mr upload

This is a separate historical-import operation. It scans the configured workspace and session paths and uploads the supported content it finds. Installing or enabling the relay alone does not import old history. Check openclaw mr status after the upload and supply explicit paths for content outside the configured locations.

Get your Memory Key at app.memoryrouter.ai.


How Your Memory Stays in Sync

After the initial upload, MemoryRouter keeps everything current automatically:

TriggerWhat syncsWhen
๐Ÿ”„ Gateway startupWorkspace filesEvery time OpenClaw starts, catching anything that changed while you were away
๐Ÿ’ฌ New sessionWorkspace filesEvery new session, catching files changed between sessions
๐Ÿ–๏ธ ManualEverythingopenclaw mr upload when you choose to upload again

New direct user/assistant conversation is captured at agent_end. Tool use, subagent work, and internal processing are excluded. That ongoing capture is separate from file sync and historical upload.

Sync is debounced at 60 seconds. If startup sync just ran, the first session won't re-sync. But if you edit a file 2 minutes later and start a new session, it catches it.

Smart hash manifest: only files that actually changed get updated. No rebuilding the entire index every time.

Starting fresh

If you ever need to nuke your vault and rebuild from scratch:

openclaw mr delete    # Clear the vault
openclaw mr upload    # Rebuild from your current workspace + sessions

How It Works

User โ†’ OpenClaw (+ relevant memories injected locally) โ†’ Provider โ†’ Response

MemoryRouter replaces OpenClaw's built-in memory with persistent cloud memory. When you chat, it retrieves relevant memories and injects them into the system prompt. At agent_end, it stores the direct user/assistant conversation while excluding tool use, subagent work, and internal processing. Workspace-file sync and historical upload remain separate operations.

Relay, not proxy. Memories are retrieved and injected through OpenClaw hooks. Inference and provider API keys remain inside OpenClaw and do not pass through MemoryRouter. Memory content is sent to MemoryRouter for storage/retrieval according to the plugin configuration.

openclaw mr off restores everything to stock: built-in memory, workspace indexing, all defaults.


Agent Tools

The plugin registers these tools for your agent:

  • memory_search: semantic search across the vault, with optional tiers and importance filters. Only reflections (tiers 2 and 3) carry importance ratings, so importance filters exclude raw memories.
  • Tier guide: tier 3 holds the highest-level consolidated reflections (identity, principles, what matters most); tier 2 holds reflections of specific meaningful events; tier 1 holds raw verbatim memories. Match filters to the question: broad "most important things" questions use tiers [3] with importance 8 or higher and a large limit such as 250; big-picture overviews use tiers [3] with no importance filter; specific lookups ("find the decision about X") omit tiers and importance entirely, since a high importance filter hides the specific detail being sought; specific events without raw noise use tiers [2] or [2, 3]; for exact verbatim detail not already in context, search tiers [3] and drill down by lineage with memory_inspect through the tier 2 reflections to the raw memories underneath (direct tiers [1] works when the exact wording is known). Mixing tiers is legitimate. Both search tools teach this playbook in their served descriptions.
  • memory_date_search: time-window retrieval for questions like "what happened last week" or "most important things this month". Takes concrete ISO from/to dates, an optional query for in-window relevance ranking, plus tiers and importance filters. Bills like search.
  • memory_get: safe snippet read from local memory files.
  • memory_reflect / memory_commit: the consolidation checkout and commit pair (see Reflections below).
  • memory_inspect: read-only consolidation lineage for a memory id.

Latency and coverage

The relay retrieves prepared context from MemoryRouter instead of relying only on local memory indexing. Actual latency depends on network, vault size, retrieval settings, and the model. This guide does not promise a fixed speedup or compare every OpenClaw version's indexing behavior.

Retrieval is bounded relevant context, not every memory. Model context limits and host lifecycle coverage still apply.

Cron Jobs & Scheduled Tasks

Scheduled tasks can receive relevant memory when they run through the plugin's supported agent lifecycle and resolve an authorized key. They do not receive the entire vault automatically. Verify a harmless scheduled task against a synthetic fact before relying on this for unattended work; excluded internal or consolidation sessions have different capture rules.

Cross-session proof

  1. Run openclaw mr status and confirm that your vault is reachable.
  2. In an ordinary direct conversation, say: "Remember: the synthetic demo project's release phrase is ORCHID-7419."
  3. Let the turn finish and allow ingestion time. Start a fresh conversation, without its prior transcript.
  4. Ask: "What is the demo project's release phrase I told you before?" Confirm ORCHID-7419 is recalled.
  5. If it is missing, ask the agent to use memory_search for the demo project and inspect the result.

Limitations and troubleshooting

  • No recall: confirm the plugin is enabled, the gateway loaded the latest config, both sessions resolve the same vault, and openclaw mr status succeeds.
  • No old history: installing the relay does not backfill transcripts. Use the separate historical-import workflow after reviewing its scope.
  • Network or authentication error: check key, endpoint, HTTPS egress, and account status. Do not paste credentials or private memory into support logs.
  • Capture gap: only supported direct user/assistant conversations are captured. Tool traces, subagent work, and internal events are filtered; a failed request is not proof of durable storage.
  • Shared gateway: agentKeys controls vault resolution. A shared or fallback key means shared recall, not tenant isolation.
  • Removal: disabling or uninstalling does not erase remote memories. Whole-vault deletion is destructive and affects every client sharing that vault.

Commands

CommandDescription
openclaw mr <key>Enable with your memory key
openclaw mr statusShow vault stats
openclaw mr uploadUpload workspace + session history to vault
openclaw mr loggingToggle debug logging on/off
openclaw mr offDisable (restores all OpenClaw defaults)
openclaw mr deleteClear vault

Upload Options

Already been using OpenClaw? All your conversation history and workspace knowledge is sitting on disk. openclaw mr upload discovers and uploads everything:

What gets uploaded automatically:

  • Workspace files: MEMORY.md, memory/**/*.md, AGENTS.md, TOOLS.md
  • Session transcripts from ~/.openclaw/agents/main/sessions/

Custom paths:

openclaw mr upload [path]              # Specific file or directory
openclaw mr upload --workspace <dir>   # Custom workspace directory
openclaw mr upload --brain <dir>       # Custom state dir (sessions from another agent)

After the initial upload, supported workspace-file sync can continue through the documented triggers. Direct user/assistant conversation is captured at agent_end; the plugin does not capture every internal event or tool trace.


Smart Storage

Only direct user โ†” AI conversation is stored. The following are excluded automatically:

  • Tool use iterations (function calls, tool results)
  • Subagent work
  • Internal processing
  • System noise (heartbeats, compaction flushes, audit messages)

This keeps your memory vault clean and relevant, with no noise from intermediate tool calls or system overhead.


Provider boundary

The relay is provider-independent because it runs in OpenClaw before model input and at agent end. It does not intercept or proxy provider requests. Provider credentials and inference remain with OpenClaw; only configured memory content is sent to MemoryRouter.


Configuration

After running openclaw mr <key>, the config is stored in your OpenClaw config:

{
  "plugins": {
    "entries": {
      "mr-memory": {
        "enabled": true,
        "config": {
          "key": "mk_xxx",
          "endpoint": "https://api.memoryrouter.ai"
        }
      }
    }
  }
}

Multi-Agent

Running multiple agents on one gateway? Each agent can be mapped to a separate memory vault. Unmapped agents fall back to the shared key, so configure and test isolation explicitly. See the Multi-Agent Setup guide.

Custom Endpoint

If you're running a self-hosted MemoryRouter instance, the endpoint is configurable in the plugin config.


Disable / Remove

# Disable (restores all OpenClaw defaults, keeps your memories in the vault)
openclaw mr off

# Delete all memories
openclaw mr delete

# Uninstall the plugin entirely
openclaw plugins uninstall mr-memory

openclaw mr off restores everything to stock: built-in memory, workspace indexing, all defaults.


After OpenClaw Updates

After running openclaw update, update the plugin:

openclaw plugins update mr-memory

Reflections

The Reflection Hierarchy is fully wired into this plugin. Your vault tracks reflection debt server-side, and the plugin consolidates it three ways:

  • Automatic consolidation (default on). When a memory injection response reports debt above the server's threshold, the plugin starts a dedicated isolated agent turn through the OpenClaw gateway (a background subagent session, never your main conversation). That turn's only instruction is to call the plugin's own memory_reflect and memory_commit tools: your agent's model writes the reflections, so the inference cost is your own model spend. Up to 3 batches run per trigger with a debt re-check between batches, a machine-wide lockfile (~/.memoryrouter/consolidate.lock, stale after 20 minutes) prevents double-firing, and a 30 minute cooldown after each completed run prevents churn. The consolidation session is excluded from memory capture and injection, its transcript is deleted afterward, and failures never surface in your conversation; everything is logged to ~/.memoryrouter/consolidate.log.
  • Agent tools. memory_reflect, memory_commit, and memory_inspect are registered for the agent, so your agent can also consolidate mid-conversation when it sees the hint.
  • The consolidation hint. Prepared context carries a one-line suggestion whenever debt is above threshold, and openclaw mr reflect prints the current debt status.

Opting out: set "autoConsolidate": false in the plugin config (plugins.entries.mr-memory.config in ~/.openclaw/openclaw.json), then restart the gateway. The hint and the agent tools keep working; only the automatic background trigger is disabled.

Cost: the reflecting model is your own OpenClaw agent model (you pay your own inference). MemoryRouter bills the consolidation checkout and commit tokens at the normal 1x raw rate, as documented on the Reflections page.


Pricing

PlanPriceIncludes
Trial$0 for 14 daysFull access during the trial. Accounts created before 2026-06-05 keep their original 50M included-token allowance.
Pro$0.10 / 1M tokensPay as you go. Auto-charges when balance is low.

Get your Memory Key at app.memoryrouter.ai.

Next steps

View the integration ยท Create an account ยท All integrations

On this page