@xdarkicex/openclaw-memory-libravdb 1.4.25 → 1.4.26
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/dist/memory-runtime.js +13 -6
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/memory-runtime.js
CHANGED
|
@@ -124,6 +124,9 @@ function createMemorySearchManager(getRpc, cfg, defaults, initialStatus) {
|
|
|
124
124
|
}
|
|
125
125
|
async function searchResolvedCollections(rpc, cfg, userId, sessionId, queryText, k) {
|
|
126
126
|
const collections = resolveSearchCollections(cfg, userId, sessionId);
|
|
127
|
+
if (collections.length === 0) {
|
|
128
|
+
return { results: [] };
|
|
129
|
+
}
|
|
127
130
|
return collections.length === 1
|
|
128
131
|
? await rpc.call("search_text", {
|
|
129
132
|
collection: collections[0],
|
|
@@ -138,20 +141,24 @@ async function searchResolvedCollections(rpc, cfg, userId, sessionId, queryText,
|
|
|
138
141
|
});
|
|
139
142
|
}
|
|
140
143
|
function resolveSearchCollections(cfg, userId, sessionId) {
|
|
144
|
+
if (cfg.crossSessionRecall === false) {
|
|
145
|
+
return sessionId ? [resolveSessionSearchCollection(cfg, sessionId)] : [];
|
|
146
|
+
}
|
|
141
147
|
const collections = [`user:${userId}`, "global"];
|
|
142
148
|
if (!sessionId) {
|
|
143
149
|
return collections;
|
|
144
150
|
}
|
|
151
|
+
collections.unshift(resolveSessionSearchCollection(cfg, sessionId));
|
|
152
|
+
return collections;
|
|
153
|
+
}
|
|
154
|
+
function resolveSessionSearchCollection(cfg, sessionId) {
|
|
145
155
|
if (cfg.useSessionSummarySearchExperiment) {
|
|
146
|
-
|
|
147
|
-
return collections;
|
|
156
|
+
return `session_summary:${sessionId}`;
|
|
148
157
|
}
|
|
149
158
|
if (cfg.useSessionRecallProjection) {
|
|
150
|
-
|
|
151
|
-
return collections;
|
|
159
|
+
return `session_recall:${sessionId}`;
|
|
152
160
|
}
|
|
153
|
-
|
|
154
|
-
return collections;
|
|
161
|
+
return `session:${sessionId}`;
|
|
155
162
|
}
|
|
156
163
|
function firstString(...values) {
|
|
157
164
|
return values.find((value) => typeof value === "string" && value.length > 0);
|
package/openclaw.plugin.json
CHANGED