@bamdra/bamdra-memory-vector 0.1.8 → 0.1.10

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,83 @@
1
1
  # bamdra-memory-vector
2
2
 
3
- `bamdra-memory-vector` is the semantic retrieval plugin for the Bamdra OpenClaw suite.
3
+ The local knowledge and semantic recall layer for the Bamdra suite.
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
+ It can run independently, and it becomes most powerful when paired with `bamdra-openclaw-memory`.
6
6
 
7
- ## What It Does
7
+ [中文文档](./README.zh-CN.md)
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
+ ## What it does
14
10
 
15
- ## Open Source Contents
11
+ `bamdra-memory-vector` turns local Markdown into a maintainable knowledge base.
16
12
 
17
- This repository already includes the real source code for the current open-source version.
13
+ It indexes:
18
14
 
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)
15
+ - `knowledge/`
16
+ - `docs/`
17
+ - `notes/`
18
+ - `ideas/`
25
19
 
26
- The repository currently looks small because the first public version is intentionally a compact, single-entry plugin.
20
+ and helps OpenClaw search that local knowledge before falling back to the web.
27
21
 
28
- ## Current Runtime Model
22
+ ## Why it matters
29
23
 
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`
24
+ The weakest part of many memory systems is the knowledge layer:
36
25
 
37
- `markdownRoot` is still supported as a legacy base path, but the recommended production setup is to set `privateMarkdownRoot` and `sharedMarkdownRoot` explicitly.
26
+ - knowledge becomes opaque
27
+ - humans stop editing it
28
+ - web search gets used too often
29
+ - latency and token cost go up
38
30
 
39
- ## Bundled Skill
31
+ This plugin closes that gap by keeping the knowledge base local, readable, and editable.
40
32
 
41
- This package now ships its own standalone operator skill:
33
+ ## Best-practice layout
42
34
 
43
- - `bamdra-memory-vector-operator`
35
+ ```text
36
+ private/
37
+ knowledge/
38
+ docs/
39
+ notes/
40
+ ideas/
44
41
 
45
- When OpenClaw bootstraps the installed plugin, that skill can be materialized into `~/.openclaw/skills/` and attached automatically.
46
-
47
- ## Best Practice: Obsidian-Friendly Layout
42
+ shared/
43
+ knowledge/
44
+ docs/
45
+ notes/
46
+ ideas/
47
+ ```
48
48
 
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`.
49
+ ## Best-practice storage
50
50
 
51
- Recommended example:
51
+ Keep the index local, but point Markdown roots at a synced editor-friendly folder.
52
52
 
53
53
  ```json
54
54
  {
55
55
  "enabled": true,
56
56
  "privateMarkdownRoot": "~/Documents/Obsidian/MyVault/openclaw/private",
57
57
  "sharedMarkdownRoot": "~/Documents/Obsidian/MyVault/openclaw/shared",
58
- "indexPath": "~/.openclaw/memory/vector/index.json",
59
- "dimensions": 64
58
+ "indexPath": "~/.openclaw/memory/vector/index.json"
60
59
  }
61
60
  ```
62
61
 
63
- This gives you:
62
+ That works especially well with:
64
63
 
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
64
+ - Obsidian
65
+ - iCloud Drive
66
+ - Git-synced repositories
67
+ - Syncthing workspaces
69
68
 
70
- This first version exposes a lightweight local vector-style index interface and keeps the integration surface ready for later LanceDB-backed evolution.
69
+ ## What it unlocks
71
70
 
72
- ## Product Positioning
71
+ With `bamdra-openclaw-memory`:
73
72
 
74
- `bamdra-memory-vector` is not meant to replace `bamdra-openclaw-memory`.
73
+ - old work can be found through fuzzy recall
74
+ - local docs can enter the answer path without prompt bloat
75
75
 
76
- - `bamdra-openclaw-memory` is continuity-first
77
- - `bamdra-memory-vector` is recall enhancement
76
+ With `bamdra-user-bind`:
78
77
 
79
- Together they provide:
78
+ - private knowledge stays aligned with the correct user boundary
80
79
 
81
- - durable continuity across long sessions
82
- - Markdown-readable memory artifacts
83
- - lightweight semantic recall without extra infrastructure
80
+ ## Repository
84
81
 
