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-mem0After 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.jsonParameters:
Parameter | Description |
| Set to |
| The endpoint of the long memory service. The value must include the |
| The API key of the long memory service. For more information about how to obtain the API key, see Obtain connection information. |
| A user identifier used to isolate memory data between different users. |
| Specifies whether to automatically extract facts from conversations and write them to long memory. Set to |
| Specifies whether to automatically recall relevant memories during conversations. Set to |
| Specifies whether to enable the plugin. Set to |
| Grants the plugin access to conversation content. This is required for |
| Binds the |
| An explicitly declared list of plugin IDs that agents are allowed to load. This list must include |
Step 3: Restart the OpenClaw gateway
Run the following command to restart the gateway and load the plugin:
openclaw gateway restartTo verify that the plugin is connected, run the following command:
openclaw mem0 status --jsonExpected 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
The delete operation is irreversible. Make sure you have the correct memory ID before you proceed.
List all memories
openclaw mem0 list --jsonExample: 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.
Add a test memory.
openclaw mem0 add --json "My favorite programming language is Python."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 120The agent should respond with something like:
Your favorite programming language is Python.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 120Wait 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:
Verify that
baseUrlincludes thehttp://prefix and the port number (for example,:80).Verify that
apiKeymatches the value shown in the Hologres console.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.
Verify that you ran
openclaw gateway restartafter 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-mem0path.plugins.slots.memoryis bound toopenclaw-mem0.plugins.allowincludesopenclaw-mem0.