@bamdra/bamdra-memory-vector 0.1.9 → 0.1.11

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 CHANGED
@@ -1,89 +1,105 @@
1
1
  # bamdra-memory-vector
2
2
 
3
- `bamdra-memory-vector` is the semantic retrieval plugin for the Bamdra OpenClaw suite.
3
+ ![Bamdra Animated Logo](./docs/assets/bamdra-logo-animated.svg)
4
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.
5
+ The local knowledge and semantic recall layer for the Bamdra suite.
6
6
 
7
- ## What It Does
7
+ It can run independently, and it becomes most powerful when paired with `bamdra-openclaw-memory`.
8
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
9
+ Install directly:
14
10
 
15
- ## Open Source Contents
11
+ ```bash
12
+ openclaw plugins install @bamdra/bamdra-memory-vector
13
+ ```
14
+
15
+ Release package:
16
16
 
17
- This repository already includes the real source code for the current open-source version.
17
+ - GitHub Releases: https://github.com/bamdra/bamdra-memory-vector/releases
18
+ - You can also build a local release bundle with `pnpm package:release`
18
19
 
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)
20
+ [中文文档](./README.zh-CN.md)
25
21
 
26
- The repository currently looks small because the first public version is intentionally a compact, single-entry plugin.
22
+ ## What it does
27
23
 
28
- ## Current Runtime Model
24
+ `bamdra-memory-vector` turns local Markdown into a maintainable knowledge base.
29
25
 
30
- - private Markdown root:
31
- `~/.openclaw/memory/vector/markdown/private/`
32
- - shared Markdown root:
33
- `~/.openclaw/memory/vector/markdown/shared/`
34
- - local index:
35
- `~/.openclaw/memory/vector/index.json`
26
+ It indexes:
36
27
 
37
- `markdownRoot` is still supported as a legacy base path, but the recommended production setup is to set `privateMarkdownRoot` and `sharedMarkdownRoot` explicitly.
28
+ - `knowledge/`
29
+ - `docs/`
30
+ - `notes/`
31
+ - `ideas/`
38
32
 
39
- ## Bundled Skill
33
+ `ideas/` is a generic example name. If your vault uses a different folder such as `06_Interest/`, point the Markdown root at that structure or keep both names as valid knowledge buckets.
40
34
 
41
- This package now ships its own standalone operator skill:
35
+ and helps OpenClaw search that local knowledge before falling back to the web.
42
36
 
43
- - `bamdra-memory-vector-operator`
37
+ ## Why it matters
44
38
 
45
- When OpenClaw bootstraps the installed plugin, that skill can be materialized into `~/.openclaw/skills/` and attached automatically.
39
+ The weakest part of many memory systems is the knowledge layer:
46
40
 
47
- ## Best Practice: Obsidian-Friendly Layout
41
+ - knowledge becomes opaque
42
+ - humans stop editing it
43
+ - web search gets used too often
44
+ - latency and token cost go up
48
45
 
49
- The plugin now supports separate roots for private memory and shared knowledge. That makes it practical to point Markdown storage at an Obsidian vault, iCloud Drive folder, Git-synced repo, or Syncthing workspace while keeping the local vector index in `~/.openclaw`.
46
+ This plugin closes that gap by keeping the knowledge base local, readable, and editable.
50
47
 
51
- Recommended example:
48
+ ## Best-practice layout
49
+
50
+ ```text
51
+ private/
52
+ knowledge/
53
+ docs/
54
+ notes/
55
+ ideas/
56
+ 06_Interest/
57
+
58
+ shared/
59
+ knowledge/
60
+ docs/
61
+ notes/
62
+ ideas/
63
+ 06_Interest/
64
+ ```
65
+
66
+ ## Best-practice storage
67
+
68
+ Keep the index local, but point Markdown roots at a synced editor-friendly folder.
52
69
 
53
70
  ```json
54
71
  {
55
72
  "enabled": true,
56
73
  "privateMarkdownRoot": "~/Documents/Obsidian/MyVault/openclaw/private",
57
74
  "sharedMarkdownRoot": "~/Documents/Obsidian/MyVault/openclaw/shared",
58
- "indexPath": "~/.openclaw/memory/vector/index.json",
59
- "dimensions": 64
75
+ "indexPath": "~/.openclaw/memory/vector/index.json"
60
76
  }
61
77
  ```
