memory-braid 0.7.0 → 0.8.0
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 +20 -8
- package/openclaw.plugin.json +2 -2
- package/package.json +1 -1
- package/src/config.ts +2 -2
- package/src/index.ts +3 -3
package/README.md
CHANGED
|
@@ -2,9 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Memory Braid is an OpenClaw `kind: "memory"` plugin that augments local memory search (core/QMD) with Mem0.
|
|
4
4
|
|
|
5
|
+
## Ownership model
|
|
6
|
+
|
|
7
|
+
Memory Braid is intentionally hybrid, but not with shared ownership.
|
|
8
|
+
|
|
9
|
+
- OpenClaw prompt context + compaction are the source of truth for the live session.
|
|
10
|
+
- Core/QMD is the source of truth for written documents, notes, and canonical project knowledge.
|
|
11
|
+
- Mem0 is the source of truth for learned cross-session memory such as preferences, recurring decisions, and procedural learnings.
|
|
12
|
+
|
|
13
|
+
The goal is hybrid retrieval with single ownership per memory class. Memory Braid should not re-own markdown knowledge, and Mem0 should not be treated as the canonical store for documents.
|
|
14
|
+
|
|
5
15
|
## Features
|
|
6
16
|
|
|
7
|
-
- Hybrid recall: local memory + Mem0, merged with weighted RRF.
|
|
17
|
+
- Hybrid recall with split ownership: local memory + Mem0, merged with weighted RRF.
|
|
8
18
|
- Layered Mem0 memory: episodic captures, semantic compendium memories, and procedural agent learnings.
|
|
9
19
|
- Capture-first Mem0 memory: plugin writes only captured memories to Mem0 (no markdown/session indexing).
|
|
10
20
|
- Capture pipeline modes: `local`, `hybrid`, `ml`.
|
|
@@ -99,7 +109,9 @@ Migration:
|
|
|
99
109
|
|
|
100
110
|
- If you relied on bootstrap/reconcile mirroring, pin to `<0.4.0`.
|
|
101
111
|
- For `0.4.0+`, remove `bootstrap` and `reconcile` from your plugin config.
|
|
102
|
-
- Keep
|
|
112
|
+
- Keep OpenClaw prompt context as the source of truth for the live session.
|
|
113
|
+
- Keep core/QMD as the source of truth for markdown and canonical written knowledge.
|
|
114
|
+
- Use Memory Braid + Mem0 for learned cross-session memory, consolidation, and lifecycle management.
|
|
103
115
|
|
|
104
116
|
## Install
|
|
105
117
|
|
|
@@ -110,7 +122,7 @@ On the target machine:
|
|
|
110
122
|
1. Install from npm:
|
|
111
123
|
|
|
112
124
|
```bash
|
|
113
|
-
openclaw plugins install memory-braid@0.
|
|
125
|
+
openclaw plugins install memory-braid@0.8.0
|
|
114
126
|
```
|
|
115
127
|
|
|
116
128
|
2. Rebuild native dependencies inside the installed extension:
|
|
@@ -233,13 +245,13 @@ Add this under `plugins.entries["memory-braid"].config` in your OpenClaw config:
|
|
|
233
245
|
"minScore": 0.65,
|
|
234
246
|
"maxEntitiesPerMemory": 8,
|
|
235
247
|
"startup": {
|
|
236
|
-
"downloadOnStartup":
|
|
248
|
+
"downloadOnStartup": false,
|
|
237
249
|
"warmupText": "John works at Acme in Berlin."
|
|
238
250
|
}
|
|
239
251
|
},
|
|
240
252
|
"consolidation": {
|
|
241
253
|
"enabled": true,
|
|
242
|
-
"startupRun":
|
|
254
|
+
"startupRun": false,
|
|
243
255
|
"intervalMinutes": 360,
|
|
244
256
|
"opportunisticNewMemoryThreshold": 5,
|
|
245
257
|
"opportunisticMinMinutesSinceLastRun": 30,
|
|
@@ -558,7 +570,7 @@ Use this preset when:
|
|
|
558
570
|
"minScore": 0.65,
|
|
559
571
|
"maxEntitiesPerMemory": 8,
|
|
560
572
|
"startup": {
|
|
561
|
-
"downloadOnStartup":
|
|
573
|
+
"downloadOnStartup": false,
|
|
562
574
|
"warmupText": "John works at Acme in Berlin."
|
|
563
575
|
}
|
|
564
576
|
},
|
|
@@ -669,14 +681,14 @@ Entity extraction defaults are:
|
|
|
669
681
|
- `entityExtraction.timeoutMs`: `2500`
|
|
670
682
|
- `entityExtraction.minScore`: `0.65`
|
|
671
683
|
- `entityExtraction.maxEntitiesPerMemory`: `8`
|
|
672
|
-
- `entityExtraction.startup.downloadOnStartup`: `
|
|
684
|
+
- `entityExtraction.startup.downloadOnStartup`: `false`
|
|
673
685
|
- `entityExtraction.startup.warmupText`: `"John works at Acme in Berlin."`
|
|
674
686
|
|
|
675
687
|
When enabled:
|
|
676
688
|
|
|
677
689
|
- Local NER model cache/download path is `<OPENCLAW_STATE_DIR>/memory-braid/models/entity-extraction` (typically `~/.openclaw/memory-braid/models/entity-extraction`).
|
|
678
690
|
- Captured memories get `metadata.entities` and `metadata.entityUris` (canonical IDs like `entity://person/john-doe`).
|
|
679
|
-
- Startup warmup
|
|
691
|
+
- Startup warmup is opt-in (`downloadOnStartup: false`) so model prewarm does not land on the critical gateway startup path.
|
|
680
692
|
|
|
681
693
|
Warmup command:
|
|
682
694
|
|
package/openclaw.plugin.json
CHANGED
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"type": "object",
|
|
130
130
|
"additionalProperties": false,
|
|
131
131
|
"properties": {
|
|
132
|
-
"downloadOnStartup": { "type": "boolean", "default":
|
|
132
|
+
"downloadOnStartup": { "type": "boolean", "default": false },
|
|
133
133
|
"warmupText": {
|
|
134
134
|
"type": "string",
|
|
135
135
|
"default": "John works at Acme in Berlin."
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"additionalProperties": false,
|
|
187
187
|
"properties": {
|
|
188
188
|
"enabled": { "type": "boolean", "default": true },
|
|
189
|
-
"startupRun": { "type": "boolean", "default":
|
|
189
|
+
"startupRun": { "type": "boolean", "default": false },
|
|
190
190
|
"intervalMinutes": {
|
|
191
191
|
"type": "integer",
|
|
192
192
|
"minimum": 1,
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -172,7 +172,7 @@ const DEFAULTS: MemoryBraidConfig = {
|
|
|
172
172
|
minScore: 0.65,
|
|
173
173
|
maxEntitiesPerMemory: 8,
|
|
174
174
|
startup: {
|
|
175
|
-
downloadOnStartup:
|
|
175
|
+
downloadOnStartup: false,
|
|
176
176
|
warmupText: "John works at Acme in Berlin.",
|
|
177
177
|
},
|
|
178
178
|
},
|
|
@@ -196,7 +196,7 @@ const DEFAULTS: MemoryBraidConfig = {
|
|
|
196
196
|
},
|
|
197
197
|
consolidation: {
|
|
198
198
|
enabled: true,
|
|
199
|
-
startupRun:
|
|
199
|
+
startupRun: false,
|
|
200
200
|
intervalMinutes: 360,
|
|
201
201
|
opportunisticNewMemoryThreshold: 5,
|
|
202
202
|
opportunisticMinMinutesSinceLastRun: 30,
|
package/src/index.ts
CHANGED
|
@@ -2911,13 +2911,13 @@ const memoryBraidPlugin = {
|
|
|
2911
2911
|
}
|
|
2912
2912
|
});
|
|
2913
2913
|
|
|
2914
|
-
api.on("
|
|
2914
|
+
api.on("before_prompt_build", async (event, ctx) => {
|
|
2915
2915
|
const runId = log.newRunId();
|
|
2916
2916
|
const scope = resolveRuntimeScopeFromHookContext(ctx);
|
|
2917
2917
|
const persistentScope = resolvePersistentScopeFromHookContext(ctx);
|
|
2918
2918
|
const legacyScope = resolveLegacySessionScopeFromHookContext(ctx);
|
|
2919
2919
|
const baseResult = {
|
|
2920
|
-
|
|
2920
|
+
prependSystemContext: REMEMBER_LEARNING_SYSTEM_PROMPT,
|
|
2921
2921
|
};
|
|
2922
2922
|
if (isExcludedAutoMemorySession(ctx.sessionKey)) {
|
|
2923
2923
|
log.debug("memory_braid.search.skip", {
|
|
@@ -3048,7 +3048,7 @@ const memoryBraidPlugin = {
|
|
|
3048
3048
|
});
|
|
3049
3049
|
|
|
3050
3050
|
return {
|
|
3051
|
-
|
|
3051
|
+
prependSystemContext: REMEMBER_LEARNING_SYSTEM_PROMPT,
|
|
3052
3052
|
prependContext,
|
|
3053
3053
|
};
|
|
3054
3054
|
});
|