@kodelyth/memory-lancedb 2026.5.42 → 2026.6.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/package.json +16 -1
- package/api.ts +0 -2
- package/cli-metadata.ts +0 -18
- package/config.test.ts +0 -178
- package/config.ts +0 -283
- package/index.test.ts +0 -2370
- package/index.ts +0 -1158
- package/lancedb-runtime.ts +0 -77
- package/memory-lancedb.live.test.ts +0 -121
- package/test-helpers.ts +0 -25
- package/tsconfig.json +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kodelyth/memory-lancedb",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.6.1",
|
|
4
4
|
"description": "Klaw LanceDB-backed long-term memory plugin with auto-recall/capture",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,6 +34,21 @@
|
|
|
34
34
|
"release": {
|
|
35
35
|
"publishToClawHub": true,
|
|
36
36
|
"publishToNpm": true
|
|
37
|
+
},
|
|
38
|
+
"runtimeExtensions": [
|
|
39
|
+
"./dist/index.js"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist/**",
|
|
44
|
+
"klaw.plugin.json"
|
|
45
|
+
],
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"klaw": ">=2026.5.39"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"klaw": {
|
|
51
|
+
"optional": true
|
|
37
52
|
}
|
|
38
53
|
}
|
|
39
54
|
}
|
package/api.ts
DELETED
package/cli-metadata.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { definePluginEntry } from "klaw/plugin-sdk/core";
|
|
2
|
-
|
|
3
|
-
export default definePluginEntry({
|
|
4
|
-
id: "memory-lancedb",
|
|
5
|
-
name: "Memory LanceDB",
|
|
6
|
-
description: "LanceDB-backed memory provider",
|
|
7
|
-
register(api) {
|
|
8
|
-
api.registerCli(() => {}, {
|
|
9
|
-
descriptors: [
|
|
10
|
-
{
|
|
11
|
-
name: "ltm",
|
|
12
|
-
description: "Inspect and query LanceDB-backed memory",
|
|
13
|
-
hasSubcommands: true,
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
});
|
|
17
|
-
},
|
|
18
|
-
});
|
package/config.test.ts
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import { type JsonSchemaObject, validateJsonSchemaValue } from "klaw/plugin-sdk/config-schema";
|
|
3
|
-
import { describe, expect, it } from "vitest";
|
|
4
|
-
import { memoryConfigSchema } from "./config.js";
|
|
5
|
-
|
|
6
|
-
const manifest = JSON.parse(
|
|
7
|
-
fs.readFileSync(new URL("./klaw.plugin.json", import.meta.url), "utf-8"),
|
|
8
|
-
) as { configSchema: JsonSchemaObject };
|
|
9
|
-
|
|
10
|
-
describe("memory-lancedb config", () => {
|
|
11
|
-
it("accepts dreaming in the manifest schema and preserves it in runtime parsing", () => {
|
|
12
|
-
const manifestResult = validateJsonSchemaValue({
|
|
13
|
-
schema: manifest.configSchema,
|
|
14
|
-
cacheKey: "memory-lancedb.manifest.dreaming",
|
|
15
|
-
value: {
|
|
16
|
-
embedding: {
|
|
17
|
-
apiKey: "sk-test",
|
|
18
|
-
},
|
|
19
|
-
dreaming: {
|
|
20
|
-
enabled: true,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const parsed = memoryConfigSchema.parse({
|
|
26
|
-
embedding: {
|
|
27
|
-
apiKey: "sk-test",
|
|
28
|
-
},
|
|
29
|
-
dreaming: {
|
|
30
|
-
enabled: true,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
expect(manifestResult.ok).toBe(true);
|
|
35
|
-
expect(parsed.dreaming).toEqual({
|
|
36
|
-
enabled: true,
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it("accepts provider-backed embedding config without a plugin apiKey", () => {
|
|
41
|
-
const manifestResult = validateJsonSchemaValue({
|
|
42
|
-
schema: manifest.configSchema,
|
|
43
|
-
cacheKey: "memory-lancedb.manifest.provider-auth",
|
|
44
|
-
value: {
|
|
45
|
-
embedding: {
|
|
46
|
-
provider: "openai",
|
|
47
|
-
model: "text-embedding-3-small",
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const parsed = memoryConfigSchema.parse({
|
|
53
|
-
embedding: {
|
|
54
|
-
provider: "openai",
|
|
55
|
-
model: "text-embedding-3-small",
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
expect(manifestResult.ok).toBe(true);
|
|
60
|
-
expect(parsed.embedding.apiKey).toBeUndefined();
|
|
61
|
-
expect(parsed.embedding.provider).toBe("openai");
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it("rejects empty embedding config in the manifest schema and runtime parser", () => {
|
|
65
|
-
const manifestResult = validateJsonSchemaValue({
|
|
66
|
-
schema: manifest.configSchema,
|
|
67
|
-
cacheKey: "memory-lancedb.manifest.empty-embedding",
|
|
68
|
-
value: {
|
|
69
|
-
embedding: {},
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
expect(manifestResult.ok).toBe(false);
|
|
74
|
-
if (!manifestResult.ok) {
|
|
75
|
-
expect(manifestResult.errors.map((error) => error.text)).toContain(
|
|
76
|
-
"embedding: must NOT have fewer than 1 properties",
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
expect(() => {
|
|
81
|
-
memoryConfigSchema.parse({
|
|
82
|
-
embedding: {},
|
|
83
|
-
});
|
|
84
|
-
}).toThrow("embedding config must include at least one setting");
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it("allows missing embedding config in the manifest so setup can discover fields", () => {
|
|
88
|
-
const manifestResult = validateJsonSchemaValue({
|
|
89
|
-
schema: manifest.configSchema,
|
|
90
|
-
cacheKey: "memory-lancedb.manifest.missing-embedding",
|
|
91
|
-
value: {},
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
expect(manifestResult.ok).toBe(true);
|
|
95
|
-
expect(() => {
|
|
96
|
-
memoryConfigSchema.parse({});
|
|
97
|
-
}).toThrow("embedding config required");
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it("rejects empty embedding providers", () => {
|
|
101
|
-
expect(() => {
|
|
102
|
-
memoryConfigSchema.parse({
|
|
103
|
-
embedding: {
|
|
104
|
-
provider: "",
|
|
105
|
-
model: "text-embedding-3-small",
|
|
106
|
-
},
|
|
107
|
-
});
|
|
108
|
-
}).toThrow("embedding.provider must not be empty");
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it("still rejects unrelated unknown top-level config keys", () => {
|
|
112
|
-
expect(() => {
|
|
113
|
-
memoryConfigSchema.parse({
|
|
114
|
-
embedding: {
|
|
115
|
-
apiKey: "sk-test",
|
|
116
|
-
},
|
|
117
|
-
dreaming: {
|
|
118
|
-
enabled: true,
|
|
119
|
-
},
|
|
120
|
-
unexpected: true,
|
|
121
|
-
});
|
|
122
|
-
}).toThrow("memory config has unknown keys: unexpected");
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it("accepts custom trigger literals in the manifest schema and runtime parser", () => {
|
|
126
|
-
const manifestResult = validateJsonSchemaValue({
|
|
127
|
-
schema: manifest.configSchema,
|
|
128
|
-
cacheKey: "memory-lancedb.manifest.custom-triggers",
|
|
129
|
-
value: {
|
|
130
|
-
embedding: {
|
|
131
|
-
apiKey: "sk-test",
|
|
132
|
-
},
|
|
133
|
-
customTriggers: ["记住", "important project"],
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
const parsed = memoryConfigSchema.parse({
|
|
138
|
-
embedding: {
|
|
139
|
-
apiKey: "sk-test",
|
|
140
|
-
},
|
|
141
|
-
customTriggers: [" 记住 ", "important project"],
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
expect(manifestResult.ok).toBe(true);
|
|
145
|
-
expect(parsed.customTriggers).toEqual(["记住", "important project"]);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it("rejects unsafe custom trigger config values", () => {
|
|
149
|
-
expect(() => {
|
|
150
|
-
memoryConfigSchema.parse({
|
|
151
|
-
embedding: {
|
|
152
|
-
apiKey: "sk-test",
|
|
153
|
-
},
|
|
154
|
-
customTriggers: ["记住", ""],
|
|
155
|
-
});
|
|
156
|
-
}).toThrow("customTriggers.1 must not be empty");
|
|
157
|
-
|
|
158
|
-
expect(() => {
|
|
159
|
-
memoryConfigSchema.parse({
|
|
160
|
-
embedding: {
|
|
161
|
-
apiKey: "sk-test",
|
|
162
|
-
},
|
|
163
|
-
customTriggers: ["x".repeat(101)],
|
|
164
|
-
});
|
|
165
|
-
}).toThrow("customTriggers.0 must be at most 100 characters");
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
it("rejects non-object dreaming values in runtime parsing", () => {
|
|
169
|
-
expect(() => {
|
|
170
|
-
memoryConfigSchema.parse({
|
|
171
|
-
embedding: {
|
|
172
|
-
apiKey: "sk-test",
|
|
173
|
-
},
|
|
174
|
-
dreaming: true,
|
|
175
|
-
});
|
|
176
|
-
}).toThrow("dreaming config must be an object");
|
|
177
|
-
});
|
|
178
|
-
});
|
package/config.ts
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
|
|
5
|
-
export type MemoryConfig = {
|
|
6
|
-
embedding: {
|
|
7
|
-
provider: string;
|
|
8
|
-
model: string;
|
|
9
|
-
apiKey?: string;
|
|
10
|
-
baseUrl?: string;
|
|
11
|
-
dimensions?: number;
|
|
12
|
-
};
|
|
13
|
-
dreaming?: Record<string, unknown>;
|
|
14
|
-
dbPath?: string;
|
|
15
|
-
autoCapture?: boolean;
|
|
16
|
-
autoRecall?: boolean;
|
|
17
|
-
captureMaxChars?: number;
|
|
18
|
-
customTriggers?: string[];
|
|
19
|
-
recallMaxChars?: number;
|
|
20
|
-
storageOptions?: Record<string, string>;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const MEMORY_CATEGORIES = ["preference", "fact", "decision", "entity", "other"] as const;
|
|
24
|
-
export type MemoryCategory = (typeof MEMORY_CATEGORIES)[number];
|
|
25
|
-
|
|
26
|
-
const DEFAULT_MODEL = "text-embedding-3-small";
|
|
27
|
-
export const DEFAULT_CAPTURE_MAX_CHARS = 500;
|
|
28
|
-
export const DEFAULT_RECALL_MAX_CHARS = 1000;
|
|
29
|
-
const LEGACY_STATE_DIRS: string[] = [];
|
|
30
|
-
|
|
31
|
-
function resolveDefaultDbPath(): string {
|
|
32
|
-
const home = homedir();
|
|
33
|
-
const preferred = join(home, ".klaw", "memory", "lancedb");
|
|
34
|
-
try {
|
|
35
|
-
if (fs.existsSync(preferred)) {
|
|
36
|
-
return preferred;
|
|
37
|
-
}
|
|
38
|
-
} catch {
|
|
39
|
-
// best-effort
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
for (const legacy of LEGACY_STATE_DIRS) {
|
|
43
|
-
const candidate = join(home, legacy, "memory", "lancedb");
|
|
44
|
-
try {
|
|
45
|
-
if (fs.existsSync(candidate)) {
|
|
46
|
-
return candidate;
|
|
47
|
-
}
|
|
48
|
-
} catch {
|
|
49
|
-
// best-effort
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return preferred;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const DEFAULT_DB_PATH = resolveDefaultDbPath();
|
|
57
|
-
|
|
58
|
-
const EMBEDDING_DIMENSIONS: Record<string, number> = {
|
|
59
|
-
"text-embedding-3-small": 1536,
|
|
60
|
-
"text-embedding-3-large": 3072,
|
|
61
|
-
};
|
|
62
|
-
const EMBEDDING_CONFIG_KEYS = ["provider", "apiKey", "model", "baseUrl", "dimensions"] as const;
|
|
63
|
-
|
|
64
|
-
function assertAllowedKeys(value: Record<string, unknown>, allowed: string[], label: string) {
|
|
65
|
-
const unknown = Object.keys(value).filter((key) => !allowed.includes(key));
|
|
66
|
-
if (unknown.length === 0) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
throw new Error(`${label} has unknown keys: ${unknown.join(", ")}`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function vectorDimsForModel(model: string): number {
|
|
73
|
-
const dims = EMBEDDING_DIMENSIONS[model];
|
|
74
|
-
if (!dims) {
|
|
75
|
-
throw new Error(`Unsupported embedding model: ${model}`);
|
|
76
|
-
}
|
|
77
|
-
return dims;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function resolveEnvVars(value: string): string {
|
|
81
|
-
return value.replace(/\$\{([^}]+)\}/g, (_, envVar) => {
|
|
82
|
-
const envValue = process.env[envVar];
|
|
83
|
-
if (!envValue) {
|
|
84
|
-
throw new Error(`Environment variable ${envVar} is not set`);
|
|
85
|
-
}
|
|
86
|
-
return envValue;
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function resolveEmbeddingModel(embedding: Record<string, unknown>): string {
|
|
91
|
-
const model = typeof embedding.model === "string" ? embedding.model : DEFAULT_MODEL;
|
|
92
|
-
if (typeof embedding.dimensions !== "number") {
|
|
93
|
-
vectorDimsForModel(model);
|
|
94
|
-
}
|
|
95
|
-
return model;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export const memoryConfigSchema = {
|
|
99
|
-
parse(value: unknown): MemoryConfig {
|
|
100
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
101
|
-
throw new Error("memory config required");
|
|
102
|
-
}
|
|
103
|
-
const cfg = value as Record<string, unknown>;
|
|
104
|
-
assertAllowedKeys(
|
|
105
|
-
cfg,
|
|
106
|
-
[
|
|
107
|
-
"embedding",
|
|
108
|
-
"dreaming",
|
|
109
|
-
"dbPath",
|
|
110
|
-
"autoCapture",
|
|
111
|
-
"autoRecall",
|
|
112
|
-
"captureMaxChars",
|
|
113
|
-
"customTriggers",
|
|
114
|
-
"recallMaxChars",
|
|
115
|
-
"storageOptions",
|
|
116
|
-
],
|
|
117
|
-
"memory config",
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
const embedding = cfg.embedding as Record<string, unknown> | undefined;
|
|
121
|
-
if (!embedding || typeof embedding !== "object" || Array.isArray(embedding)) {
|
|
122
|
-
throw new Error("embedding config required");
|
|
123
|
-
}
|
|
124
|
-
assertAllowedKeys(embedding, [...EMBEDDING_CONFIG_KEYS], "embedding config");
|
|
125
|
-
if (Object.keys(embedding).length === 0) {
|
|
126
|
-
throw new Error("embedding config must include at least one setting");
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const model = resolveEmbeddingModel(embedding);
|
|
130
|
-
const provider = typeof embedding.provider === "string" ? embedding.provider.trim() : "openai";
|
|
131
|
-
if (!provider) {
|
|
132
|
-
throw new Error("embedding.provider must not be empty");
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const captureMaxChars =
|
|
136
|
-
typeof cfg.captureMaxChars === "number" ? Math.floor(cfg.captureMaxChars) : undefined;
|
|
137
|
-
const recallMaxChars =
|
|
138
|
-
typeof cfg.recallMaxChars === "number" ? Math.floor(cfg.recallMaxChars) : undefined;
|
|
139
|
-
if (
|
|
140
|
-
typeof captureMaxChars === "number" &&
|
|
141
|
-
(captureMaxChars < 100 || captureMaxChars > 10_000)
|
|
142
|
-
) {
|
|
143
|
-
throw new Error("captureMaxChars must be between 100 and 10000");
|
|
144
|
-
}
|
|
145
|
-
if (typeof recallMaxChars === "number" && (recallMaxChars < 100 || recallMaxChars > 10_000)) {
|
|
146
|
-
throw new Error("recallMaxChars must be between 100 and 10000");
|
|
147
|
-
}
|
|
148
|
-
let customTriggers: string[] | undefined;
|
|
149
|
-
if (cfg.customTriggers !== undefined) {
|
|
150
|
-
if (!Array.isArray(cfg.customTriggers)) {
|
|
151
|
-
throw new Error("customTriggers must be an array of strings");
|
|
152
|
-
}
|
|
153
|
-
customTriggers = cfg.customTriggers.map((trigger, index) => {
|
|
154
|
-
if (typeof trigger !== "string") {
|
|
155
|
-
throw new Error(`customTriggers.${index} must be a string`);
|
|
156
|
-
}
|
|
157
|
-
const normalized = trigger.trim();
|
|
158
|
-
if (!normalized) {
|
|
159
|
-
throw new Error(`customTriggers.${index} must not be empty`);
|
|
160
|
-
}
|
|
161
|
-
if (normalized.length > 100) {
|
|
162
|
-
throw new Error(`customTriggers.${index} must be at most 100 characters`);
|
|
163
|
-
}
|
|
164
|
-
return normalized;
|
|
165
|
-
});
|
|
166
|
-
if (customTriggers.length > 50) {
|
|
167
|
-
throw new Error("customTriggers must include at most 50 entries");
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const dreaming =
|
|
172
|
-
cfg.dreaming === undefined
|
|
173
|
-
? undefined
|
|
174
|
-
: cfg.dreaming && typeof cfg.dreaming === "object" && !Array.isArray(cfg.dreaming)
|
|
175
|
-
? (cfg.dreaming as Record<string, unknown>)
|
|
176
|
-
: (() => {
|
|
177
|
-
throw new Error("dreaming config must be an object");
|
|
178
|
-
})();
|
|
179
|
-
|
|
180
|
-
// Parse storageOptions (object with string values)
|
|
181
|
-
let storageOptions: Record<string, string> | undefined;
|
|
182
|
-
const storageOpts = cfg.storageOptions as Record<string, unknown> | undefined;
|
|
183
|
-
if (storageOpts !== undefined && storageOpts !== null) {
|
|
184
|
-
if (!storageOpts || typeof storageOpts !== "object" || Array.isArray(storageOpts)) {
|
|
185
|
-
throw new Error("storageOptions must be an object");
|
|
186
|
-
}
|
|
187
|
-
storageOptions = {};
|
|
188
|
-
// Validate all values are strings
|
|
189
|
-
for (const [key, value] of Object.entries(storageOpts)) {
|
|
190
|
-
if (typeof value !== "string") {
|
|
191
|
-
throw new Error(`storageOptions.${key} must be a string`);
|
|
192
|
-
}
|
|
193
|
-
storageOptions[key] = resolveEnvVars(value);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return {
|
|
198
|
-
embedding: {
|
|
199
|
-
provider,
|
|
200
|
-
model,
|
|
201
|
-
apiKey: typeof embedding.apiKey === "string" ? resolveEnvVars(embedding.apiKey) : undefined,
|
|
202
|
-
baseUrl:
|
|
203
|
-
typeof embedding.baseUrl === "string" ? resolveEnvVars(embedding.baseUrl) : undefined,
|
|
204
|
-
dimensions: typeof embedding.dimensions === "number" ? embedding.dimensions : undefined,
|
|
205
|
-
},
|
|
206
|
-
dreaming,
|
|
207
|
-
dbPath: typeof cfg.dbPath === "string" ? cfg.dbPath : DEFAULT_DB_PATH,
|
|
208
|
-
autoCapture: cfg.autoCapture === true,
|
|
209
|
-
autoRecall: cfg.autoRecall !== false,
|
|
210
|
-
captureMaxChars: captureMaxChars ?? DEFAULT_CAPTURE_MAX_CHARS,
|
|
211
|
-
...(customTriggers ? { customTriggers } : {}),
|
|
212
|
-
recallMaxChars: recallMaxChars ?? DEFAULT_RECALL_MAX_CHARS,
|
|
213
|
-
...(storageOptions ? { storageOptions } : {}),
|
|
214
|
-
};
|
|
215
|
-
},
|
|
216
|
-
uiHints: {
|
|
217
|
-
"embedding.provider": {
|
|
218
|
-
label: "Embedding Provider",
|
|
219
|
-
placeholder: "openai",
|
|
220
|
-
help: "Memory embedding provider adapter to use (for example openai, github-copilot, ollama)",
|
|
221
|
-
},
|
|
222
|
-
"embedding.apiKey": {
|
|
223
|
-
label: "OpenAI API Key",
|
|
224
|
-
sensitive: true,
|
|
225
|
-
placeholder: "sk-proj-...",
|
|
226
|
-
help: "Optional API key override for OpenAI-compatible embeddings; omit to use configured provider auth",
|
|
227
|
-
},
|
|
228
|
-
"embedding.baseUrl": {
|
|
229
|
-
label: "Base URL",
|
|
230
|
-
placeholder: "https://api.openai.com/v1",
|
|
231
|
-
help: "Optional provider or OpenAI-compatible embedding endpoint base URL",
|
|
232
|
-
advanced: true,
|
|
233
|
-
},
|
|
234
|
-
"embedding.dimensions": {
|
|
235
|
-
label: "Dimensions",
|
|
236
|
-
placeholder: "1536",
|
|
237
|
-
help: "Vector dimensions for custom models (required for non-standard models)",
|
|
238
|
-
advanced: true,
|
|
239
|
-
},
|
|
240
|
-
"embedding.model": {
|
|
241
|
-
label: "Embedding Model",
|
|
242
|
-
placeholder: DEFAULT_MODEL,
|
|
243
|
-
help: "OpenAI embedding model to use",
|
|
244
|
-
},
|
|
245
|
-
dbPath: {
|
|
246
|
-
label: "Database Path",
|
|
247
|
-
placeholder: "~/.klaw/memory/lancedb",
|
|
248
|
-
advanced: true,
|
|
249
|
-
help: "Local filesystem path or cloud storage URI (s3://, gs://) for LanceDB database",
|
|
250
|
-
},
|
|
251
|
-
autoCapture: {
|
|
252
|
-
label: "Auto-Capture",
|
|
253
|
-
help: "Automatically capture important information from conversations",
|
|
254
|
-
},
|
|
255
|
-
autoRecall: {
|
|
256
|
-
label: "Auto-Recall",
|
|
257
|
-
help: "Automatically inject relevant memories into context",
|
|
258
|
-
},
|
|
259
|
-
captureMaxChars: {
|
|
260
|
-
label: "Capture Max Chars",
|
|
261
|
-
help: "Maximum message length eligible for auto-capture",
|
|
262
|
-
advanced: true,
|
|
263
|
-
placeholder: String(DEFAULT_CAPTURE_MAX_CHARS),
|
|
264
|
-
},
|
|
265
|
-
customTriggers: {
|
|
266
|
-
label: "Custom Triggers",
|
|
267
|
-
help: "Literal phrases that should make auto-capture consider a message memory-worthy",
|
|
268
|
-
advanced: true,
|
|
269
|
-
},
|
|
270
|
-
recallMaxChars: {
|
|
271
|
-
label: "Recall Query Max Chars",
|
|
272
|
-
help: "Maximum prompt/query length embedded for memory recall. Lower for small local embedding models.",
|
|
273
|
-
advanced: true,
|
|
274
|
-
placeholder: String(DEFAULT_RECALL_MAX_CHARS),
|
|
275
|
-
},
|
|
276
|
-
storageOptions: {
|
|
277
|
-
label: "Storage Options",
|
|
278
|
-
sensitive: true,
|
|
279
|
-
advanced: true,
|
|
280
|
-
help: "Storage configuration options (access_key, secret_key, endpoint, etc.); supports ${ENV_VAR} values",
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
};
|