@m3mory/m3moryclaw-plugin
v1.3.0
Published
OpenClaw plugin for m3mory — replaces built-in memory with m3mory API calls
Readme
@m3mory/openclaw-plugin
OpenClaw plugin that replaces the built-in memory with m3mory API calls.
Core concept
- memoryspaceID — the shared memory namespace inside your org. Use the same
memoryspaceIDacross all your bots so they share user memory. - assistantId — the bot identity. Each bot gets its own
assistantIdso m3mory can attribute memories to the right assistant. - API key — carries the org boundary. The
memoryspaceIDscopes which namespace is used within that org.
Simple rule: same
memoryspaceID, differentassistantIdvalues.
Features
- Auto-recall — injects relevant memories before each agent turn (
before_prompt_buildhook) - Auto-capture — ingests conversation messages after each agent turn (
agent_endhook) - Tools —
m3mory_recall,m3mory_remember,m3mory_forget,m3mory_status - Slash commands —
/remember,/recall,/memories,/forget - CLI commands —
openclaw m3mory setup,openclaw m3mory status,openclaw m3mory search
Setup
openclaw m3mory setupThe interactive setup will ask for your memoryspaceID (the shared namespace UUID), your API key, and optionally an assistantId for this specific bot.
Or configure manually in ~/.openclaw/openclaw.json:
{
"plugins": {
"entries": {
"@m3mory/openclaw-plugin": {
"enabled": true,
"config": {
"apiKey": "your-api-key",
"memoryspaceID": "your-namespace-uuid",
"apiUrl": "https://api.m3mory.ai"
}
}
}
}
}Using environment variables:
export M3MORY_API_KEY="your-api-key"
export M3MORY_MEMORYSPACE_ID="your-namespace-uuid"Then in config:
{
"plugins": {
"entries": {
"@m3mory/openclaw-plugin": {
"enabled": true,
"config": {
"apiKey": "${M3MORY_API_KEY}",
"memoryspaceID": "${M3MORY_MEMORYSPACE_ID}"
}
}
}
}
}Multi-assistant pattern
Use the same memoryspaceID for all bots in your org. Give each bot its own assistantId. All bots share the same user memory namespace.
Bot A — Strategy assistant:
{
"memoryspaceID": "your-namespace-uuid",
"assistantId": "strategy"
}Bot B — Support assistant:
{
"memoryspaceID": "your-namespace-uuid",
"assistantId": "support"
}Both bots read from and write to the same memoryspaceID. The assistantId tells m3mory which bot produced each memory. Do not create a new memoryspaceID for every assistant unless you intentionally want separate memory namespaces.
Config options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| apiKey | string | — | Bearer token (or ${M3MORY_API_KEY}) |
| memoryspaceID | string | — | Shared memory namespace UUID (or ${M3MORY_MEMORYSPACE_ID}) |
| assistantId | string | — | Bot identity for this assistant (or ${M3MORY_ASSISTANT_ID}) |
| apiUrl | string | https://api.m3mory.ai | m3mory API base URL |
| autoRecall | boolean | true | Inject memories before each turn |
| autoCapture | boolean | true | Ingest messages after each turn |
| maxRecallResults | number | 10 | Max memories injected per turn |
| recallFormat | text\|structured\|xml | xml | Format for recalled context |
| captureMode | all\|everything | all | all filters noise; everything captures all |
| debug | boolean | false | Verbose debug logging |
Backward compatibility
The legacy agentId field and M3MORY_AGENT_ID environment variable still work. Existing installs continue operating without any changes. The plugin reads memoryspaceID first; if not set, it falls back to agentId.
{ "agentId": "your-namespace-uuid" }is equivalent to:
{ "memoryspaceID": "your-namespace-uuid" }New installs should use memoryspaceID.
API endpoints used
The live API route surface uses /v1/agents/:agentId/* for this phase. The memoryspaceID value is passed as the :agentId path parameter for transport compatibility.
| Operation | Endpoint |
|-----------|----------|
| Auto-recall | POST /v1/agents/{memoryspaceID}/context |
| Auto-capture | POST /v1/agents/{memoryspaceID}/ingest |
| Search | POST /v1/agents/{memoryspaceID}/search |
| List memories | GET /v1/agents/{memoryspaceID}/memories |
| Delete memory | DELETE /v1/agents/{memoryspaceID}/memories/{id} |
