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
-`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