You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
This PR updates the MemOS-Cloud-OpenClaw-Plugin to the latest version
via git subtree .
- Summary of change : Synced the latest commits from the upstream plugin
repository ( MemTensor/MemOS-Cloud-OpenClaw-Plugin ) into the
apps/MemOS-Cloud-OpenClaw-Plugin directory.
- Problem it solves : Ensures the main MemOS repository uses the most
up-to-date version of the OpenClaw plugin, including recent bug fixes
and feature enhancements.
- Implementation approach : Used git subtree pull
--prefix=apps/MemOS-Cloud-OpenClaw-Plugin to sync the changes from the
upstream plugin repository.
## Type of change
Please delete options that are not relevant.
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
## How Has This Been Tested?
I have verified the plugin functionality in the local development
environment.
- [ ] Unit Test
- [x] Test Script Or Test Steps (please provide)
1. Started the local MemOS development server.
2. Verified that the `MemOS-Cloud-OpenClaw-Plugin` loads correctly
without errors.
3. Tested the core functionalities of the updated plugin
- [ ] Pipeline Automated API Test (please provide)
## Checklist
- [x] I have performed a self-review of my own code | 我已自行检查了自己的代码
- [ ] I have commented my code in hard-to-understand areas |
我已在难以理解的地方对代码进行了注释
- [x] I have added tests that prove my fix is effective or that my
feature works | 我已添加测试以证明我的修复有效或功能正常
- [ ] I have created related documentation issue/PR in
[MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) (if applicable) |
我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档
issue/PR(如果适用)
- [ ] I have linked the issue to this PR (if applicable) | 我已将 issue
链接到此 PR(如果适用)
- [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR
的人
## Reviewer Checklist
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Made sure Checks passed
- [ ] Tests have been provided
-`MEMOS_USE_DIRECT_SESSION_USER_ID` (default: `false`; when enabled, direct session keys like `agent:main:<provider>:direct:<peer-id>` use `<peer-id>` as MemOS `user_id`)
94
96
-`MEMOS_CONVERSATION_ID` (optional override)
97
+
-`MEMOS_KNOWLEDGEBASE_IDS` (optional; comma-separated global knowledge base IDs for `/search/memory`, e.g., `"kb-123, kb-456"`)
98
+
-`MEMOS_ALLOW_KNOWLEDGEBASE_IDS` (optional; comma-separated knowledge base IDs for `/add/message`, e.g., `"kb-123"`)
@@ -167,6 +182,133 @@ The plugin provides native support for multi-agent architectures (via the `agent
167
182
-**Data Isolation**: The `agent_id` is automatically injected into both `/search/memory` and `/add/message` requests. This ensures completely isolated memory and message histories for different agents, even under the same user or session.
168
183
-**Static Override**: You can also force a specific agent ID by setting `"agentId": "your_agent_id"` in the plugin's `config`.
169
184
185
+
### Per-Agent Memory Toggle
186
+
187
+
In multi-agent mode, you can use `MEMOS_ALLOWED_AGENTS` to control exactly which agents have memory enabled. Agents not in the allowlist will skip both memory recall and memory capture entirely.
188
+
189
+
**Environment variable** (in `~/.openclaw/.env`):
190
+
```env
191
+
MEMOS_MULTI_AGENT_MODE=true
192
+
MEMOS_ALLOWED_AGENTS="agent1,agent2"
193
+
```
194
+
195
+
Separate multiple agent IDs with commas.
196
+
197
+
**Plugin config** (in `openclaw.json`):
198
+
```json
199
+
{
200
+
"plugins": {
201
+
"entries": {
202
+
"memos-cloud-openclaw-plugin": {
203
+
"enabled": true,
204
+
"config": {
205
+
"multiAgentMode": true,
206
+
"allowedAgents": ["agent1", "agent2"]
207
+
}
208
+
}
209
+
}
210
+
}
211
+
}
212
+
```
213
+
214
+
**Behavior**:
215
+
| Config | Effect |
216
+
|--------|--------|
217
+
|`MEMOS_ALLOWED_AGENTS` unset or empty | All agents have memory enabled |
218
+
|`MEMOS_ALLOWED_AGENTS="agent1,agent2"`| Only `agent1` and `agent2` are enabled; others are skipped |
219
+
|`MEMOS_ALLOWED_AGENTS="agent1"`| Only `agent1` is enabled; all other agents are skipped |
220
+
|`MEMOS_MULTI_AGENT_MODE=false`| Allowlist has no effect; all requests use single-agent mode |
221
+
222
+
> **Note**: The allowlist only takes effect when `multiAgentMode=true`. When multi-agent mode is off, memory works for all agents and the allowlist is ignored.
223
+
224
+
### Per-Agent Configuration (agentOverrides)
225
+
226
+
Beyond simple on/off toggles, you can configure **different memory parameters for each agent** using `agentOverrides`. Each agent can have its own knowledge base, recall limits, relativity threshold, and more.
You can use `MEMOS_AGENT_OVERRIDES` to configure a JSON string to override global parameters. Note: `.env` configuration has a lower priority than `agentOverrides` in `openclaw.json`.
|`recallFilterModel`| Model for recall filtering |
297
+
|`recallFilterBaseUrl`| Base URL for recall filter model |
298
+
|`recallFilterApiKey`| API key for recall filter |
299
+
|`allowKnowledgebaseIds`| Knowledge bases for `/add/message`|
300
+
|`tags`| Tags for `/add/message`|
301
+
|`throttleMs`| Throttle interval |
302
+
303
+
## Direct Session User ID
304
+
-**Default behavior**: the plugin still uses the configured `userId` (or `MEMOS_USER_ID`) and stays fully backward compatible.
305
+
-**Enable mode**: set `"useDirectSessionUserId": true` in plugin config or `MEMOS_USE_DIRECT_SESSION_USER_ID=true` in env.
306
+
-**What it does**: when enabled, session keys like `agent:main:<provider>:direct:<peer-id>` reuse `<peer-id>` as MemOS `user_id`.
307
+
-**What it does not do**: non-direct session keys such as `agent:main:<provider>:channel:<channel-id>` keep using the configured fallback `userId`.
308
+
-**Request paths affected**: the same resolver is used by both `buildSearchPayload()` and `buildAddMessagePayload()`, so recall and add stay consistent.
309
+
-**Config precedence**: runtime config still follows the same rule as the rest of the plugin - plugin config first, then `.env` files (`~/.openclaw/.env` -> `~/.moltbot/.env` -> `~/.clawdbot/.env`), then process env.
310
+
311
+
170
312
## Notes
171
313
-`conversation_id` defaults to OpenClaw `sessionKey` (unless `conversationId` is provided). **TODO**: consider binding to OpenClaw `sessionId` directly.
172
314
- Optional **prefix/suffix** via env or config; `conversationSuffixMode=counter` increments on `/new` (requires `hooks.internal.enabled`).
0 commit comments