@openclaw/memory-lancedb 2026.5.27-beta.1 → 2026.5.28-beta.1
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/index.js +19 -7
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -4
- package/dist/test-helpers.js +0 -3198
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@ import { DEFAULT_RECALL_MAX_CHARS, MEMORY_CATEGORIES, memoryConfigSchema, vector
|
|
|
3
3
|
import { loadLanceDbModule } from "./lancedb-runtime.js";
|
|
4
4
|
import { Buffer } from "node:buffer";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
|
+
import { optionalFiniteNumberSchema, optionalPositiveIntegerSchema } from "openclaw/plugin-sdk/channel-actions";
|
|
7
|
+
import { readFiniteNumberParam, readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
|
|
6
8
|
import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
7
9
|
import { ensureGlobalUndiciEnvProxyDispatcher } from "openclaw/plugin-sdk/runtime-env";
|
|
8
10
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -417,10 +419,12 @@ var memory_lancedb_default = definePluginEntry({
|
|
|
417
419
|
description: "Search through long-term memories. Use when you need context about user preferences, past decisions, or previously discussed topics.",
|
|
418
420
|
parameters: Type.Object({
|
|
419
421
|
query: Type.String({ description: "Search query" }),
|
|
420
|
-
limit:
|
|
422
|
+
limit: optionalPositiveIntegerSchema({ description: "Max results (default: 5)" })
|
|
421
423
|
}),
|
|
422
424
|
async execute(_toolCallId, params) {
|
|
423
|
-
const
|
|
425
|
+
const rawParams = params;
|
|
426
|
+
const query = rawParams.query;
|
|
427
|
+
const limit = readPositiveIntegerParam(rawParams, "limit") ?? 5;
|
|
424
428
|
const currentCfg = resolveCurrentHookConfig();
|
|
425
429
|
const vector = await embeddings.embed(normalizeRecallQuery(query, currentCfg.recallMaxChars));
|
|
426
430
|
const results = await db.search(vector, limit, .1);
|
|
@@ -457,14 +461,22 @@ var memory_lancedb_default = definePluginEntry({
|
|
|
457
461
|
description: "Save important information in long-term memory. Use for preferences, facts, decisions.",
|
|
458
462
|
parameters: Type.Object({
|
|
459
463
|
text: Type.String({ description: "Information to remember" }),
|
|
460
|
-
importance:
|
|
464
|
+
importance: optionalFiniteNumberSchema({
|
|
465
|
+
description: "Importance 0-1 (default: 0.7)",
|
|
466
|
+
minimum: 0,
|
|
467
|
+
maximum: 1
|
|
468
|
+
}),
|
|
461
469
|
category: Type.Optional(Type.Unsafe({
|
|
462
470
|
type: "string",
|
|
463
471
|
enum: [...MEMORY_CATEGORIES]
|
|
464
472
|
}))
|
|
465
473
|
}),
|
|
466
474
|
async execute(_toolCallId, params) {
|
|
467
|
-
const { text,
|
|
475
|
+
const { text, category = "other" } = params;
|
|
476
|
+
const importance = readFiniteNumberParam(params, "importance", {
|
|
477
|
+
min: 0,
|
|
478
|
+
max: 1
|
|
479
|
+
}) ?? .7;
|
|
468
480
|
if (looksLikePromptInjection(text)) return {
|
|
469
481
|
content: [{
|
|
470
482
|
type: "text",
|
|
@@ -589,7 +601,8 @@ var memory_lancedb_default = definePluginEntry({
|
|
|
589
601
|
});
|
|
590
602
|
memory.command("search").description("Search memories").argument("<query>", "Search query").option("--limit <n>", "Max results", "5").action(async (query, opts) => {
|
|
591
603
|
const vector = await embeddings.embed(normalizeRecallQuery(query, cfg.recallMaxChars));
|
|
592
|
-
const
|
|
604
|
+
const limit = parsePositiveIntegerOption(opts.limit, "--limit");
|
|
605
|
+
const output = (await db.search(vector, limit, .3)).map((r) => ({
|
|
593
606
|
id: r.entry.id,
|
|
594
607
|
text: r.entry.text,
|
|
595
608
|
category: r.entry.category,
|
|
@@ -626,8 +639,7 @@ var memory_lancedb_default = definePluginEntry({
|
|
|
626
639
|
if (!/^[a-zA-Z0-9_\-\s='"><!.,()%*]+$/.test(filterCondition)) throw new Error("Filter condition contains invalid characters");
|
|
627
640
|
query = query.where(filterCondition);
|
|
628
641
|
}
|
|
629
|
-
const limit =
|
|
630
|
-
if (Number.isNaN(limit) || limit <= 0) throw new Error("Invalid limit: must be a positive integer");
|
|
642
|
+
const limit = parsePositiveIntegerOption(opts.limit, "--limit") ?? 10;
|
|
631
643
|
if (!opts.orderBy) query = query.limit(limit);
|
|
632
644
|
let rows = await query.toArray();
|
|
633
645
|
if (opts.orderBy) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/memory-lancedb",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.28-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/memory-lancedb",
|
|
9
|
-
"version": "2026.5.
|
|
9
|
+
"version": "2026.5.28-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@lancedb/lancedb": "0.29.0",
|
|
12
12
|
"apache-arrow": "18.1.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/memory-lancedb",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.28-beta.1",
|
|
4
4
|
"description": "OpenClaw LanceDB-backed long-term memory plugin with auto-recall, auto-capture, and vector search.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"minHostVersion": ">=2026.4.10"
|
|
27
27
|
},
|
|
28
28
|
"compat": {
|
|
29
|
-
"pluginApi": ">=2026.5.
|
|
29
|
+
"pluginApi": ">=2026.5.28-beta.1"
|
|
30
30
|
},
|
|
31
31
|
"build": {
|
|
32
|
-
"openclawVersion": "2026.5.
|
|
32
|
+
"openclawVersion": "2026.5.28-beta.1"
|
|
33
33
|
},
|
|
34
34
|
"release": {
|
|
35
35
|
"bundleRuntimeDependencies": false,
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"npm-shrinkwrap.json"
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"openclaw": ">=2026.5.
|
|
49
|
+
"openclaw": ">=2026.5.28-beta.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"openclaw": {
|