85
- ## Build
86
-
87
- ```bash
88
- pnpm run bundle
89
- ```
82
+ - [GitHub organization](https://github.com/bamdra)
83
+ - [Repository](https://github.com/bamdra/bamdra-memory-vector)
package/README.zh-CN.md CHANGED
@@ -1,87 +1,83 @@
1
1
  # bamdra-memory-vector
2
2
 
3
- `bamdra-memory-vector` 是 Bamdra OpenClaw 套件中的语义召回插件,而且它也可以独立运行。
3
+ Bamdra 套件中的本地知识库与语义召回层。
4
4
 
5
- ## 它做什么
6
-
7
- - 把记忆内容以 Markdown 可读形式写入本地
8
- - 建立轻量的本地语义索引
9
- - 按当前用户边界限制检索范围
10
- - 为长程记忆回捞提供 Top-K 语义召回
11
- - 保持私有记忆与共享知识分离
5
+ 它可以独立运行,和 `bamdra-openclaw-memory` 配合时效果最好。
12
6
 
13
- ## 开源内容说明
7
+ [English README](./README.md)
14
8
 
15
- 当前开源版的实际源码已经包含在这个仓库里。
9
+ ## 它做什么
16
10
 
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)
11
+ `bamdra-memory-vector` 会把本地 Markdown 变成真正可维护的知识库。
23
12
 
24
- 仓库目前看起来比较轻,是因为首个公开版本刻意保持为紧凑、单入口插件。
13
+ 它会索引:
25
14
 
26
- ## 当前运行模型
15
+ - `knowledge/`
16
+ - `docs/`
17
+ - `notes/`
18
+ - `ideas/`
27
19
 
28
- - 私有 Markdown 根目录:
29
- `~/.openclaw/memory/vector/markdown/private/`
30
- - 共享 Markdown 根目录:
31
- `~/.openclaw/memory/vector/markdown/shared/`
32
- - 本地索引:
33
- `~/.openclaw/memory/vector/index.json`
20
+ 并尽量让 OpenClaw 在上网之前先查本地知识。
34
21
 
35
- 这一版提供的是轻量本地向量式索引接口,同时为后续 LanceDB 演进保留接入面。
22
+ ## 为什么重要
36
23
 
37
- `markdownRoot` 仍然保留兼容,但更推荐在正式环境里显式设置 `privateMarkdownRoot` 和 `sharedMarkdownRoot`。
24
+ 很多记忆系统最弱的一层,其实就是知识库层:
38
25
 
39
- ## 随包 Skill
26
+ - 知识越来越黑盒
27
+ - 人不再愿意维护
28
+ - web search 被过度使用
29
+ - 延迟和 token 成本不断上升
40
30
 
41
- 这个包现在会附带独立的 operator skill:
31
+ 这个插件补上的,正是这块短板。它让知识继续保持本地、可读、可改。
42
32
 
43
- - `bamdra-memory-vector-operator`
33
+ ## 最佳实践目录
44
34
 
45
- 安装到 OpenClaw 后,bootstrap 可以把它复制到 `~/.openclaw/skills/` 并自动挂到 agent。
35
+ ```text
36
+ private/
37
+ knowledge/
38
+ docs/
39
+ notes/
40
+ ideas/
46
41
 
47
- ## 最佳实践:兼容 Obsidian 的双库布局
42
+ shared/
43
+ knowledge/
44
+ docs/
45
+ notes/
46
+ ideas/
47
+ ```
48
48
 
49
- 插件现在支持把私有记忆和共享知识分别落到两个 Markdown 根目录。这意味着你可以把 Markdown 指向 Obsidian 仓库、iCloud Drive、Git 同步目录或者 Syncthing 目录,而把本地索引仍然保留在 `~/.openclaw` 下面。
49
+ ## 最佳实践存储方式
50
50
 
51
- 推荐配置示例:
51
+ 索引留在本地,Markdown 根目录指向一个会同步、会编辑的目录。
52
52
 
53
53
  ```json
54
54
  {
55
55
  "enabled": true,
56
56
  "privateMarkdownRoot": "~/Documents/Obsidian/MyVault/openclaw/private",
57
57
  "sharedMarkdownRoot": "~/Documents/Obsidian/MyVault/openclaw/shared",
58
- "indexPath": "~/.openclaw/memory/vector/index.json",
59
- "dimensions": 64
58
+ "indexPath": "~/.openclaw/memory/vector/index.json"
60
59
  }
61
60
  ```
62
61
 
63
- 这样做的好处是:
62
+ 这尤其适合:
64
63
 
65
- - 私有记忆和共享知识库天然分开
66
- - Markdown 文件可以在任何同步设备上直接编辑
67
- - OpenClaw 继续使用本地索引,不依赖远端向量服务
68
- - 更适合把 Obsidian 作为长期知识库编辑入口
64
+ - Obsidian
65
+ - iCloud Drive
66
+ - Git 同步仓库
67
+ - Syncthing 工作区
69
68
 
70
- ## 产品定位
69
+ ## 它能解锁什么
71
70
 
72
- `bamdra-memory-vector` 不是用来替代 `bamdra-openclaw-memory` 的。
71
+ `bamdra-openclaw-memory` 组合时:
73
72
 
74
- - `bamdra-openclaw-memory` 更强调连续性
75
- - `bamdra-memory-vector` 更强调召回增强
73
+ - 旧工作可以通过模糊召回被重新找回
74
+ - 本地文档能进入答案链路,而不是靠 prompt 硬塞
76
75
 
77
- 两者组合后的价值是:
76
+ 与 `bamdra-user-bind` 组合时:
78
77
 
79
- - 更强的长会话连续性
80
- - Markdown 可读、可维护的记忆载体
81
- - 不依赖重型基础设施的轻量语义召回
78
+ - 私有知识会继续对齐到正确用户边界
82
79
 
83
- ## 构建
80
+ ## 仓库地址
84
81
 
85
- ```bash
86
- pnpm run bundle
87
- ```
82
+ - [GitHub 首页](https://github.com/bamdra)
83
+ - [仓库地址](https://github.com/bamdra/bamdra-memory-vector)
package/dist/index.js CHANGED
@@ -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.8",
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.8",
3
+ "version": "0.1.10",
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",
@@ -24,12 +24,16 @@ It complements topic memory. Use it when the user remembers something fuzzily, w
24
24
  - keep cross-user boundaries intact
25
25
  - do not flood the prompt with low-signal chunks
26
26
  - prefer a few strong recalls over many weak ones
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
27
29
 
28
30
  ## Markdown Knowledge Model
29
31
 
30
32
  - private Markdown is for one user's durable notes and memory fragments
31
33
  - shared Markdown is for team or reusable knowledge
32
34
  - both are editable by humans outside the runtime
35
+ - common human-managed directories include `knowledge/`, `docs/`, `notes/`, and `ideas/`
36
+ - `_runtime/` is system-managed and should not be treated as the main editing area
33
37
 
34
38
  ## Shared vs Private
35
39
 
@@ -54,3 +58,4 @@ Shared examples:
54
58
  - never treat another user's private Markdown as searchable context
55
59
  - do not reveal storage paths unless the user asks
56
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