All Products
Search
Document Center

Hologres:Integrate Hologres long memory service with OpenClaw

Last Updated:Jun 29, 2026

OpenClaw is an open-source personal AI assistant platform that supports interaction with AI through multiple messaging channels. This topic describes how to integrate OpenClaw with the Hologres long memory service to add persistent, cross-session memory to your AI Agent.

Prerequisites

  • An OpenClaw gateway is deployed, and the CLI and Gateway versions match (version 2026.6.10 or later is recommended).

  • A Hologres long memory service instance is created in the Hologres console. For more information, see Create and use long memory service.

  • The OpenClaw host can reach the long memory service endpoint. Use the private endpoint for same-VPC deployments. For cross-VPC or local access, add the host IP to the instance allowlist (see Service security management).

Step 1: Install the OpenClaw mem0 plugin

The Hologres long memory service communicates with OpenClaw through the official mem0 plugin. Run the following command to install the plugin:

openclaw plugins install @mem0/openclaw-mem0

After installation, the plugin is registered as openclaw-mem0. The system prompts you to restart the gateway to load the plugin.

Step 2: Configure OpenClaw to connect to the Hologres long memory service

Run the openclaw config patch command to write the following configuration to the OpenClaw configuration file ~/.openclaw/openclaw.json. This enables and configures the openclaw-mem0 plugin:

cat > /tmp/mem0config.json << 'EOF'
{
  "plugins": {
    "allow": ["openclaw-mem0"],
    "entries": {
      "openclaw-mem0": {
        "enabled": true,
        "config": {
          "mode": "platform",
          "baseUrl": "http://<your-hologres-mem0-endpoint>:80",
          "apiKey": "<your-hologres-mem0-api-key>",
          "userId": "<your-user-id>",
          "autoCapture": true,
          "autoRecall": true
        },
        "hooks": {
          "allowConversationAccess": true
        }
      }
    },
    "slots": {
      "memory": "openclaw-mem0"
    }
  }
}
EOF

openclaw config patch --file /tmp/mem0config.json

Parameters:

Parameter

Description

mode

Set to platform. This indicates that the plugin connects to the managed Hologres long memory service endpoint.

baseUrl

The endpoint of the long memory service. The value must include the http:// prefix. Use the internal endpoint for same-VPC access. Use the public endpoint for cross-VPC or on-premises access. Make sure that the IP allowlist is configured. For more information about how to obtain the endpoint, see Obtain connection information.

apiKey

The API key of the long memory service. For more information about how to obtain the API key, see Obtain connection information.

userId

A user identifier used to isolate memory data between different users.

autoCapture

Specifies whether to automatically extract facts from conversations and write them to long memory. Set to true to enable this feature.

autoRecall

Specifies whether to automatically recall relevant memories during conversations. Set to true to enable this feature.

enabled

Specifies whether to enable the plugin. Set to true to enable the plugin.

hooks.allowConversationAccess

Grants the plugin access to conversation content. This is required for autoCapture to work.

plugins.slots.memory

Binds the memory slot to the openclaw-mem0 plugin so that OpenClaw routes memory operations to this plugin.

plugins.allow

An explicitly declared list of plugin IDs that agents are allowed to load. This list must include openclaw-mem0. Otherwise, agents cannot use the memory capability.

Step 3: Restart the OpenClaw gateway

Run the following command to restart the gateway and load the plugin:

openclaw gateway restart

To verify that the plugin is connected, run the following command:

openclaw mem0 status --json

Expected response:

{
  "ok": true,
  "mode": "platform",
  "connected": true,
  "userId": "<your-user-id>"
}

If connected is false, verify that baseUrl and apiKey are correct and that the outbound IP address of the OpenClaw environment is added to the IP allowlist of the long memory service.

Step 4: Use the long memory service in OpenClaw

Use the built-in mem0 subcommands in OpenClaw to manage memories in the long memory service.

Add a memory

openclaw mem0 add --json "My favorite programming language is Python."

Expected response:

{
  "ok": true,
  "memories": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "memory": "User's favorite programming language is Python",
      "event": "ADD"
    }
  ]
}

The id in the response is the unique identifier for the memory entry. You can use it to query or delete the memory later.

Search memories

openclaw mem0 search --json "What is my favorite programming language?"

Expected response:

{
  "ok": true,
  "results": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "memory": "User's favorite programming language is Python",
      "score": 0.35,
      "scope": "long-term"
    }
  ]
}

The score indicates the semantic similarity between the query and the memory. A higher score means a closer match.

Get a single memory

openclaw mem0 get --json <memory-id>

Replace <memory-id> with the id returned when you added the memory.

Delete a memory

Delete a single memory by its ID:

openclaw mem0 delete --json <memory-id>
Important

Important

The delete operation is irreversible. Make sure you have the correct memory ID before you proceed.

List all memories

openclaw mem0 list --json

Example: Cross-session memory recall

If a model provider is configured, you can use openclaw agent to verify that memories persist across sessions and that new facts are automatically captured.

To use Model Studio as a model provider, see OpenClaw in Alibaba Cloud Model Studio documentation.

  1. Add a test memory.

    openclaw mem0 add --json "My favorite programming language is Python."
  2. Start a new session and ask the agent a question to verify memory recall.

    openclaw agent --session-key test:memory:recall \
         --message "What is my favorite programming language?" \
         --timeout 120

    The agent should respond with something like: Your favorite programming language is Python.

  3. In the same session, tell the agent a new fact to verify autoCapture.

    openclaw agent --session-key test:memory:recall \
         --message "I also enjoy hiking on weekends." \
         --timeout 120
  4. Wait about 10 seconds, then check whether the memory was automatically captured.

    openclaw mem0 list --json
    openclaw mem0 search --json "hiking"

    You should see a new memory entry such as User enjoys hiking on weekends.

FAQ

The plugin installation fails with a missing compiled JS entry point

Cause: You installed the raw openclaw-mem0 package instead of the official precompiled package.

Solution: Run openclaw plugins install @mem0/openclaw-mem0 to install the official precompiled package.

openclaw mem0 status returns connected: false

Troubleshoot in the following order:

  1. Verify that baseUrl includes the http:// prefix and the port number (for example, :80).

  2. Verify that apiKey matches the value shown in the Hologres console.

  3. Verify that the outbound IP address of the OpenClaw environment is added to the IP allowlist of the long memory service. A successful ping does not guarantee that the HTTP endpoint is reachable.

  4. Verify that you ran openclaw gateway restart after the configuration change.

Configuration changes do not take effect

The openclaw config patch command merges configurations recursively by default. If changes do not take effect, check the following:

  • The configuration is written to the correct plugins.entries.openclaw-mem0 path.

  • plugins.slots.memory is bound to openclaw-mem0.

  • plugins.allow includes openclaw-mem0.