memory-braid 0.7.1 → 0.8.2
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 +15 -3
- package/package.json +1 -1
- package/src/index.ts +5 -8
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:
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1672,11 +1672,8 @@ const memoryBraidPlugin = {
|
|
|
1672
1672
|
register(api: OpenClawPluginApi) {
|
|
1673
1673
|
const cfg = parseConfig(api.pluginConfig);
|
|
1674
1674
|
const log = new MemoryBraidLogger(api.logger, cfg.debug);
|
|
1675
|
-
const
|
|
1676
|
-
const
|
|
1677
|
-
const entityExtraction = new EntityExtractionManager(cfg.entityExtraction, log, {
|
|
1678
|
-
stateDir: initialStateDir,
|
|
1679
|
-
});
|
|
1675
|
+
const mem0 = new Mem0Adapter(cfg, log);
|
|
1676
|
+
const entityExtraction = new EntityExtractionManager(cfg.entityExtraction, log);
|
|
1680
1677
|
const recallSeenByScope = new Map<string, string>();
|
|
1681
1678
|
const captureSeenByScope = new Map<string, string>();
|
|
1682
1679
|
const pendingInboundTurns = new Map<string, PendingInboundTurn>();
|
|
@@ -2911,13 +2908,13 @@ const memoryBraidPlugin = {
|
|
|
2911
2908
|
}
|
|
2912
2909
|
});
|
|
2913
2910
|
|
|
2914
|
-
api.on("
|
|
2911
|
+
api.on("before_prompt_build", async (event, ctx) => {
|
|
2915
2912
|
const runId = log.newRunId();
|
|
2916
2913
|
const scope = resolveRuntimeScopeFromHookContext(ctx);
|
|
2917
2914
|
const persistentScope = resolvePersistentScopeFromHookContext(ctx);
|
|
2918
2915
|
const legacyScope = resolveLegacySessionScopeFromHookContext(ctx);
|
|
2919
2916
|
const baseResult = {
|
|
2920
|
-
|
|
2917
|
+
prependSystemContext: REMEMBER_LEARNING_SYSTEM_PROMPT,
|
|
2921
2918
|
};
|
|
2922
2919
|
if (isExcludedAutoMemorySession(ctx.sessionKey)) {
|
|
2923
2920
|
log.debug("memory_braid.search.skip", {
|
|
@@ -3048,7 +3045,7 @@ const memoryBraidPlugin = {
|
|
|
3048
3045
|
});
|
|
3049
3046
|
|
|
3050
3047
|
return {
|
|
3051
|
-
|
|
3048
|
+
prependSystemContext: REMEMBER_LEARNING_SYSTEM_PROMPT,
|
|
3052
3049
|
prependContext,
|
|
3053
3050
|
};
|
|
3054
3051
|
});
|