62
78
 
63
- This gives you:
79
+ That works especially well with:
64
80
 
65
- - a private vault area for user-specific memory
66
- - a shared vault area for team or household knowledge
67
- - Markdown files that can be edited on any synced device
68
- - a local index that OpenClaw can rebuild without exposing other users' data
81
+ - Obsidian
82
+ - iCloud Drive
83
+ - Git-synced repositories
84
+ - Syncthing workspaces
69
85
 
70
- This first version exposes a lightweight local vector-style index interface and keeps the integration surface ready for later LanceDB-backed evolution.
86
+ ## Architecture
71
87
 
72
- ## Product Positioning
88
+ ![Bamdra Suite Architecture](./docs/assets/architecture-technical-en.svg)
73
89
 
74
- `bamdra-memory-vector` is not meant to replace `bamdra-openclaw-memory`.
90
+ ## What it unlocks
75
91
 
76
- - `bamdra-openclaw-memory` is continuity-first
77
- - `bamdra-memory-vector` is recall enhancement
92
+ With `bamdra-openclaw-memory`:
78
93
 
79
- Together they provide:
94
+ - old work can be found through fuzzy recall
95
+ - local docs can enter the answer path without prompt bloat
80
96
 
81
- - durable continuity across long sessions
82
- - Markdown-readable memory artifacts
83
- - lightweight semantic recall without extra infrastructure
97
+ With `bamdra-user-bind`:
84
98
 
85
- ## Build
99
+ - private knowledge stays aligned with the correct user boundary
86
100
 
