🧠

Memory / Knowledge Graph

Persistent long-term memory for your assistant.

Category: Cognitive
Difficulty: Easy

Quick Configuration

Choose the setup that matches your environment.

Before You Start

  • Confirm you have the account, endpoint, or API key required for Memory / Knowledge Graph.
  • Start with minimum scopes and read-only access where possible.
  • Keep secrets in environment variables instead of hardcoding them in JSON.
Last verified: 2026-06-13
Environment: Node.js 18+, @modelcontextprotocol/server-memory over stdio (knowledge-graph memory)
Install command: npx -y @modelcontextprotocol/server-memory

Local config

JSON
Local config json
{
  "memory": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-memory"],
    "env": {
      "MEMORY_FILE_PATH": "${MEMORY_FILE_PATH}"
    }
  }
}

After copying

Check the Memory / Knowledge Graph JSON before running it in OpenClaw, then verify the server with a real prompt.

Verify prompt

Remember that my name is Alex and I prefer TypeScript, then ask what you know about me.

Expected success output

The server should store the entities and recall them in a later turn from its knowledge graph.

Common Pitfalls & Fixes

  • ⚠️ Watch out: Explain benefits; show before/after conversations.
  • 🔑 Always store API keys in environment variables, never hardcode them in JSON.
  • 🛡️ Start with read-only scopes if available to verify connection safely.

Security checklist

  • The knowledge graph persists across sessions; do not store secrets or sensitive personal data in it.
  • Keep the memory file in a private location, not a shared or committed path.

Common errors

Error Cause Fix
Memory tools missing The host was not restarted after adding the server. Reload OpenClaw and confirm the memory tools appear in the tool list.
EACCES / cannot write memory file MEMORY_FILE_PATH points to an unwritable location. Set MEMORY_FILE_PATH to a writable file, or omit it to use the default.
Memory does not persist The default file lives in a temp path that resets. Set MEMORY_FILE_PATH to a stable, private file path.

Example Prompts

Once connected, try these prompts to test capabilities:

  • Break down a complex task into clear steps.
  • Compare two approaches and list tradeoffs.
  • Draft a decision checklist for a new MCP setup.

Verification Checklist

  • Run 1-2 real prompts to confirm Memory / Knowledge Graph returns usable data.
  • Check that error messages are clear enough for troubleshooting.
  • Document the required scopes, dependencies, and env vars for future reuse.