clawmem 0.8.3 → 0.8.4
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/CLAUDE.md +10 -11
- package/README.md +6 -2
- package/SKILL.md +6 -3
- package/package.json +1 -1
- package/src/clawmem.ts +89 -17
- /package/src/openclaw/{plugin.json → openclaw.plugin.json} +0 -0
package/CLAUDE.md
CHANGED
|
@@ -206,18 +206,17 @@ systemctl --user status clawmem-watcher.service clawmem-embed.timer
|
|
|
206
206
|
|
|
207
207
|
When using ClawMem with OpenClaw, choose one of two deployment options:
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
**Active Memory coexistence:** ClawMem is fully compatible with OpenClaw's Active Memory plugin (v2026.4.10+). They search different backends (ClawMem vault vs dreaming/wiki) and inject into different prompt regions (user prompt vs system prompt). Both can run simultaneously — no configuration needed.
|
|
210
|
+
|
|
211
|
+
**OpenClaw v2026.4.10+ recommended:** Fixes a config normalization bug where `plugins.slots.contextEngine` was silently dropped (#64192).
|
|
210
212
|
|
|
211
|
-
|
|
213
|
+
### Option 1: ClawMem Exclusive (Recommended)
|
|
212
214
|
|
|
213
|
-
|
|
214
|
-
- No context window waste (avoids 10-15% duplicate injection)
|
|
215
|
-
- Prevents OpenClaw native memory auto-initialization on updates
|
|
216
|
-
- All memory in ClawMem's hybrid search + graph traversal system
|
|
215
|
+
ClawMem handles 100% of structured memory. Disable native memory search (not Active Memory — that's separate and compatible):
|
|
217
216
|
|
|
218
217
|
**Configuration:**
|
|
219
218
|
```bash
|
|
220
|
-
# Disable OpenClaw's native memory
|
|
219
|
+
# Disable OpenClaw's native memory search
|
|
221
220
|
openclaw config set agents.defaults.memorySearch.extraPaths "[]"
|
|
222
221
|
|
|
223
222
|
# Verify
|
|
@@ -235,7 +234,7 @@ ls ~/.openclaw/agents/main/memory/
|
|
|
235
234
|
|
|
236
235
|
### Option 2: Hybrid (ClawMem + Native)
|
|
237
236
|
|
|
238
|
-
Run both ClawMem and OpenClaw's native memory for redundancy.
|
|
237
|
+
Run both ClawMem and OpenClaw's native memory search for redundancy.
|
|
239
238
|
|
|
240
239
|
**Configuration:**
|
|
241
240
|
```bash
|
|
@@ -243,9 +242,9 @@ openclaw config set agents.defaults.memorySearch.extraPaths '["~/documents", "~/
|
|
|
243
242
|
```
|
|
244
243
|
|
|
245
244
|
**Tradeoffs:**
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
245
|
+
- Redundant recall from two independent systems
|
|
246
|
+
- 10-15% context window waste from duplicate facts
|
|
247
|
+
- Two memory indices to maintain
|
|
249
248
|
|
|
250
249
|
**Recommendation:** Use Option 1 unless you have a specific need for redundant memory systems.
|
|
251
250
|
|
package/README.md
CHANGED
|
@@ -186,7 +186,7 @@ clawmem setup mcp # Register MCP server in ~/.claude.json (31 tools)
|
|
|
186
186
|
ClawMem registers as a native ContextEngine plugin - OpenClaw's pluggable interface for context management. Same 90/10 automatic retrieval, delivered through OpenClaw's lifecycle system instead of Claude Code hooks.
|
|
187
187
|
|
|
188
188
|
```bash
|
|
189
|
-
clawmem setup openclaw #
|
|
189
|
+
clawmem setup openclaw # Auto-installs plugin, prints remaining steps
|
|
190
190
|
```
|
|
191
191
|
|
|
192
192
|
**What the plugin provides:**
|
|
@@ -196,11 +196,15 @@ clawmem setup openclaw # Shows installation steps
|
|
|
196
196
|
- **5 agent tools** - `clawmem_search`, `clawmem_get`, `clawmem_session_log`, `clawmem_timeline`, `clawmem_similar`
|
|
197
197
|
- **Session lifecycle hooks** - `session_start`, `session_end`, `before_reset` safety net
|
|
198
198
|
|
|
199
|
-
Disable OpenClaw's native memory
|
|
199
|
+
Disable OpenClaw's native memory search to avoid duplicate injection:
|
|
200
200
|
```bash
|
|
201
201
|
openclaw config set agents.defaults.memorySearch.extraPaths "[]"
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
+
ClawMem coexists cleanly with OpenClaw's [Active Memory](https://docs.openclaw.ai/concepts/active-memory) plugin (v2026.4.10+) — they search different backends and inject into different prompt regions, so both can run simultaneously without conflict. See the [OpenClaw plugin guide](docs/guides/openclaw-plugin.md#coexistence-with-openclaw-active-memory) for details.
|
|
205
|
+
|
|
206
|
+
> **OpenClaw v2026.4.10+** recommended — fixes a config normalization bug where `plugins.slots.contextEngine` was silently dropped (#64192).
|
|
207
|
+
|
|
204
208
|
**Alternative:** OpenClaw agents can also use ClawMem's MCP server directly (`clawmem setup mcp`), with or without hooks. This gives full access to all 31 MCP tools but bypasses OpenClaw's ContextEngine lifecycle, so you lose token budget awareness, native compaction orchestration, and the `afterTurn()` message pipeline. The ContextEngine plugin is recommended for new OpenClaw setups; MCP is available as an additional or standalone integration.
|
|
205
209
|
|
|
206
210
|
#### Hermes Agent
|
package/SKILL.md
CHANGED
|
@@ -605,12 +605,15 @@ Phase 3 deductive synthesis applies the same `contradicts` link for any draft th
|
|
|
605
605
|
|
|
606
606
|
## OpenClaw Integration
|
|
607
607
|
|
|
608
|
+
**Active Memory coexistence:** ClawMem is fully compatible with OpenClaw's Active Memory plugin (v2026.4.10+). They search different backends and inject into different prompt regions — both can run simultaneously. The deployment options below control native memory search (`memorySearch.extraPaths`), not Active Memory.
|
|
609
|
+
|
|
610
|
+
**OpenClaw v2026.4.10+ recommended** — fixes contextEngine slot being silently dropped during config normalization (#64192).
|
|
611
|
+
|
|
608
612
|
### Option 1: ClawMem Exclusive (Recommended)
|
|
609
613
|
|
|
610
|
-
ClawMem handles 100% of memory.
|
|
614
|
+
ClawMem handles 100% of structured memory. Disable native memory search:
|
|
611
615
|
|
|
612
616
|
```bash
|
|
613
|
-
# Disable OpenClaw's native memory
|
|
614
617
|
openclaw config set agents.defaults.memorySearch.extraPaths "[]"
|
|
615
618
|
```
|
|
616
619
|
|
|
@@ -618,7 +621,7 @@ openclaw config set agents.defaults.memorySearch.extraPaths "[]"
|
|
|
618
621
|
|
|
619
622
|
### Option 2: Hybrid
|
|
620
623
|
|
|
621
|
-
Run both ClawMem and OpenClaw native memory.
|
|
624
|
+
Run both ClawMem and OpenClaw native memory search.
|
|
622
625
|
|
|
623
626
|
```bash
|
|
624
627
|
openclaw config set agents.defaults.memorySearch.extraPaths '["~/documents", "~/notes"]'
|
package/package.json
CHANGED
package/src/clawmem.ts
CHANGED
|
@@ -1300,43 +1300,115 @@ function cmdPath() {
|
|
|
1300
1300
|
|
|
1301
1301
|
async function cmdSetupOpenClaw(args: string[]) {
|
|
1302
1302
|
const remove = args.includes("--remove");
|
|
1303
|
-
const binPath = findClawmemBinary();
|
|
1304
1303
|
const pluginDir = pathResolve(import.meta.dir, "openclaw");
|
|
1304
|
+
const extensionsDir = pathResolve(process.env.HOME || "~", ".openclaw", "extensions");
|
|
1305
|
+
const linkPath = pathResolve(extensionsDir, "clawmem");
|
|
1306
|
+
|
|
1307
|
+
// Check if openclaw CLI is available
|
|
1308
|
+
const hasOpenClawCli = (() => {
|
|
1309
|
+
try {
|
|
1310
|
+
const r = Bun.spawnSync(["openclaw", "--version"], { stdout: "pipe", stderr: "pipe" });
|
|
1311
|
+
return r.exitCode === 0;
|
|
1312
|
+
} catch { return false; }
|
|
1313
|
+
})();
|
|
1305
1314
|
|
|
1306
1315
|
if (remove) {
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1316
|
+
// Actually uninstall — mirror of install behavior
|
|
1317
|
+
let removed = false;
|
|
1318
|
+
try {
|
|
1319
|
+
const stat = await import("fs").then(m => m.lstatSync(linkPath));
|
|
1320
|
+
if (stat.isSymbolicLink() || stat.isDirectory()) {
|
|
1321
|
+
const { unlinkSync, rmSync } = await import("fs");
|
|
1322
|
+
if (stat.isSymbolicLink()) {
|
|
1323
|
+
unlinkSync(linkPath);
|
|
1324
|
+
} else {
|
|
1325
|
+
rmSync(linkPath, { recursive: true });
|
|
1326
|
+
}
|
|
1327
|
+
console.log(`${c.green}Removed plugin from ${linkPath}${c.reset}`);
|
|
1328
|
+
removed = true;
|
|
1329
|
+
}
|
|
1330
|
+
} catch (e: any) {
|
|
1331
|
+
if (e.code !== "ENOENT") throw e;
|
|
1332
|
+
console.log(`${c.dim}Plugin not installed at ${linkPath}${c.reset}`);
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
if (hasOpenClawCli) {
|
|
1336
|
+
Bun.spawnSync(["openclaw", "config", "set", "plugins.slots.contextEngine", "legacy"], { stdout: "inherit", stderr: "inherit" });
|
|
1337
|
+
console.log(`${c.green}Reset context engine slot to legacy${c.reset}`);
|
|
1338
|
+
} else if (removed) {
|
|
1339
|
+
console.log(`${c.dim}openclaw CLI not found — manually run: openclaw config set plugins.slots.contextEngine legacy${c.reset}`);
|
|
1340
|
+
}
|
|
1310
1341
|
return;
|
|
1311
1342
|
}
|
|
1312
1343
|
|
|
1313
|
-
//
|
|
1344
|
+
// Verify plugin source files exist
|
|
1314
1345
|
if (!existsSync(pathResolve(pluginDir, "index.ts"))) {
|
|
1315
1346
|
die(`OpenClaw plugin files not found at ${pluginDir}`);
|
|
1316
1347
|
}
|
|
1348
|
+
if (!existsSync(pathResolve(pluginDir, "openclaw.plugin.json"))) {
|
|
1349
|
+
die(`Plugin manifest not found at ${pluginDir}/openclaw.plugin.json`);
|
|
1350
|
+
}
|
|
1317
1351
|
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1352
|
+
// Create extensions directory
|
|
1353
|
+
if (!existsSync(extensionsDir)) {
|
|
1354
|
+
mkdirSync(extensionsDir, { recursive: true });
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
// Remove stale symlink/directory if present
|
|
1358
|
+
try {
|
|
1359
|
+
const { lstatSync, unlinkSync, rmSync } = await import("fs");
|
|
1360
|
+
const stat = lstatSync(linkPath);
|
|
1361
|
+
if (stat.isSymbolicLink()) {
|
|
1362
|
+
const { readlinkSync } = await import("fs");
|
|
1363
|
+
const target = readlinkSync(linkPath);
|
|
1364
|
+
if (target === pluginDir) {
|
|
1365
|
+
console.log(`${c.dim}Symlink already correct at ${linkPath}${c.reset}`);
|
|
1366
|
+
} else {
|
|
1367
|
+
unlinkSync(linkPath);
|
|
1368
|
+
console.log(`${c.dim}Replaced stale symlink (was → ${target})${c.reset}`);
|
|
1369
|
+
}
|
|
1370
|
+
} else if (stat.isDirectory()) {
|
|
1371
|
+
rmSync(linkPath, { recursive: true });
|
|
1372
|
+
console.log(`${c.dim}Replaced existing directory at ${linkPath}${c.reset}`);
|
|
1373
|
+
} else {
|
|
1374
|
+
// Regular file or other non-symlink, non-directory — conflict
|
|
1375
|
+
die(`${linkPath} exists but is not a symlink or directory. Remove it manually and re-run setup.`);
|
|
1376
|
+
}
|
|
1377
|
+
} catch (e: any) {
|
|
1378
|
+
if (e.code !== "ENOENT") throw e;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
// Create symlink
|
|
1382
|
+
if (!existsSync(linkPath)) {
|
|
1383
|
+
const { symlinkSync } = await import("fs");
|
|
1384
|
+
symlinkSync(pluginDir, linkPath);
|
|
1385
|
+
}
|
|
1386
|
+
console.log(`${c.green}Installed plugin: ${linkPath} → ${pluginDir}${c.reset}`);
|
|
1387
|
+
|
|
1388
|
+
// Version warning
|
|
1322
1389
|
console.log();
|
|
1323
|
-
console.log(`${c.bold}
|
|
1390
|
+
console.log(`${c.bold}Note:${c.reset} OpenClaw v2026.4.10+ recommended — earlier versions`);
|
|
1391
|
+
console.log(`have a bug where plugins.slots.contextEngine is silently dropped`);
|
|
1392
|
+
console.log(`during config normalization (openclaw/openclaw#64192).`);
|
|
1393
|
+
|
|
1394
|
+
// Remaining steps — gateway must restart BEFORE setting the context engine slot,
|
|
1395
|
+
// otherwise OpenClaw hasn't discovered the plugin yet and the slot assignment
|
|
1396
|
+
// fails or is ignored (the exact bug reported in issue #5).
|
|
1324
1397
|
console.log();
|
|
1325
|
-
console.log(
|
|
1326
|
-
console.log(` ${c.cyan}ln -s ${pluginDir} ~/.openclaw/extensions/clawmem${c.reset}`);
|
|
1398
|
+
console.log(`${c.bold}Next steps:${c.reset}`);
|
|
1327
1399
|
console.log();
|
|
1328
|
-
console.log(`
|
|
1329
|
-
console.log(` ${c.cyan}
|
|
1400
|
+
console.log(` 1. Restart OpenClaw gateway to discover the plugin:`);
|
|
1401
|
+
console.log(` ${c.cyan}openclaw gateway restart${c.reset}`);
|
|
1330
1402
|
console.log();
|
|
1331
|
-
console.log(`
|
|
1403
|
+
console.log(` 2. Set ClawMem as the active context engine (after restart):`);
|
|
1332
1404
|
console.log(` ${c.cyan}openclaw config set plugins.slots.contextEngine clawmem${c.reset}`);
|
|
1333
1405
|
console.log();
|
|
1334
|
-
console.log(`
|
|
1406
|
+
console.log(` 3. Configure GPU endpoints (if not using defaults):`);
|
|
1335
1407
|
console.log(` ${c.cyan}openclaw config set plugins.entries.clawmem.config.gpuEmbed http://YOUR_GPU:8088${c.reset}`);
|
|
1336
1408
|
console.log(` ${c.cyan}openclaw config set plugins.entries.clawmem.config.gpuLlm http://YOUR_GPU:8089${c.reset}`);
|
|
1337
1409
|
console.log(` ${c.cyan}openclaw config set plugins.entries.clawmem.config.gpuRerank http://YOUR_GPU:8090${c.reset}`);
|
|
1338
1410
|
console.log();
|
|
1339
|
-
console.log(`
|
|
1411
|
+
console.log(` 4. Start the REST API (for agent tools):`);
|
|
1340
1412
|
console.log(` ${c.cyan}clawmem serve &${c.reset}`);
|
|
1341
1413
|
console.log();
|
|
1342
1414
|
console.log(`${c.dim}ClawMem will work alongside Claude Code hooks — both modes share the same vault.${c.reset}`);
|
|
File without changes
|