@xdarkicex/openclaw-memory-libravdb 1.6.31 → 1.7.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 +16 -0
- package/dist/context-engine.js +8 -0
- package/dist/index.js +26 -16
- package/dist/memory-provider.js +17 -12
- package/dist/memory-tools.js +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -176,6 +176,22 @@ openclaw memory journal --limit 50
|
|
|
176
176
|
openclaw memory dream-promote --user-id <userId> --dream-file ~/DREAMS.md
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
+
### Vector Service CLI (libravdbd v1.5.0+)
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Service health and status
|
|
183
|
+
libravdbd status # tenants, cache, DB sizes
|
|
184
|
+
libravdbd health # OK/UNHEALTHY
|
|
185
|
+
|
|
186
|
+
# Search tenant memory (same collections memory_search queries)
|
|
187
|
+
libravdbd search --tenant <key> -k 10 "query"
|
|
188
|
+
libravdbd search --tenant <key> --session <id> -k 10 "query"
|
|
189
|
+
|
|
190
|
+
# Tenant management
|
|
191
|
+
libravdbd tenant evict <key> # force-close a tenant DB
|
|
192
|
+
libravdbd migrate # run pending DB migrations
|
|
193
|
+
```
|
|
194
|
+
|
|
179
195
|
Use [Install](./docs/install.md) for service lifecycle commands and
|
|
180
196
|
[Uninstall](./docs/uninstall.md) for safe shutdown and removal.
|
|
181
197
|
|
package/dist/context-engine.js
CHANGED
|
@@ -1297,6 +1297,9 @@ export function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
1297
1297
|
systemPromptAddition: appendSystemPromptAddition(enforced.systemPromptAddition, section.text),
|
|
1298
1298
|
estimatedTokens: enforced.estimatedTokens + section.tokens,
|
|
1299
1299
|
};
|
|
1300
|
+
logger.info?.(`LibraVDB predictive context injected sessionId=${sessionId} ` +
|
|
1301
|
+
`items=${section.injectedCount}/${predictions.length} ` +
|
|
1302
|
+
`tokens=${section.tokens}`);
|
|
1300
1303
|
}
|
|
1301
1304
|
}
|
|
1302
1305
|
enforced = enforceTokenBudgetInvariant(enforced, args.tokenBudget);
|
|
@@ -1426,6 +1429,11 @@ export function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
1426
1429
|
predictiveContextCache.delete(oldest);
|
|
1427
1430
|
}
|
|
1428
1431
|
predictiveContextCache.set(sessionId, predictions);
|
|
1432
|
+
logger.info?.(`LibraVDB predictive graph returned predictions sessionId=${sessionId} ` +
|
|
1433
|
+
`count=${predictions.length}`);
|
|
1434
|
+
}
|
|
1435
|
+
else {
|
|
1436
|
+
logger.info?.(`LibraVDB predictive graph returned no predictions sessionId=${sessionId}`);
|
|
1429
1437
|
}
|
|
1430
1438
|
return result;
|
|
1431
1439
|
}
|
package/dist/index.js
CHANGED
|
@@ -27807,6 +27807,9 @@ function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
27807
27807
|
),
|
|
27808
27808
|
estimatedTokens: enforced.estimatedTokens + section.tokens
|
|
27809
27809
|
};
|
|
27810
|
+
logger.info?.(
|
|
27811
|
+
`LibraVDB predictive context injected sessionId=${sessionId} items=${section.injectedCount}/${predictions.length} tokens=${section.tokens}`
|
|
27812
|
+
);
|
|
27810
27813
|
}
|
|
27811
27814
|
}
|
|
27812
27815
|
enforced = enforceTokenBudgetInvariant(enforced, args.tokenBudget);
|
|
@@ -27927,6 +27930,13 @@ function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
27927
27930
|
if (oldest !== void 0) predictiveContextCache.delete(oldest);
|
|
27928
27931
|
}
|
|
27929
27932
|
predictiveContextCache.set(sessionId, predictions);
|
|
27933
|
+
logger.info?.(
|
|
27934
|
+
`LibraVDB predictive graph returned predictions sessionId=${sessionId} count=${predictions.length}`
|
|
27935
|
+
);
|
|
27936
|
+
} else {
|
|
27937
|
+
logger.info?.(
|
|
27938
|
+
`LibraVDB predictive graph returned no predictions sessionId=${sessionId}`
|
|
27939
|
+
);
|
|
27930
27940
|
}
|
|
27931
27941
|
return result;
|
|
27932
27942
|
} catch (error2) {
|
|
@@ -34754,28 +34764,28 @@ function isOpenClawMemoryFile(filePath) {
|
|
|
34754
34764
|
// src/memory-provider.ts
|
|
34755
34765
|
var MEMORY_PROMPT_HEADER = [
|
|
34756
34766
|
"## Memory",
|
|
34757
|
-
"LibraVDB persistent memory is configured.
|
|
34758
|
-
"
|
|
34767
|
+
"LibraVDB persistent memory is configured. Every turn is auto-ingested",
|
|
34768
|
+
"into the vector store \u2014 you do not need to explicitly save anything.",
|
|
34769
|
+
"When asked about past conversations, facts, preferences, decisions,",
|
|
34770
|
+
"or anything the user might have told you before, call `memory_search`",
|
|
34771
|
+
"once per user question. Do not answer from memory until you have",
|
|
34772
|
+
"called it. Once you have results, use them \u2014 do not re-call.",
|
|
34759
34773
|
""
|
|
34760
34774
|
];
|
|
34761
34775
|
function buildToolGuidance(availableTools) {
|
|
34762
34776
|
if (!availableTools?.has("memory_search")) {
|
|
34763
34777
|
return [];
|
|
34764
34778
|
}
|
|
34765
|
-
|
|
34766
|
-
"
|
|
34767
|
-
"
|
|
34768
|
-
"
|
|
34769
|
-
"
|
|
34770
|
-
|
|
34771
|
-
|
|
34772
|
-
|
|
34773
|
-
}
|
|
34774
|
-
lines.push(
|
|
34775
|
-
"Do not treat a missing `MEMORY.md` file as missing memory; LibraVDB memory is vector-backed and retrieved through the memory tools.",
|
|
34779
|
+
return [
|
|
34780
|
+
"Call `memory_search` once per user question for prior turns, remembered",
|
|
34781
|
+
"facts, earliest interactions, and channel history. Do not answer memory",
|
|
34782
|
+
"questions from prior transcript claims \u2014 perform a search every time.",
|
|
34783
|
+
"After receiving results, use them directly; do not re-call in the same turn.",
|
|
34784
|
+
"For earliest or oldest questions, request enough results and compare timestamps.",
|
|
34785
|
+
...availableTools.has("memory_get") ? ["After a `memory_search` hit, call `memory_get` when exact wording or more context is needed."] : [],
|
|
34786
|
+
"LibraVDB memory is vector-backed and retrieved through tools, not files.",
|
|
34776
34787
|
""
|
|
34777
|
-
|
|
34778
|
-
return lines;
|
|
34788
|
+
];
|
|
34779
34789
|
}
|
|
34780
34790
|
function buildMemoryPromptSection(_getClient, _cfg) {
|
|
34781
34791
|
return function memoryPromptSection({
|
|
@@ -34864,7 +34874,7 @@ function createLibraVdbMemoryTools(getClient, cfg, logger = console) {
|
|
|
34864
34874
|
return {
|
|
34865
34875
|
name: "memory_search",
|
|
34866
34876
|
label: "Memory Search",
|
|
34867
|
-
description: "
|
|
34877
|
+
description: "Search LibraVDB durable memory and session recall for prior work, decisions, dates, people, preferences, todos, or history. Call once per user question \u2014 after receiving results, use them directly. Do not re-call in the same turn. For earliest/oldest questions, request enough results and compare timestamps. If disabled=true, memory is unavailable.",
|
|
34868
34878
|
parameters: MEMORY_SEARCH_SCHEMA,
|
|
34869
34879
|
execute: async (_toolCallId, rawParams) => {
|
|
34870
34880
|
const params = asToolParamsRecord(rawParams);
|
package/dist/memory-provider.js
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
const MEMORY_PROMPT_HEADER = [
|
|
2
2
|
"## Memory",
|
|
3
|
-
"LibraVDB persistent memory is configured.
|
|
4
|
-
"
|
|
3
|
+
"LibraVDB persistent memory is configured. Every turn is auto-ingested",
|
|
4
|
+
"into the vector store — you do not need to explicitly save anything.",
|
|
5
|
+
"When asked about past conversations, facts, preferences, decisions,",
|
|
6
|
+
"or anything the user might have told you before, call `memory_search`",
|
|
7
|
+
"once per user question. Do not answer from memory until you have",
|
|
8
|
+
"called it. Once you have results, use them — do not re-call.",
|
|
5
9
|
"",
|
|
6
10
|
];
|
|
7
11
|
function buildToolGuidance(availableTools) {
|
|
8
12
|
if (!availableTools?.has("memory_search")) {
|
|
9
13
|
return [];
|
|
10
14
|
}
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
15
|
+
return [
|
|
16
|
+
"Call `memory_search` once per user question for prior turns, remembered",
|
|
17
|
+
"facts, earliest interactions, and channel history. Do not answer memory",
|
|
18
|
+
"questions from prior transcript claims — perform a search every time.",
|
|
19
|
+
"After receiving results, use them directly; do not re-call in the same turn.",
|
|
20
|
+
"For earliest or oldest questions, request enough results and compare timestamps.",
|
|
21
|
+
...(availableTools.has("memory_get")
|
|
22
|
+
? ["After a `memory_search` hit, call `memory_get` when exact wording or more context is needed."]
|
|
23
|
+
: []),
|
|
24
|
+
"LibraVDB memory is vector-backed and retrieved through tools, not files.",
|
|
25
|
+
"",
|
|
16
26
|
];
|
|
17
|
-
if (availableTools.has("memory_get")) {
|
|
18
|
-
lines.push("After a `memory_search` hit, call `memory_get` when exact wording or more context is needed.");
|
|
19
|
-
}
|
|
20
|
-
lines.push("Do not treat a missing `MEMORY.md` file as missing memory; LibraVDB memory is vector-backed and retrieved through the memory tools.", "");
|
|
21
|
-
return lines;
|
|
22
27
|
}
|
|
23
28
|
export function buildMemoryPromptSection(_getClient, _cfg) {
|
|
24
29
|
return function memoryPromptSection({ availableTools, citationsMode: _citationsMode, }) {
|
package/dist/memory-tools.js
CHANGED
|
@@ -80,7 +80,7 @@ export function createLibraVdbMemoryTools(getClient, cfg, logger = console) {
|
|
|
80
80
|
return {
|
|
81
81
|
name: "memory_search",
|
|
82
82
|
label: "Memory Search",
|
|
83
|
-
description: "
|
|
83
|
+
description: "Search LibraVDB durable memory and session recall for prior work, decisions, dates, people, preferences, todos, or history. Call once per user question — after receiving results, use them directly. Do not re-call in the same turn. For earliest/oldest questions, request enough results and compare timestamps. If disabled=true, memory is unavailable.",
|
|
84
84
|
parameters: MEMORY_SEARCH_SCHEMA,
|
|
85
85
|
execute: async (_toolCallId, rawParams) => {
|
|
86
86
|
const params = asToolParamsRecord(rawParams);
|
package/openclaw.plugin.json
CHANGED