@bamdra/bamdra-memory-vector 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # bamdra-memory-vector
2
+
3
+ `bamdra-memory-vector` is the optional semantic retrieval plugin for the Bamdra OpenClaw memory suite.
4
+
5
+ It adds lightweight vector-style recall on top of `bamdra-openclaw-memory` without turning the whole stack into a heavy external vector-database deployment.
6
+
7
+ ## What It Does
8
+
9
+ - writes Markdown-readable memory artifacts to local storage
10
+ - builds a lightweight local semantic index
11
+ - supports scoped retrieval for the current user
12
+ - returns top-k semantic matches for recall-heavy prompts
13
+ - keeps private user memory and shared knowledge separated
14
+
15
+ ## Open Source Contents
16
+
17
+ This repository already includes the real source code for the current open-source version.
18
+
19
+ - source entrypoint:
20
+ [src/index.ts](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-memory-vector/src/index.ts)
21
+ - plugin manifest:
22
+ [openclaw.plugin.json](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-memory-vector/openclaw.plugin.json)
23
+ - package metadata:
24
+ [package.json](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-memory-vector/package.json)
25
+
26
+ The repository currently looks small because the first public version is intentionally a compact, single-entry plugin.
27
+
28
+ ## Current Runtime Model
29
+
30
+ - Markdown root:
31
+ `~/.openclaw/memory/vector/markdown/`
32
+ - local index:
33
+ `~/.openclaw/memory/vector/index.json`
34
+
35
+ This first version exposes a lightweight local vector-style index interface and keeps the integration surface ready for later LanceDB-backed evolution.
36
+
37
+ ## Product Positioning
38
+
39
+ `bamdra-memory-vector` is not meant to replace `bamdra-openclaw-memory`.
40
+
41
+ - `bamdra-openclaw-memory` is continuity-first
42
+ - `bamdra-memory-vector` is recall enhancement
43
+
44
+ Together they provide:
45
+
46
+ - durable continuity across long sessions
47
+ - Markdown-readable memory artifacts
48
+ - lightweight semantic recall without extra infrastructure
49
+
50
+ ## Build
51
+
52
+ ```bash
53
+ pnpm run bundle
54
+ ```
@@ -0,0 +1,29 @@
1
+ export interface MemoryVectorConfig {
2
+ enabled: boolean;
3
+ markdownRoot: string;
4
+ indexPath: string;
5
+ dimensions: number;
6
+ }
7
+ interface ToolDefinition<TParams> {
8
+ name: string;
9
+ description: string;
10
+ parameters: Record<string, unknown>;
11
+ execute(invocationId: string, params: TParams): Promise<{
12
+ content: Array<{
13
+ type: "text";
14
+ text: string;
15
+ }>;
16
+ }>;
17
+ }
18
+ interface VectorPluginHost {
19
+ registerTool?<TParams>(definition: ToolDefinition<TParams>): void;
20
+ pluginConfig?: Partial<MemoryVectorConfig>;
21
+ config?: Partial<MemoryVectorConfig>;
22
+ plugin?: {
23
+ config?: Partial<MemoryVectorConfig>;
24
+ };
25
+ }
26
+ export declare function register(api: VectorPluginHost): void;
27
+ export declare function activate(api: VectorPluginHost): Promise<void>;
28
+ export {};
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,cAAc,CAAC,OAAO;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAC;CAC7G;AAED,UAAU,gBAAgB;IACxB,YAAY,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAClE,YAAY,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;KAAE,CAAC;CACnD;AAuGD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAiCpD;AAED,wBAAsB,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnE"}
package/dist/index.js ADDED
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ activate: () => activate,
24
+ register: () => register
25
+ });
26
+ module.exports = __toCommonJS(index_exports);
27
+ var import_node_crypto = require("crypto");
28
+ var import_node_fs = require("fs");
29
+ var import_node_os = require("os");
30
+ var import_node_path = require("path");
31
+ var GLOBAL_VECTOR_API_KEY = "__OPENCLAW_BAMDRA_MEMORY_VECTOR__";
32
+ var LocalVectorIndex = class {
33
+ config;
34
+ records = /* @__PURE__ */ new Map();
35
+ constructor(inputConfig) {
36
+ this.config = normalizeConfig(inputConfig);
37
+ (0, import_node_fs.mkdirSync)((0, import_node_path.dirname)(this.config.indexPath), { recursive: true });
38
+ (0, import_node_fs.mkdirSync)(this.config.markdownRoot, { recursive: true });
39
+ this.load();
40
+ }
41
+ upsert(args) {
42
+ const id = hashId(`${args.userId ?? "shared"}:${args.sourcePath}:${args.title}`);
43
+ const record = {
44
+ id,
45
+ userId: args.userId,
46
+ sessionId: args.sessionId,
47
+ topicId: args.topicId,
48
+ sourcePath: args.sourcePath,
49
+ title: args.title,
50
+ text: args.text,
51
+ tags: args.tags ?? [],
52
+ embedding: embed(`${args.title}
53
+ ${args.text}`, this.config.dimensions),
54
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
55
+ };
56
+ this.records.set(id, record);
57
+ const markdownPath = (0, import_node_path.join)(this.config.markdownRoot, args.sourcePath);
58
+ (0, import_node_fs.mkdirSync)((0, import_node_path.dirname)(markdownPath), { recursive: true });
59
+ (0, import_node_fs.writeFileSync)(markdownPath, `# ${args.title}
60
+
61
+ ${args.text}
62
+ `, "utf8");
63
+ this.flush();
64
+ }
65
+ search(args) {
66
+ const limit = args.limit ?? 5;
67
+ const queryEmbedding = embed(args.query, this.config.dimensions);
68
+ return [...this.records.values()].filter((record) => {
69
+ if (args.userId == null) {
70
+ return record.userId == null;
71
+ }
72
+ return record.userId === args.userId;
73
+ }).map((record) => ({
74
+ id: record.id,
75
+ userId: record.userId,
76
+ topicId: record.topicId,
77
+ sessionId: record.sessionId,
78
+ sourcePath: record.sourcePath,
79
+ title: record.title,
80
+ text: record.text,
81
+ tags: record.tags,
82
+ score: cosineSimilarity(queryEmbedding, record.embedding),
83
+ matchReasons: inferMatchReasons(args.query, record),
84
+ source: "vector"
85
+ })).sort((a, b) => b.score - a.score).slice(0, limit);
86
+ }
87
+ flush() {
88
+ const payload = JSON.stringify([...this.records.values()], null, 2);
89
+ (0, import_node_fs.writeFileSync)(this.config.indexPath, `${payload}
90
+ `, "utf8");
91
+ }
92
+ load() {
93
+ if (!(0, import_node_fs.existsSync)(this.config.indexPath)) {
94
+ return;
95
+ }
96
+ const payload = JSON.parse((0, import_node_fs.readFileSync)(this.config.indexPath, "utf8"));
97
+ for (const record of payload) {
98
+ this.records.set(record.id, record);
99
+ }
100
+ }
101
+ };
102
+ function register(api) {
103
+ const runtime = new LocalVectorIndex(api.pluginConfig ?? api.config ?? api.plugin?.config);
104
+ exposeVectorApi(runtime);
105
+ api.registerTool?.({
106
+ name: "memory_vector_search",
107
+ description: "Search the current user's vector memory index",
108
+ parameters: {
109
+ type: "object",
110
+ additionalProperties: false,
111
+ required: ["query"],
112
+ properties: {
113
+ query: { type: "string" },
114
+ userId: { type: ["string", "null"] },
115
+ topicId: { type: ["string", "null"] },
116
+ limit: { type: "integer", minimum: 1, maximum: 20 }
117
+ }
118
+ },
119
+ async execute(_id, params) {
120
+ return {
121
+ content: [
122
+ {
123
+ type: "text",
124
+ text: JSON.stringify(runtime.search({
125
+ query: String(params.query ?? ""),
126
+ userId: typeof params.userId === "string" ? params.userId : null,
127
+ topicId: typeof params.topicId === "string" ? params.topicId : null,
128
+ limit: typeof params.limit === "number" ? params.limit : void 0
129
+ }), null, 2)
130
+ }
131
+ ]
132
+ };
133
+ }
134
+ });
135
+ }
136
+ async function activate(api) {
137
+ register(api);
138
+ }
139
+ function exposeVectorApi(runtime) {
140
+ globalThis[GLOBAL_VECTOR_API_KEY] = {
141
+ upsertMemoryRecord(args) {
142
+ runtime.upsert(args);
143
+ },
144
+ search(args) {
145
+ return runtime.search(args);
146
+ }
147
+ };
148
+ }
149
+ function normalizeConfig(input) {
150
+ const root = (0, import_node_path.join)((0, import_node_os.homedir)(), ".openclaw", "memory", "vector");
151
+ return {
152
+ enabled: input?.enabled ?? true,
153
+ markdownRoot: input?.markdownRoot ?? (0, import_node_path.join)(root, "markdown"),
154
+ indexPath: input?.indexPath ?? (0, import_node_path.join)(root, "index.json"),
155
+ dimensions: input?.dimensions ?? 64
156
+ };
157
+ }
158
+ function embed(text, dimensions) {
159
+ const vector = Array.from({ length: dimensions }, () => 0);
160
+ const tokens = text.toLowerCase().split(/[^a-z0-9_\u4e00-\u9fff]+/i).filter(Boolean);
161
+ for (const token of tokens) {
162
+ const digest = (0, import_node_crypto.createHash)("sha1").update(token).digest();
163
+ const index = digest[0] % dimensions;
164
+ vector[index] += 1;
165
+ }
166
+ const magnitude = Math.sqrt(vector.reduce((sum, item) => sum + item * item, 0)) || 1;
167
+ return vector.map((item) => item / magnitude);
168
+ }
169
+ function cosineSimilarity(a, b) {
170
+ let sum = 0;
171
+ for (let index = 0; index < Math.min(a.length, b.length); index += 1) {
172
+ sum += a[index] * b[index];
173
+ }
174
+ return Number(sum.toFixed(6));
175
+ }
176
+ function inferMatchReasons(query, record) {
177
+ const reasons = [];
178
+ const normalized = query.toLowerCase();
179
+ if (record.title.toLowerCase().includes(normalized)) {
180
+ reasons.push("title");
181
+ }
182
+ if (record.text.toLowerCase().includes(normalized)) {
183
+ reasons.push("text");
184
+ }
185
+ if (reasons.length === 0) {
186
+ reasons.push("semantic");
187
+ }
188
+ return reasons;
189
+ }
190
+ function hashId(value) {
191
+ return (0, import_node_crypto.createHash)("sha1").update(value).digest("hex").slice(0, 24);
192
+ }
193
+ // Annotate the CommonJS export names for ESM import in node:
194
+ 0 && (module.exports = {
195
+ activate,
196
+ register
197
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,qBAAqB,GAAG,mCAAmC,CAAC;AAoClE,MAAM,gBAAgB;IACH,MAAM,CAAqB;IAC3B,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;IAE3D,YAAY,WAAoD;QAC9D,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;QAC3C,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/D,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;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AAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACrE,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAa,EAAE,MAAoB;IAC5D,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACvC,IAAI,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC"}
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "bamdra-memory-vector",
3
+ "type": "tool",
4
+ "name": "Bamdra Memory Vector",
5
+ "description": "Local vector-style semantic retrieval enhancement for Bamdra memory.",
6
+ "version": "0.1.0",
7
+ "main": "./index.js",
8
+ "configSchema": {
9
+ "type": "object",
10
+ "additionalProperties": true
11
+ }
12
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@bamdra/bamdra-memory-vector",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "commonjs",
6
+ "main": "./index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "scripts": {
9
+ "bundle": "node ../../scripts/run-local-bin.mjs tsup && node ../../scripts/prepare-plugin-dist.mjs bamdra-memory-vector"
10
+ },
11
+ "openclaw": {
12
+ "id": "bamdra-memory-vector",
13
+ "type": "tool",
14
+ "manifest": "./openclaw.plugin.json",
15
+ "extensions": [
16
+ "./index.js"
17
+ ]
18
+ },
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.js"
23
+ }
24
+ },
25
+ "dependencies": {
26
+ "@openclaw-enhanced/memory-core": "workspace:*"
27
+ },
28
+ "devDependencies": {
29
+ "@types/node": "^24.5.2"
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "bamdra-memory-vector",
3
+ "type": "tool",
4
+ "name": "Bamdra Memory Vector",
5
+ "description": "Local vector-style semantic retrieval enhancement for Bamdra memory.",
6
+ "version": "0.1.0",
7
+ "main": "./dist/index.js",
8
+ "configSchema": {
9
+ "type": "object",
10
+ "additionalProperties": true
11
+ }
12
+ }
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@bamdra/bamdra-memory-vector",
3
+ "version": "0.1.0",
4
+ "description": "Lightweight local semantic retrieval enhancement for the Bamdra OpenClaw memory suite.",
5
+ "license": "MIT",
6
+ "homepage": "https://www.bamdra.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/bamdra/bamdra-memory-vector.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/bamdra/bamdra-memory-vector/issues"
13
+ },
14
+ "type": "module",
15
+ "main": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "files": [
18
+ "dist",
19
+ "openclaw.plugin.json",
20
+ "README.md",
21
+ "LICENSE"
22
+ ],
23
+ "keywords": [
24
+ "openclaw",
25
+ "openclaw-plugin",
26
+ "vector-search",
27
+ "semantic-search",
28
+ "memory",
29
+ "markdown"
30
+ ],
31
+ "engines": {
32
+ "node": ">=22"
33
+ },
34
+ "scripts": {
35
+ "bundle": "node ../bamdra-openclaw-memory/scripts/run-local-bin.mjs tsup",
36
+ "prepublishOnly": "pnpm run bundle"
37
+ },
38
+ "openclaw": {
39
+ "id": "bamdra-memory-vector",
40
+ "type": "tool",
41
+ "manifest": "./openclaw.plugin.json",
42
+ "extensions": [
43
+ "./dist/index.js"
44
+ ]
45
+ },
46
+ "exports": {
47
+ ".": {
48
+ "types": "./dist/index.d.ts",
49
+ "default": "./dist/index.js"
50
+ }
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "dependencies": {},
56
+ "devDependencies": {
57
+ "@types/node": "^24.5.2"
58
+ }
59
+ }