@memtensor/memos-cloud-openclaw-plugin 0.1.21-beta.0 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -23
- package/clawdbot.plugin.json +1 -1
- package/index.js +15 -28
- package/lib/config-ui-server.js +967 -967
- package/lib/memos-cloud-api.js +37 -11
- package/moltbot.plugin.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +15 -19
- package/telemetry.credentials.json +5 -0
- package/README_ZH.md +0 -309
- package/lib/memos-core/filter.d.ts +0 -5
- package/lib/memos-core/filter.d.ts.map +0 -1
- package/lib/memos-core/filter.js +0 -213
- package/lib/memos-core/filter.js.map +0 -1
- package/lib/memos-core/index.d.ts +0 -9
- package/lib/memos-core/index.d.ts.map +0 -1
- package/lib/memos-core/index.js +0 -8
- package/lib/memos-core/index.js.map +0 -1
- package/lib/memos-core/memos-client.d.ts +0 -23
- package/lib/memos-core/memos-client.d.ts.map +0 -1
- package/lib/memos-core/memos-client.js +0 -173
- package/lib/memos-core/memos-client.js.map +0 -1
- package/lib/memos-core/memos-errors.d.ts +0 -14
- package/lib/memos-core/memos-errors.d.ts.map +0 -1
- package/lib/memos-core/memos-errors.js +0 -14
- package/lib/memos-core/memos-errors.js.map +0 -1
- package/lib/memos-core/memos-response.d.ts +0 -4
- package/lib/memos-core/memos-response.d.ts.map +0 -1
- package/lib/memos-core/memos-response.js +0 -84
- package/lib/memos-core/memos-response.js.map +0 -1
- package/lib/memos-core/payloads.d.ts +0 -31
- package/lib/memos-core/payloads.d.ts.map +0 -1
- package/lib/memos-core/payloads.js +0 -42
- package/lib/memos-core/payloads.js.map +0 -1
- package/lib/memos-core/recall-projection.d.ts +0 -35
- package/lib/memos-core/recall-projection.d.ts.map +0 -1
- package/lib/memos-core/recall-projection.js +0 -95
- package/lib/memos-core/recall-projection.js.map +0 -1
- package/lib/memos-core/serialization.d.ts +0 -5
- package/lib/memos-core/serialization.d.ts.map +0 -1
- package/lib/memos-core/serialization.js +0 -11
- package/lib/memos-core/serialization.js.map +0 -1
- package/lib/memos-core/types.d.ts +0 -114
- package/lib/memos-core/types.d.ts.map +0 -1
- package/lib/memos-core/types.js +0 -2
- package/lib/memos-core/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -21,15 +21,16 @@ A minimal OpenClaw lifecycle plugin that **recalls** memories from MemOS Cloud b
|
|
|
21
21
|
|
|
22
22
|
## Install
|
|
23
23
|
|
|
24
|
-
### Option A —
|
|
25
|
-
|
|
24
|
+
### Option A — NPM (Recommended)
|
|
26
25
|
```bash
|
|
27
26
|
openclaw plugins install @memtensor/memos-cloud-openclaw-plugin@latest
|
|
28
27
|
openclaw gateway restart
|
|
29
28
|
```
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
> **Note for Windows Users**:
|
|
31
|
+
> If you encounter `Error: spawn EINVAL`, this is a known issue with OpenClaw's plugin installer on Windows. Please use **Option B** (Manual Install) below.
|
|
32
32
|
|
|
33
|
+
Make sure it’s enabled in `~/.openclaw/openclaw.json`:
|
|
33
34
|
```json
|
|
34
35
|
{
|
|
35
36
|
"plugins": {
|
|
@@ -40,17 +41,28 @@ Make sure it’s enabled in `~/.openclaw/openclaw.json`:
|
|
|
40
41
|
}
|
|
41
42
|
```
|
|
42
43
|
|
|
43
|
-
### Option B —
|
|
44
|
+
### Option B — Manual Install (Workaround for Windows)
|
|
45
|
+
1. Download the latest `.tgz` from [NPM](https://www.npmjs.com/package/@memtensor/memos-cloud-openclaw-plugin).
|
|
46
|
+
2. Extract it to a local folder (e.g., `C:\Users\YourName\.openclaw\extensions\memos-cloud-openclaw-plugin`).
|
|
47
|
+
3. Configure `~/.openclaw/openclaw.json` (or `%USERPROFILE%\.openclaw\openclaw.json`):
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
openclaw
|
|
50
|
-
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"plugins": {
|
|
52
|
+
"entries": {
|
|
53
|
+
"memos-cloud-openclaw-plugin": { "enabled": true }
|
|
54
|
+
},
|
|
55
|
+
"load": {
|
|
56
|
+
"paths": [
|
|
57
|
+
"C:\\Users\\YourName\\.openclaw\\extensions\\memos-cloud-openclaw-plugin"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
51
62
|
```
|
|
63
|
+
*Note: The extracted folder usually contains a `package` subfolder. Point to the folder containing `package.json`.*
|
|
52
64
|
|
|
53
|
-
|
|
65
|
+
Restart the gateway after config changes.
|
|
54
66
|
|
|
55
67
|
## Environment Variables
|
|
56
68
|
The plugin resolves runtime config in this order: **plugin config → env files**. Due to strict security sandboxing, it **does not** read credentials from process environment variables.
|
|
@@ -152,18 +164,15 @@ In `plugins.entries.memos-cloud-openclaw-plugin.config`:
|
|
|
152
164
|
```
|
|
153
165
|
|
|
154
166
|
## How it Works
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
- Builds a `/add/message` request with the **last turn** by default (user + assistant).
|
|
166
|
-
- Sends `messages` with `user_id`, `conversation_id`, and optional `tags/info/agent_id/app_id`.
|
|
167
|
+
- **Recall** (`before_prompt_build`; falls back to `before_agent_start` on older OpenClaw hosts)
|
|
168
|
+
- Builds a `/search/memory` request using `user_id`, `query` (= prompt + optional prefix), and optional filters.
|
|
169
|
+
- Default **global recall**: when `recallGlobal=true`, it does **not** pass `conversation_id`.
|
|
170
|
+
- Optional second-pass filtering: if `recallFilterEnabled=true`, candidates are sent to your configured model and only returned `keep` items are injected.
|
|
171
|
+
- Injects a stable MemOS recall protocol via `appendSystemContext`, while the retrieved `<memories>` block remains in `prependContext`.
|
|
172
|
+
|
|
173
|
+
- **Add** (`agent_end`)
|
|
174
|
+
- Builds a `/add/message` request with the **last turn** by default (user + assistant).
|
|
175
|
+
- Sends `messages` with `user_id`, `conversation_id`, and optional `tags/info/agent_id/app_id`.
|
|
167
176
|
|
|
168
177
|
## Multi-Agent Support
|
|
169
178
|
The plugin provides native support for multi-agent architectures (via the `agent_id` parameter):
|
package/clawdbot.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "memos-cloud-openclaw-plugin",
|
|
3
3
|
"name": "MemOS Cloud OpenClaw Plugin",
|
|
4
4
|
"description": "MemOS Cloud recall + add memory via lifecycle hooks",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.22",
|
|
6
6
|
"kind": "lifecycle",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"activation": {
|
package/index.js
CHANGED
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
isGatewayRuntimeStartup,
|
|
24
24
|
waitForGatewayReady,
|
|
25
25
|
} from "./lib/config-ui-server.js";
|
|
26
|
-
import { buildMemosAddRequest, buildMemosSearchRequest } from "./lib/memos-core/index.js";
|
|
27
26
|
let lastCaptureTime = 0;
|
|
28
27
|
// ponytail: in-process cache; replace with server idempotency for cross-restart or multi-instance guarantees.
|
|
29
28
|
const recentCaptureKeys = new Set();
|
|
@@ -171,20 +170,16 @@ export function buildSearchPayload(cfg, prompt, ctx) {
|
|
|
171
170
|
payload.filter = { user: userFilter };
|
|
172
171
|
}
|
|
173
172
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
relativity: cfg.relativity,
|
|
185
|
-
...(payload.filter === undefined ? {} : { filter: payload.filter }),
|
|
186
|
-
...(cfg.knowledgebaseIds?.length ? { knowledgebaseIds: cfg.knowledgebaseIds } : {}),
|
|
187
|
-
});
|
|
173
|
+
if (cfg.knowledgebaseIds?.length) payload.knowledgebase_ids = cfg.knowledgebaseIds;
|
|
174
|
+
|
|
175
|
+
payload.memory_limit_number = cfg.memoryLimitNumber;
|
|
176
|
+
payload.include_preference = cfg.includePreference;
|
|
177
|
+
payload.preference_limit_number = cfg.preferenceLimitNumber;
|
|
178
|
+
payload.include_tool_memory = cfg.includeToolMemory;
|
|
179
|
+
payload.tool_memory_limit_number = cfg.toolMemoryLimitNumber;
|
|
180
|
+
payload.relativity = cfg.relativity;
|
|
181
|
+
|
|
182
|
+
return payload;
|
|
188
183
|
}
|
|
189
184
|
|
|
190
185
|
export function buildAddMessagePayload(cfg, messages, ctx) {
|
|
@@ -208,19 +203,11 @@ export function buildAddMessagePayload(cfg, messages, ctx) {
|
|
|
208
203
|
};
|
|
209
204
|
if (Object.keys(info).length > 0) payload.info = info;
|
|
210
205
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
asyncMode: cfg.asyncMode,
|
|
217
|
-
allowPublic: cfg.allowPublic,
|
|
218
|
-
...(payload.tags === undefined ? {} : { tags: payload.tags }),
|
|
219
|
-
...(payload.info === undefined ? {} : { info: payload.info }),
|
|
220
|
-
...(payload.agent_id === undefined ? {} : { agentId: payload.agent_id }),
|
|
221
|
-
...(payload.app_id === undefined ? {} : { appId: payload.app_id }),
|
|
222
|
-
...(cfg.allowKnowledgebaseIds?.length ? { allowKnowledgebaseIds: cfg.allowKnowledgebaseIds } : {}),
|
|
223
|
-
});
|
|
206
|
+
payload.allow_public = cfg.allowPublic;
|
|
207
|
+
if (cfg.allowKnowledgebaseIds?.length) payload.allow_knowledgebase_ids = cfg.allowKnowledgebaseIds;
|
|
208
|
+
payload.async_mode = cfg.asyncMode;
|
|
209
|
+
|
|
210
|
+
return payload;
|
|
224
211
|
}
|
|
225
212
|
|
|
226
213
|
function convertAssistantMessage(msg, cfg) {
|