@xdarkicex/openclaw-memory-libravdb 1.6.20 → 1.6.22
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 +4 -1
- package/dist/context-engine.d.ts +13 -0
- package/dist/context-engine.js +116 -0
- package/dist/index.js +146 -65
- package/dist/plugin-runtime.d.ts +1 -0
- package/dist/plugin-runtime.js +55 -1
- package/dist/types.d.ts +4 -0
- package/docs/configuration.md +3 -3
- package/docs/install.md +66 -7
- package/docs/installation.md +77 -9
- package/openclaw.plugin.json +40 -16
- package/package.json +2 -2
package/docs/install.md
CHANGED
|
@@ -37,7 +37,8 @@ openclaw plugins install @xdarkicex/openclaw-memory-libravdb
|
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
If you use the OpenClaw.ai plugin UI instead of the CLI, install the same
|
|
40
|
-
package and then assign the plugin id `libravdb-memory` to the `memory`
|
|
40
|
+
package and then assign the plugin id `libravdb-memory` to the `memory` and
|
|
41
|
+
`contextEngine` slots.
|
|
41
42
|
|
|
42
43
|
Activate the plugin in `~/.openclaw/openclaw.json`:
|
|
43
44
|
|
|
@@ -45,7 +46,8 @@ Activate the plugin in `~/.openclaw/openclaw.json`:
|
|
|
45
46
|
{
|
|
46
47
|
"plugins": {
|
|
47
48
|
"slots": {
|
|
48
|
-
"memory": "libravdb-memory"
|
|
49
|
+
"memory": "libravdb-memory",
|
|
50
|
+
"contextEngine": "libravdb-memory"
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
}
|
|
@@ -57,7 +59,8 @@ If you run the daemon on a non-default endpoint, add a plugin config:
|
|
|
57
59
|
{
|
|
58
60
|
"plugins": {
|
|
59
61
|
"slots": {
|
|
60
|
-
"memory": "libravdb-memory"
|
|
62
|
+
"memory": "libravdb-memory",
|
|
63
|
+
"contextEngine": "libravdb-memory"
|
|
61
64
|
},
|
|
62
65
|
"entries": {
|
|
63
66
|
"libravdb-memory": {
|
|
@@ -73,7 +76,7 @@ If you run the daemon on a non-default endpoint, add a plugin config:
|
|
|
73
76
|
|
|
74
77
|
When `sidecarPath` is set to `"auto"`, the plugin resolves endpoints in this order on macOS/Linux:
|
|
75
78
|
|
|
76
|
-
1. `
|
|
79
|
+
1. `LIBRAVDB_GRPC_ENDPOINT` if it is set to a valid daemon endpoint
|
|
77
80
|
2. `$HOME/.libravdbd/run/libravdb.sock` if it exists
|
|
78
81
|
3. `/opt/homebrew/var/libravdbd/run/libravdb.sock` if it exists
|
|
79
82
|
4. `/usr/local/var/libravdbd/run/libravdb.sock` if it exists
|
|
@@ -81,7 +84,7 @@ When `sidecarPath` is set to `"auto"`, the plugin resolves endpoints in this ord
|
|
|
81
84
|
|
|
82
85
|
## Sidecar Daemon Install
|
|
83
86
|
|
|
84
|
-
The daemon owns the local database, embeddings, and
|
|
87
|
+
The daemon owns the local database, embeddings, and gRPC endpoint.
|
|
85
88
|
|
|
86
89
|
Default endpoints:
|
|
87
90
|
|
|
@@ -155,12 +158,68 @@ libravdbd serve
|
|
|
155
158
|
That mode is useful for debugging or validating a local release asset before
|
|
156
159
|
you wrap it in `brew services`, `systemd`, or `launchd`.
|
|
157
160
|
|
|
161
|
+
### Containers and Docker
|
|
162
|
+
|
|
163
|
+
The npm plugin does not start `libravdbd`. In a container, either run a separate
|
|
164
|
+
daemon sidecar or use a small entrypoint wrapper that starts the daemon before
|
|
165
|
+
the OpenClaw gateway.
|
|
166
|
+
|
|
167
|
+
Keep the daemon assets and database in a mounted volume and point both the
|
|
168
|
+
daemon and plugin at paths inside the container:
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
export LIBRAVDB_GRPC_ENDPOINT=unix:/home/node/.openclaw/libravdbd/run/libravdb.sock
|
|
172
|
+
export LIBRAVDB_DB_PATH=/home/node/.openclaw/libravdbd/data.libravdb
|
|
173
|
+
export LIBRAVDB_ONNX_RUNTIME=/home/node/.openclaw/libravdbd/models/onnxruntime/lib/libonnxruntime.so
|
|
174
|
+
export LIBRAVDB_EMBEDDING_MODEL=/home/node/.openclaw/libravdbd/models/nomic-embed-text-v1.5
|
|
175
|
+
export LIBRAVDB_ONNX_DEVICE=cpu
|
|
176
|
+
libravdbd serve &
|
|
177
|
+
|
|
178
|
+
# Wait for socket to be ready
|
|
179
|
+
for i in {1..30}; do
|
|
180
|
+
[ -S "$LIBRAVDB_GRPC_ENDPOINT" ] && break
|
|
181
|
+
sleep 0.5
|
|
182
|
+
done
|
|
183
|
+
|
|
184
|
+
node dist/index.js gateway --bind lan --port 18789
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Use matching plugin config:
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"plugins": {
|
|
192
|
+
"slots": {
|
|
193
|
+
"memory": "libravdb-memory",
|
|
194
|
+
"contextEngine": "libravdb-memory"
|
|
195
|
+
},
|
|
196
|
+
"entries": {
|
|
197
|
+
"libravdb-memory": {
|
|
198
|
+
"enabled": true,
|
|
199
|
+
"config": {
|
|
200
|
+
"sidecarPath": "unix:/home/node/.openclaw/libravdbd/run/libravdb.sock",
|
|
201
|
+
"embeddingBackend": "onnx-local",
|
|
202
|
+
"embeddingRuntimePath": "/home/node/.openclaw/libravdbd/models/onnxruntime/lib/libonnxruntime.so",
|
|
203
|
+
"embeddingModelPath": "/home/node/.openclaw/libravdbd/models/nomic-embed-text-v1.5",
|
|
204
|
+
"onnxDevice": "cpu"
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
For public bots, deny manual memory tools unless users are supposed to query the
|
|
213
|
+
store directly. The context engine can still use LibraVDB for recall while
|
|
214
|
+
`memory_search` and `memory_get` remain unavailable to channel users.
|
|
215
|
+
|
|
158
216
|
## Lifecycle Management
|
|
159
217
|
|
|
160
218
|
### Plugin Lifecycle
|
|
161
219
|
|
|
162
220
|
- Install the package with `openclaw plugins install`.
|
|
163
|
-
- Activate it by assigning `libravdb-memory` to the `memory`
|
|
221
|
+
- Activate it by assigning `libravdb-memory` to the `memory` and
|
|
222
|
+
`contextEngine` slots.
|
|
164
223
|
- Update it with your normal OpenClaw plugin update flow.
|
|
165
224
|
- Disable it by removing the slot assignment from `~/.openclaw/openclaw.json`.
|
|
166
225
|
|
|
@@ -185,7 +244,7 @@ openclaw memory status
|
|
|
185
244
|
Healthy output should show that:
|
|
186
245
|
|
|
187
246
|
- the daemon answered the local health check
|
|
188
|
-
- the memory
|
|
247
|
+
- the memory and context-engine slots are active
|
|
189
248
|
- the plugin can read stored counts and runtime settings
|
|
190
249
|
|
|
191
250
|
If OpenClaw cannot reach the daemon, verify the endpoint first:
|
package/docs/installation.md
CHANGED
|
@@ -60,20 +60,22 @@ or run `libravdbd serve` in a terminal for validation.
|
|
|
60
60
|
|
|
61
61
|
## Activation
|
|
62
62
|
|
|
63
|
-
Assign `libravdb-memory` to the OpenClaw memory
|
|
63
|
+
Assign `libravdb-memory` to the OpenClaw memory and context-engine slots:
|
|
64
64
|
|
|
65
65
|
```json
|
|
66
66
|
{
|
|
67
67
|
"plugins": {
|
|
68
68
|
"slots": {
|
|
69
|
-
"memory": "libravdb-memory"
|
|
69
|
+
"memory": "libravdb-memory",
|
|
70
|
+
"contextEngine": "libravdb-memory"
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
```
|
|
74
75
|
|
|
75
|
-
The
|
|
76
|
-
|
|
76
|
+
The memory slot owns `openclaw memory ...` and memory-runtime calls. The
|
|
77
|
+
context-engine slot enables automatic bootstrap, ingest, after-turn, and recall
|
|
78
|
+
hooks during sessions.
|
|
77
79
|
|
|
78
80
|
If the daemon uses a non-default endpoint, add `sidecarPath`:
|
|
79
81
|
|
|
@@ -81,7 +83,8 @@ If the daemon uses a non-default endpoint, add `sidecarPath`:
|
|
|
81
83
|
{
|
|
82
84
|
"plugins": {
|
|
83
85
|
"slots": {
|
|
84
|
-
"memory": "libravdb-memory"
|
|
86
|
+
"memory": "libravdb-memory",
|
|
87
|
+
"contextEngine": "libravdb-memory"
|
|
85
88
|
},
|
|
86
89
|
"entries": {
|
|
87
90
|
"libravdb-memory": {
|
|
@@ -97,7 +100,7 @@ If the daemon uses a non-default endpoint, add `sidecarPath`:
|
|
|
97
100
|
|
|
98
101
|
When `sidecarPath` is `"auto"`, macOS/Linux endpoint resolution checks:
|
|
99
102
|
|
|
100
|
-
1. `
|
|
103
|
+
1. `LIBRAVDB_GRPC_ENDPOINT`
|
|
101
104
|
2. `$HOME/.libravdbd/run/libravdb.sock`
|
|
102
105
|
3. `/opt/homebrew/var/libravdbd/run/libravdb.sock`
|
|
103
106
|
4. `/usr/local/var/libravdbd/run/libravdb.sock`
|
|
@@ -117,6 +120,59 @@ Default data path:
|
|
|
117
120
|
$HOME/.libravdbd/data_nomic-embed-text-v1_5.libravdb
|
|
118
121
|
```
|
|
119
122
|
|
|
123
|
+
## Container Layout
|
|
124
|
+
|
|
125
|
+
In Docker, keep the daemon, model assets, socket, logs, and database in the
|
|
126
|
+
same mounted OpenClaw state volume. A typical container-side layout is:
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
/home/node/.openclaw/bin/libravdbd
|
|
130
|
+
/home/node/.openclaw/libravdbd/run/libravdb.sock
|
|
131
|
+
/home/node/.openclaw/libravdbd/data.libravdb
|
|
132
|
+
/home/node/.openclaw/libravdbd/models/onnxruntime/lib/libonnxruntime.so
|
|
133
|
+
/home/node/.openclaw/libravdbd/models/nomic-embed-text-v1.5/embedding.json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Start the daemon with explicit local ONNX paths before starting the gateway:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
LIBRAVDB_GRPC_ENDPOINT=unix:/home/node/.openclaw/libravdbd/run/libravdb.sock \
|
|
140
|
+
LIBRAVDB_DB_PATH=/home/node/.openclaw/libravdbd/data.libravdb \
|
|
141
|
+
LIBRAVDB_ONNX_RUNTIME=/home/node/.openclaw/libravdbd/models/onnxruntime/lib/libonnxruntime.so \
|
|
142
|
+
LIBRAVDB_EMBEDDING_MODEL=/home/node/.openclaw/libravdbd/models/nomic-embed-text-v1.5 \
|
|
143
|
+
LIBRAVDB_ONNX_DEVICE=cpu \
|
|
144
|
+
/home/node/.openclaw/bin/libravdbd serve
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Then configure the plugin with the same socket and asset paths:
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"plugins": {
|
|
152
|
+
"slots": {
|
|
153
|
+
"memory": "libravdb-memory",
|
|
154
|
+
"contextEngine": "libravdb-memory"
|
|
155
|
+
},
|
|
156
|
+
"entries": {
|
|
157
|
+
"libravdb-memory": {
|
|
158
|
+
"enabled": true,
|
|
159
|
+
"config": {
|
|
160
|
+
"sidecarPath": "unix:/home/node/.openclaw/libravdbd/run/libravdb.sock",
|
|
161
|
+
"embeddingBackend": "onnx-local",
|
|
162
|
+
"embeddingRuntimePath": "/home/node/.openclaw/libravdbd/models/onnxruntime/lib/libonnxruntime.so",
|
|
163
|
+
"embeddingModelPath": "/home/node/.openclaw/libravdbd/models/nomic-embed-text-v1.5",
|
|
164
|
+
"onnxDevice": "cpu"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Do not let a container initialize a database with deterministic fallback
|
|
173
|
+
embeddings and later switch the same file to ONNX embeddings. Move the fallback
|
|
174
|
+
database aside first, then let the daemon create a fresh ONNX-backed store.
|
|
175
|
+
|
|
120
176
|
## Verification
|
|
121
177
|
|
|
122
178
|
Run:
|
|
@@ -157,6 +213,8 @@ Common causes:
|
|
|
157
213
|
- `sidecarPath` points at the wrong endpoint
|
|
158
214
|
- ONNX Runtime assets are missing or unpacked in the wrong place
|
|
159
215
|
- a model asset failed checksum validation
|
|
216
|
+
- `embeddingBackend` is set to `onnx-local` but `embeddingRuntimePath` or
|
|
217
|
+
`embeddingModelPath` is missing from plugin config
|
|
160
218
|
|
|
161
219
|
Check the daemon first:
|
|
162
220
|
|
|
@@ -171,6 +229,15 @@ For foreground debugging:
|
|
|
171
229
|
libravdbd serve
|
|
172
230
|
```
|
|
173
231
|
|
|
232
|
+
### Deterministic fallback embeddings
|
|
233
|
+
|
|
234
|
+
If daemon logs mention deterministic fallback mode, the daemon did not find the
|
|
235
|
+
configured ONNX runtime or model manifest. Stop the daemon, set
|
|
236
|
+
`LIBRAVDB_ONNX_RUNTIME` and `LIBRAVDB_EMBEDDING_MODEL`, confirm the model
|
|
237
|
+
directory contains `embedding.json`, then restart. If a database was created
|
|
238
|
+
while fallback mode was active, move that `.libravdb` file and its adjacent
|
|
239
|
+
`.embedding.json` aside before starting with ONNX assets.
|
|
240
|
+
|
|
174
241
|
### Incompatible database or embedding profile
|
|
175
242
|
|
|
176
243
|
If the daemon exits with `database format is incompatible` or `database
|
|
@@ -202,9 +269,10 @@ setup, or republish the release with corrected checksums.
|
|
|
202
269
|
|
|
203
270
|
### Default memory still appears active
|
|
204
271
|
|
|
205
|
-
Confirm that `libravdb-memory` is assigned to `plugins.slots.memory
|
|
206
|
-
Without
|
|
207
|
-
parallel.
|
|
272
|
+
Confirm that `libravdb-memory` is assigned to both `plugins.slots.memory` and
|
|
273
|
+
`plugins.slots.contextEngine`. Without the memory slot, OpenClaw's default
|
|
274
|
+
memory path can continue to run in parallel. Without the context-engine slot,
|
|
275
|
+
automatic session ingest and recall may not run.
|
|
208
276
|
|
|
209
277
|
### Lifecycle journal looks empty
|
|
210
278
|
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "libravdb-memory",
|
|
3
3
|
"name": "LibraVDB Memory",
|
|
4
4
|
"description": "Persistent vector memory with three-tier hybrid scoring",
|
|
5
|
-
"version": "1.6.
|
|
5
|
+
"version": "1.6.22",
|
|
6
6
|
"kind": [
|
|
7
7
|
"memory",
|
|
8
8
|
"context-engine"
|
|
@@ -19,21 +19,43 @@
|
|
|
19
19
|
"configSchema": {
|
|
20
20
|
"type": "object",
|
|
21
21
|
"additionalProperties": false,
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
22
|
+
"allOf": [
|
|
23
|
+
{
|
|
24
|
+
"if": {
|
|
25
|
+
"properties": {
|
|
26
|
+
"embeddingBackend": {
|
|
27
|
+
"const": "remote"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": [
|
|
31
|
+
"embeddingBackend"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"then": {
|
|
35
|
+
"required": [
|
|
36
|
+
"embeddingEndpoint"
|
|
37
|
+
]
|
|
26
38
|
}
|
|
27
39
|
},
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
{
|
|
41
|
+
"if": {
|
|
42
|
+
"properties": {
|
|
43
|
+
"embeddingBackend": {
|
|
44
|
+
"const": "onnx-local"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": [
|
|
48
|
+
"embeddingBackend"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"then": {
|
|
52
|
+
"required": [
|
|
53
|
+
"embeddingRuntimePath",
|
|
54
|
+
"embeddingModelPath"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
],
|
|
37
59
|
"properties": {
|
|
38
60
|
"dbPath": {
|
|
39
61
|
"type": "string"
|
|
@@ -137,7 +159,8 @@
|
|
|
137
159
|
"type": "number"
|
|
138
160
|
},
|
|
139
161
|
"embeddingRuntimePath": {
|
|
140
|
-
"type": "string"
|
|
162
|
+
"type": "string",
|
|
163
|
+
"description": "Path to the ONNX Runtime library visible to the daemon, for example /opt/homebrew/opt/libravdbd/models/onnxruntime/lib/libonnxruntime.dylib or /home/node/.openclaw/libravdbd/models/onnxruntime/lib/libonnxruntime.so."
|
|
141
164
|
},
|
|
142
165
|
"onnxDevice": {
|
|
143
166
|
"type": "string",
|
|
@@ -171,7 +194,8 @@
|
|
|
171
194
|
"default": "bge-small-en-v1.5"
|
|
172
195
|
},
|
|
173
196
|
"embeddingModelPath": {
|
|
174
|
-
"type": "string"
|
|
197
|
+
"type": "string",
|
|
198
|
+
"description": "Directory visible to the daemon containing embedding.json, model.onnx, and tokenizer.json for the selected embeddingProfile."
|
|
175
199
|
},
|
|
176
200
|
"embeddingTokenizerPath": {
|
|
177
201
|
"type": "string"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xdarkicex/openclaw-memory-libravdb",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -79,6 +79,6 @@
|
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@connectrpc/connect": "^1.7.0",
|
|
81
81
|
"@connectrpc/connect-node": "^1.7.0",
|
|
82
|
-
"@xdarkicex/libravdb-contracts": "^0.
|
|
82
|
+
"@xdarkicex/libravdb-contracts": "^2.0.8"
|
|
83
83
|
}
|
|
84
84
|
}
|