Configure the long-term memory plugin for OpenClaw Agents, enabling cross-session context awareness through the memory API.
Effect Comparison
The following two dialogue examples show the behavioral difference between the default Agent and the Agent with the long-term memory plugin in the same scenario.
Default Agent (No Memory)
First conversation:
User: I'm working on a Python project using the FastAPI framework.
Agent: OK, FastAPI is a high-performance web framework. How can I help?
Second conversation (new session):
User: Help me write an API endpoint.
Agent: What language and framework are you using?
The Agent cannot retain information from the previous session.
Agent with Long-term Memory Plugin
First conversation:
User: I'm working on a Python project using the FastAPI framework.
Agent: OK, FastAPI is a high-performance web framework. How can I help?
Second conversation (new session):
User: Help me write an API endpoint.
The Agent retrieves relevant memory: "The user is working on a FastAPI Python project."
The Agent starts writing the API endpoint.
Installation
Configure the memory plugin in your OpenClaw Agent settings.
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey (required) | string | - | Starts with sk- |
userId (required) | string | - | The user identifier for the memory space |
baseUrl | string | https://dashscope.aliyuncs.com/api/v2/apps/memory | The Bailian memory API endpoint. Set it to https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/memory and replace {workspaceId} with your actual workspace ID |
autoCapture | boolean | true | Automatically extract and store memories after conversations |
autoRecall | boolean | true | Automatically retrieve and inject memories before conversations |
topK | number | 5 | The number of memories returned per search |
Related Documentation
- Memory Overview: creating and managing memory stores and rules.
- Long-term Memory API: API reference for memory write and retrieval.