Use in Agents
In addition to calling the cloud APIs directly, you can connect MemOS to your AI workflow through plugins, MCP, and other integration methods if you use:
- Agent frameworks such as OpenClaw and Hermes.
- AI clients such as Cursor, VS Code, Claude Desktop, Cline, and Chatbox.
These integration methods help you save tokens while adding long-term memory to your Agent workflows.
1. Before You Start
- Register and sign in to the MemOS Cloud platform.
- Get an API Key from the API Key page.
2. Use the Plugin
MemOS currently provides a cloud plugin deeply integrated with OpenClaw. If you use OpenClaw, prefer the plugin integration.
Configure the API Key
The plugin reads OpenClaw-related environment variables or .env files. The minimal configuration is:
MEMOS_API_KEY=YOUR_API_KEY
You can also write it directly into the OpenClaw environment file:
mkdir -p ~/.openclaw
echo 'MEMOS_API_KEY=YOUR_API_KEY' >> ~/.openclaw/.env
Install and enable the plugin
openclaw plugins install @memtensor/memos-cloud-openclaw-plugin@latest
openclaw gateway restart
Confirm that the plugin is enabled in ~/.openclaw/openclaw.json:
{
"plugins": {
"entries": {
"memos-cloud-openclaw-plugin": { "enabled": true }
}
}
}
Start chatting
You can now have multi-turn conversations with OpenClaw:
- First session: "I prefer using Python."
- Second session after restart: "Do you remember which programming language I like?"
3. Use MCP
Mainstream clients that support MCP include Cursor, Claude Desktop, Cline, VS Code / Trae, and Chatbox. Taking Cursor as an example, after configuration, Cursor can directly call MemOS memory tools and use memory across clients.
Add an MCP Server
In Cursor, go to:
Cursor Settings → Tools & MCP → Add Custom MCP
Then add this to mcp.json:
{
"mcpServers": {
"memos-api-mcp": {
"timeout": 60,
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@memtensor/memos-api-mcp@latest"
],
"env": {
"MEMOS_API_KEY": "YOUR_API_KEY",
"MEMOS_USER_ID": "your-user-id",
"MEMOS_CHANNEL": "MODELSCOPE"
}
}
}
}
After configuration, confirm that Cursor's MCP tool list shows tools such as add_message and search_memory.
Cursor Rules
To make Cursor use memories more reliably, add rules like these to User Rules:
Before answering the user's question, call MemOS search_memory to search long-term memories related to the current task.
After answering, if this turn contains new user facts, preferences, project background, or other information useful in the long term, call add_message to write it into MemOS.
Only use memories relevant to the current task. Ignore memories that are irrelevant, outdated, or about the wrong subject.
Do not expose internal implementation details such as "memory store" or "retrieval results" to the user.
Start chatting
- First session: tell it who you are, your hobbies, and your profession, and ask it to remember.
- Second session after restart: ask it who you are.
Which Integration Should You Choose?
| Integration | Best for | Priority |
|---|---|---|
| Plugin | OpenClaw and other Agent environments deeply integrated with MemOS | Prefer first; highest automation |
| MCP | Cursor, Claude Desktop, Cline, Chatbox, and other AI clients | Use when the client supports MCP |
| API / SDK | Self-built Agents, chatbots, or business applications | Most control; best for production integration |