87
- ```bash
88
- pnpm run bundle
89
- ```
101
+ ## Repository
102
+
103
+ - [GitHub organization](https://github.com/bamdra)
104
+ - [Repository](https://github.com/bamdra/bamdra-memory-vector)
105
+ - [Releases](https://github.com/bamdra/bamdra-memory-vector/releases)
package/README.zh-CN.md CHANGED
@@ -1,87 +1,105 @@
1
1
  # bamdra-memory-vector
2
2
 
3
- `bamdra-memory-vector` 是 Bamdra OpenClaw 套件中的语义召回插件,而且它也可以独立运行。
3
+ ![Bamdra Animated Logo](./docs/assets/bamdra-logo-animated.svg)
4
4
 
5
- ## 它做什么
5
+ Bamdra 套件中的本地知识库与语义召回层。
6
+
7
+ 它可以独立运行,和 `bamdra-openclaw-memory` 配合时效果最好。
8
+
9
+ 单独安装:
10
+
11
+ ```bash
12
+ openclaw plugins install @bamdra/bamdra-memory-vector
13
+ ```
14
+
15
+ 发布包下载:
6
16
 
7
- - 把记忆内容以 Markdown 可读形式写入本地
8
- - 建立轻量的本地语义索引
9
- - 按当前用户边界限制检索范围
10
- - 为长程记忆回捞提供 Top-K 语义召回
11
- - 保持私有记忆与共享知识分离
17
+ - GitHub Releases: https://github.com/bamdra/bamdra-memory-vector/releases
18
+ - 本地也可以执行 `pnpm package:release` 生成独立发布包
12
19
 
13
- ## 开源内容说明
20
+ [English README](./README.md)
14
21
 
15
- 当前开源版的实际源码已经包含在这个仓库里。
22
+ ## 它做什么
23
+
24
+ `bamdra-memory-vector` 会把本地 Markdown 变成真正可维护的知识库。
16
25
 
17
- - 源码入口:
18
- [src/index.ts](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-memory-vector/src/index.ts)
19
- - 插件清单:
20
- [openclaw.plugin.json](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-memory-vector/openclaw.plugin.json)
21
- - 包元数据:
22
- [package.json](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-memory-vector/package.json)
26
+ 它会索引:
23
27
 
24
- 仓库目前看起来比较轻,是因为首个公开版本刻意保持为紧凑、单入口插件。
28
+ - `knowledge/`
29
+ - `docs/`
30
+ - `notes/`
31
+ - `ideas/`
25
32
 
26
- ## 当前运行模型
33
+ 其中 `ideas/` 只是通用示例名。如果你的 Obsidian 实际目录叫 `06_Interest/`,也完全可以按那个结构来放,插件同样可以把它当成灵感知识桶。
27
34
 
28
- - 私有 Markdown 根目录:
29
- `~/.openclaw/memory/vector/markdown/private/`
30
- - 共享 Markdown 根目录:
31
- `~/.openclaw/memory/vector/markdown/shared/`
32
- - 本地索引:
33
- `~/.openclaw/memory/vector/index.json`
35
+ 并尽量让 OpenClaw 在上网之前先查本地知识。
34
36
 
35
- 这一版提供的是轻量本地向量式索引接口,同时为后续 LanceDB 演进保留接入面。
37
+ ## 为什么重要
36
38
 
37
- `markdownRoot` 仍然保留兼容,但更推荐在正式环境里显式设置 `privateMarkdownRoot` 和 `sharedMarkdownRoot`。
39
+ 很多记忆系统最弱的一层,其实就是知识库层:
38
40
 
39
- ## 随包 Skill
41
+ - 知识越来越黑盒
42
+ - 人不再愿意维护
43
+ - web search 被过度使用
44
+ - 延迟和 token 成本不断上升
40
45
 
41
- 这个包现在会附带独立的 operator skill:
46
+ 这个插件补上的,正是这块短板。它让知识继续保持本地、可读、可改。
42
47
 
43
- - `bamdra-memory-vector-operator`
48
+ ## 最佳实践目录
44
49
 
45
- 安装到 OpenClaw 后,bootstrap 可以把它复制到 `~/.openclaw/skills/` 并自动挂到 agent。
50
+ ```text
51
+ private/
52
+ knowledge/
53
+ docs/
54
+ notes/
55
+ ideas/
56
+ 06_Interest/
46
57
 
47
- ## 最佳实践:兼容 Obsidian 的双库布局
58
+ shared/
59
+ knowledge/
60
+ docs/
61
+ notes/
62
+ ideas/
63
+ 06_Interest/
64
+ ```
48
65
 
49
- 插件现在支持把私有记忆和共享知识分别落到两个 Markdown 根目录。这意味着你可以把 Markdown 指向 Obsidian 仓库、iCloud Drive、Git 同步目录或者 Syncthing 目录,而把本地索引仍然保留在 `~/.openclaw` 下面。
66
+ ## 最佳实践存储方式
50
67
 
51
- 推荐配置示例:
68
+ 索引留在本地,Markdown 根目录指向一个会同步、会编辑的目录。
52
69
 
53
70
  ```json
54
71
  {
55
72
  "enabled": true,
56
73
  "privateMarkdownRoot": "~/Documents/Obsidian/MyVault/openclaw/private",
57
74
  "sharedMarkdownRoot": "~/Documents/Obsidian/MyVault/openclaw/shared",
58
- "indexPath": "~/.openclaw/memory/vector/index.json",
59
- "dimensions": 64
75
+ "indexPath": "~/.openclaw/memory/vector/index.json"
60
76
  }
61
77
  ```
62
78
 
63
- 这样做的好处是:
79
+ 这尤其适合:
64
80
 
65
- - 私有记忆和共享知识库天然分开
66
- - Markdown 文件可以在任何同步设备上直接编辑
67
- - OpenClaw 继续使用本地索引,不依赖远端向量服务
68
- - 更适合把 Obsidian 作为长期知识库编辑入口
81
+ - Obsidian
82
+ - iCloud Drive
83
+ - Git 同步仓库
84
+ - Syncthing 工作区
69
85
 
70
- ## 产品定位
86
+ ## 架构图
71
87
 
72
- `bamdra-memory-vector` 不是用来替代 `bamdra-openclaw-memory` 的。
88
+ ![Bamdra 套件架构图](./docs/assets/architecture-technical-zh.svg)
73
89
 
74
- - `bamdra-openclaw-memory` 更强调连续性
75
- - `bamdra-memory-vector` 更强调召回增强
90
+ ## 它能解锁什么
76
91
 
77
- 两者组合后的价值是:
92
+ 与 `bamdra-openclaw-memory` 组合时:
78
93
 
79
- - 更强的长会话连续性
80
- - Markdown 可读、可维护的记忆载体
81
- - 不依赖重型基础设施的轻量语义召回
94
+ - 旧工作可以通过模糊召回被重新找回
95
+ - 本地文档能进入答案链路,而不是靠 prompt 硬塞
82
96
 
83
- ## 构建
97
+ `bamdra-user-bind` 组合时:
84
98
 
85
- ```bash
86
- pnpm run bundle
87
- ```
99
+ - 私有知识会继续对齐到正确用户边界
100
+
101
+ ## 仓库地址
102
+
103
+ - [GitHub 首页](https://github.com/bamdra)
104
+ - [仓库地址](https://github.com/bamdra/bamdra-memory-vector)
105
+ - [Releases](https://github.com/bamdra/bamdra-memory-vector/releases)
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ var PLUGIN_ID = "bamdra-memory-vector";
41
41
  var SKILL_ID = "bamdra-memory-vector-operator";
42
42
  var SEARCH_TOOL_NAME = "bamdra_memory_vector_search";
43
43
  var REINDEX_TOOL_NAME = "bamdra_memory_vector_reindex";
44
- var DEFAULT_LIBRARY_DIRS = ["knowledge", "docs", "notes", "ideas"];
44
+ var DEFAULT_LIBRARY_DIRS = ["knowledge", "docs", "notes", "ideas", "06_Interest"];
45
45
  var RUNTIME_DIR = "_runtime";
46
46
  var SUPPORTED_TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
47
47
  ".md",
@@ -164,7 +164,7 @@ function register(api) {
164
164
  exposeVectorApi(runtime);
165
165
  api.registerTool?.({
166
166
  name: SEARCH_TOOL_NAME,
167
- description: "Search the current user's vector memory and knowledge index",
167
+ description: "Search the current user's local vector-backed knowledge and memory index before falling back to web lookup",
168
168
  parameters: {
169
169
  type: "object",
170
170
  additionalProperties: false,
@@ -3,7 +3,7 @@
3
3
  "type": "tool",
4
4
  "name": "Bamdra Memory Vector",
5
5
  "description": "Local vector-style semantic retrieval enhancement for Bamdra memory.",
6
- "version": "0.1.9",
6
+ "version": "0.1.10",
7
7
  "main": "./dist/index.js",
8
8
  "skills": ["./skills"],
9
9
  "configSchema": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamdra/bamdra-memory-vector",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Lightweight local semantic retrieval enhancement for the Bamdra OpenClaw memory suite.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.bamdra.com",
@@ -34,7 +34,8 @@
34
34
  },
35
35
  "scripts": {
36
36
  "bundle": "node ../bamdra-openclaw-memory/scripts/run-local-bin.mjs tsup",
37
- "prepublishOnly": "pnpm run bundle"
37
+ "prepublishOnly": "pnpm run bundle",
38
+ "package:release": "node ./scripts/package-release.mjs"
38
39
  },
39
40
  "openclaw": {
40
41
  "id": "bamdra-memory-vector",
@@ -25,6 +25,7 @@ It complements topic memory. Use it when the user remembers something fuzzily, w
25
25
  - do not flood the prompt with low-signal chunks
26
26
  - prefer a few strong recalls over many weak ones
27
27
  - when the question plausibly targets local docs, notes, ideas, or knowledge files, check local vector-backed knowledge before using web search
28
+ - for repository docs, changelogs, READMEs, SOPs, or user-maintained Markdown libraries, local recall should be the default first step, not a fallback
28
29
 
29
30
  ## Markdown Knowledge Model
30
31
 
@@ -57,3 +58,4 @@ Shared examples:
57
58
  - never treat another user's private Markdown as searchable context
58
59
  - do not reveal storage paths unless the user asks
59
60
  - if retrieval confidence is weak, answer cautiously instead of pretending certainty
61
+ - if local recall returns relevant results, answer from it first and only suggest web search when the user explicitly asks for public latest information beyond the local library