@xdarkicex/openclaw-memory-libravdb 1.3.12 → 1.3.17
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 +247 -48
- package/docs/README.md +3 -0
- package/docs/ast-v2.md +47 -5
- package/docs/continuity.md +220 -0
- package/docs/contributing.md +1 -0
- package/docs/elevated-guidance.md +258 -0
- package/docs/implementation.md +60 -2
- package/docs/install.md +181 -0
- package/docs/installation.md +13 -16
- package/docs/mathematics-v2.md +161 -1
- package/docs/uninstall.md +100 -0
- package/openclaw.plugin.json +5 -0
- package/package.json +5 -1
- package/packaging/README.md +36 -0
- package/packaging/homebrew/libravdbd.rb.tmpl +176 -2
- package/packaging/launchd/com.xdarkicex.libravdbd.plist +6 -0
- package/src/cli.ts +47 -0
- package/src/context-engine.ts +596 -157
- package/src/index.ts +6 -1
- package/src/lifecycle-hooks.ts +96 -0
- package/src/memory-provider.ts +80 -17
- package/src/memory-runtime.ts +150 -0
- package/src/openclaw-plugin-sdk.d.ts +1 -0
- package/src/plugin-runtime.ts +53 -4
- package/src/recall-utils.ts +20 -3
- package/src/scoring.ts +130 -0
- package/src/sidecar.ts +45 -1
- package/src/types.ts +28 -0
package/docs/install.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Install Guide
|
|
2
|
+
|
|
3
|
+
LibraVDB Memory is a connect-only OpenClaw plugin. Install the plugin as a
|
|
4
|
+
normal package, install `libravdbd` separately, and point the plugin at the
|
|
5
|
+
daemon endpoint when you need a non-default location.
|
|
6
|
+
|
|
7
|
+
For deeper operational detail, use the full
|
|
8
|
+
[installation reference](./installation.md).
|
|
9
|
+
|
|
10
|
+
## Recommended Path: Homebrew + OpenClaw Plugin
|
|
11
|
+
|
|
12
|
+
On macOS, the shortest supported path is:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
brew tap xDarkicex/openclaw-libravdb-memory
|
|
16
|
+
brew install libravdbd
|
|
17
|
+
brew services start libravdbd
|
|
18
|
+
openclaw plugins install @xdarkicex/openclaw-memory-libravdb
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This gives you:
|
|
22
|
+
|
|
23
|
+
- a managed `libravdbd` service
|
|
24
|
+
- a scanner-clean plugin install
|
|
25
|
+
- a clean separation between plugin lifecycle and daemon lifecycle
|
|
26
|
+
|
|
27
|
+
## Plugin Install
|
|
28
|
+
|
|
29
|
+
Install the plugin package with the OpenClaw CLI:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
openclaw plugins install @xdarkicex/openclaw-memory-libravdb
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If you use the OpenClaw.ai plugin UI instead of the CLI, install the same
|
|
36
|
+
package and then assign the plugin id `libravdb-memory` to both the `memory`
|
|
37
|
+
and `contextEngine` slots.
|
|
38
|
+
|
|
39
|
+
Activate the plugin in `~/.openclaw/openclaw.json`:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"plugins": {
|
|
44
|
+
"slots": {
|
|
45
|
+
"memory": "libravdb-memory",
|
|
46
|
+
"contextEngine": "libravdb-memory"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
If you run the daemon on a non-default endpoint, add a plugin config:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"plugins": {
|
|
57
|
+
"slots": {
|
|
58
|
+
"memory": "libravdb-memory",
|
|
59
|
+
"contextEngine": "libravdb-memory"
|
|
60
|
+
},
|
|
61
|
+
"configs": {
|
|
62
|
+
"libravdb-memory": {
|
|
63
|
+
"sidecarPath": "unix:/Users/<you>/.clawdb/run/libravdb.sock"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Sidecar Daemon Install
|
|
71
|
+
|
|
72
|
+
The daemon owns the local database, embeddings, and JSON-RPC endpoint.
|
|
73
|
+
|
|
74
|
+
Default endpoints:
|
|
75
|
+
|
|
76
|
+
- macOS/Linux: `unix:$HOME/.clawdb/run/libravdb.sock`
|
|
77
|
+
- Windows: `tcp:127.0.0.1:37421`
|
|
78
|
+
|
|
79
|
+
Default data path:
|
|
80
|
+
|
|
81
|
+
- macOS/Linux/Windows user installs: `$HOME/.clawdb/data.libravdb`
|
|
82
|
+
|
|
83
|
+
### Homebrew
|
|
84
|
+
|
|
85
|
+
Homebrew is the preferred daemon lifecycle on macOS:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
brew tap xDarkicex/openclaw-libravdb-memory
|
|
89
|
+
brew install libravdbd
|
|
90
|
+
brew services start libravdbd
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Useful lifecycle commands:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
brew services restart libravdbd
|
|
97
|
+
brew services stop libravdbd
|
|
98
|
+
brew info libravdbd
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Manual Service Management
|
|
102
|
+
|
|
103
|
+
If you are not using Homebrew, manage the daemon explicitly.
|
|
104
|
+
|
|
105
|
+
Linux user service from the repo template:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Replace vX.Y.Z with the latest tag from:
|
|
109
|
+
# https://github.com/xDarkicex/openclaw-memory-libravdb/releases
|
|
110
|
+
mkdir -p ~/.local/bin ~/.config/systemd/user
|
|
111
|
+
curl -L -o ~/.local/bin/libravdbd https://github.com/xDarkicex/openclaw-memory-libravdb/releases/download/vX.Y.Z/libravdbd-linux-amd64
|
|
112
|
+
chmod +x ~/.local/bin/libravdbd
|
|
113
|
+
curl -L -o ~/.config/systemd/user/libravdbd.service \
|
|
114
|
+
https://raw.githubusercontent.com/xDarkicex/openclaw-memory-libravdb/main/packaging/systemd/libravdbd.service
|
|
115
|
+
systemctl --user enable --now libravdbd.service
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
macOS LaunchAgent from the repo template:
|
|
119
|
+
|
|
120
|
+
1. Download `com.xdarkicex.libravdbd.plist` from:
|
|
121
|
+
`https://raw.githubusercontent.com/xDarkicex/openclaw-memory-libravdb/main/packaging/launchd/com.xdarkicex.libravdbd.plist`
|
|
122
|
+
2. Replace `__HOME__` with your home directory.
|
|
123
|
+
3. Save it to `~/Library/LaunchAgents/com.xdarkicex.libravdbd.plist`.
|
|
124
|
+
4. Load it with `launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.xdarkicex.libravdbd.plist`.
|
|
125
|
+
|
|
126
|
+
### Windows
|
|
127
|
+
|
|
128
|
+
Windows uses a loopback TCP endpoint by default:
|
|
129
|
+
|
|
130
|
+
- `tcp:127.0.0.1:37421`
|
|
131
|
+
|
|
132
|
+
This guide does not yet include a full Windows service-install walkthrough.
|
|
133
|
+
For now, use the published Windows daemon asset from the GitHub releases page
|
|
134
|
+
and run it under your preferred process supervisor or a manual terminal session.
|
|
135
|
+
|
|
136
|
+
Foreground manual run:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
libravdbd serve
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
That mode is useful for debugging or validating a local release asset before
|
|
143
|
+
you wrap it in `brew services`, `systemd`, or `launchd`.
|
|
144
|
+
|
|
145
|
+
## Lifecycle Management
|
|
146
|
+
|
|
147
|
+
### Plugin Lifecycle
|
|
148
|
+
|
|
149
|
+
- Install the package with `openclaw plugins install`.
|
|
150
|
+
- Activate it by assigning `libravdb-memory` to both `memory` and `contextEngine`.
|
|
151
|
+
- Update it with your normal OpenClaw plugin update flow.
|
|
152
|
+
- Disable it by removing the slot assignment from `~/.openclaw/openclaw.json`.
|
|
153
|
+
|
|
154
|
+
The plugin does not manage the daemon process. Treat plugin activation and
|
|
155
|
+
daemon supervision as separate lifecycle decisions.
|
|
156
|
+
|
|
157
|
+
### Daemon Lifecycle
|
|
158
|
+
|
|
159
|
+
- Start it with `brew services`, `systemd --user`, `launchctl bootstrap`, or a manual `libravdbd serve`.
|
|
160
|
+
- Restart it when you change daemon-level environment variables or replace the binary.
|
|
161
|
+
- Stop it before uninstalling or deleting on-disk data.
|
|
162
|
+
- Point the plugin at the correct endpoint with `sidecarPath` if you do not use the default location.
|
|
163
|
+
|
|
164
|
+
## Verification
|
|
165
|
+
|
|
166
|
+
After the plugin and daemon are both in place, run:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
openclaw memory status
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Healthy output should show that:
|
|
173
|
+
|
|
174
|
+
- the daemon answered the local health check
|
|
175
|
+
- the memory slot is active
|
|
176
|
+
- the plugin can read stored counts and runtime settings
|
|
177
|
+
|
|
178
|
+
If OpenClaw cannot reach the daemon, verify the endpoint first:
|
|
179
|
+
|
|
180
|
+
- macOS/Linux default: `unix:$HOME/.clawdb/run/libravdb.sock`
|
|
181
|
+
- Windows default: `tcp:127.0.0.1:37421`
|
package/docs/installation.md
CHANGED
|
@@ -7,7 +7,7 @@ This document is the full installation reference for `@xdarkicex/openclaw-memory
|
|
|
7
7
|
| Requirement | Minimum | Recommended | Notes |
|
|
8
8
|
|---|---|---|---|
|
|
9
9
|
| Node.js | `22.0.0` | Latest LTS | Enforced in [`package.json`](../package.json) `engines.node` |
|
|
10
|
-
| OpenClaw | `2026.3.22` | Current stable | Pinned by [`package.json`](../package.json) `peerDependencies.openclaw`; this is the earliest local tag confirmed to expose `definePluginEntry`, `registerContextEngine`, `registerMemoryPromptSection`, and the plugin API shape this repo uses |
|
|
10
|
+
| OpenClaw | `2026.3.22` | Current stable | Pinned by [`package.json`](../package.json) `peerDependencies.openclaw`; this is the earliest local tag confirmed to expose `definePluginEntry`, `registerContextEngine`, `registerMemoryPromptSection`, and the base plugin API shape this repo uses. Newer hosts may also expose the optional `registerMemoryRuntime` seam, which this plugin now adopts when available |
|
|
11
11
|
| Go | `1.22` | Latest stable | Required only for local daemon development, not for normal plugin install |
|
|
12
12
|
| Disk | about `1 GB` free for default Nomic install | `2 GB+` if provisioning optional T5 and leaving room for DB growth | See Resource Requirements below |
|
|
13
13
|
| RAM | about `512 MB` for embed-only runtime | `1 GB+` if optional T5 summarizer is provisioned | Based on local RSS measurements below |
|
|
@@ -183,6 +183,8 @@ The release workflow generates a publish-ready `libravdbd.rb` formula asset from
|
|
|
183
183
|
- `libravdbd-linux-amd64`
|
|
184
184
|
- `libravdbd-linux-arm64`
|
|
185
185
|
|
|
186
|
+
The generated Homebrew formula also stages the bundled ONNX Runtime archive, the shipped embedding profile assets, and the T5 summarizer bundle into the install prefix so the daemon can start without a separate manual asset unpack step.
|
|
187
|
+
|
|
186
188
|
If your GitHub Actions configuration includes:
|
|
187
189
|
|
|
188
190
|
- repository variable `HOMEBREW_TAP_REPO`, for example `xDarkicex/homebrew-openclaw-libravdb-memory`
|
|
@@ -196,7 +198,8 @@ Example plugin config:
|
|
|
196
198
|
{
|
|
197
199
|
"plugins": {
|
|
198
200
|
"slots": {
|
|
199
|
-
"memory": "libravdb-memory"
|
|
201
|
+
"memory": "libravdb-memory",
|
|
202
|
+
"contextEngine": "libravdb-memory"
|
|
200
203
|
},
|
|
201
204
|
"configs": {
|
|
202
205
|
"libravdb-memory": {
|
|
@@ -217,7 +220,7 @@ Installed plugin: libravdb-memory
|
|
|
217
220
|
|
|
218
221
|
## Activation
|
|
219
222
|
|
|
220
|
-
The plugin declares `kind: ["memory", "context-engine"]` and
|
|
223
|
+
The plugin declares `kind: ["memory", "context-engine"]` and is intended to own both the `memory` and `contextEngine` slots together. Treat partial slot assignment as a misconfiguration.
|
|
221
224
|
|
|
222
225
|
Add this to `~/.openclaw/openclaw.json`:
|
|
223
226
|
|
|
@@ -225,18 +228,7 @@ Add this to `~/.openclaw/openclaw.json`:
|
|
|
225
228
|
{
|
|
226
229
|
"plugins": {
|
|
227
230
|
"slots": {
|
|
228
|
-
"memory": "libravdb-memory"
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
If your OpenClaw build uses the `contextEngine` slot instead, you can assign it there:
|
|
235
|
-
|
|
236
|
-
```json
|
|
237
|
-
{
|
|
238
|
-
"plugins": {
|
|
239
|
-
"slots": {
|
|
231
|
+
"memory": "libravdb-memory",
|
|
240
232
|
"contextEngine": "libravdb-memory"
|
|
241
233
|
}
|
|
242
234
|
}
|
|
@@ -245,8 +237,13 @@ If your OpenClaw build uses the `contextEngine` slot instead, you can assign it
|
|
|
245
237
|
|
|
246
238
|
Notes:
|
|
247
239
|
|
|
248
|
-
-
|
|
240
|
+
- This plugin should own both `memory` and `contextEngine`. Do not assign only one of them.
|
|
249
241
|
- The plugin id is `libravdb-memory`. The npm package name used at install time is `@xdarkicex/openclaw-memory-libravdb`.
|
|
242
|
+
- On newer OpenClaw versions, the plugin also registers a memory runtime bridge so the built-in `memory_search` tool can query libraVDB through the same sidecar-backed retrieval path.
|
|
243
|
+
- On newer OpenClaw versions, the plugin also listens for `before_reset` and `session_end` so it can send best-effort lifecycle hints into the sidecar.
|
|
244
|
+
- Those hints are journaled internally by the sidecar and can be inspected with `openclaw memory journal` without exposing them to normal memory export or recall.
|
|
245
|
+
- The journal keeps only a bounded number of newest entries. Override that cap with `plugins.configs.libravdb-memory.lifecycleJournalMaxEntries` if you need a different retention window.
|
|
246
|
+
- The plugin does not currently register `registerMemoryFlushPlan`; transcript ingest and compaction remain owned by the context-engine lifecycle and the sidecar.
|
|
250
247
|
|
|
251
248
|
Without a slot entry, OpenClaw's default memory can continue to run in parallel.
|
|
252
249
|
|
package/docs/mathematics-v2.md
CHANGED
|
@@ -5,7 +5,9 @@ by the plugin. The gating scalar is documented separately in
|
|
|
5
5
|
[gating.md](./gating.md). The continuity model and recent-tail preservation
|
|
6
6
|
layer are documented in [continuity.md](./continuity.md). The authored
|
|
7
7
|
invariant/variant partitioning rules are documented in
|
|
8
|
-
[ast-v2.md](./ast-v2.md).
|
|
8
|
+
[ast-v2.md](./ast-v2.md). The protected-shadow-rule Tier 1.5 model is
|
|
9
|
+
documented in [elevated-guidance.md](./elevated-guidance.md). Earlier
|
|
10
|
+
non-versioned math docs are preserved for
|
|
9
11
|
historical context, but the reviewed `*-v*` documents are authoritative when
|
|
10
12
|
both forms exist.
|
|
11
13
|
|
|
@@ -603,6 +605,69 @@ $$
|
|
|
603
605
|
|
|
604
606
|
This makes compaction load-bearing in retrieval rather than archival only.
|
|
605
607
|
|
|
608
|
+
### 5.6 Optional Lossless Compaction Extension
|
|
609
|
+
|
|
610
|
+
The current implementation replaces compacted session turns in the searchable
|
|
611
|
+
session collection after summary insertion succeeds. A stronger future variant
|
|
612
|
+
is to preserve compacted raw turns in an immutable session-history layer and
|
|
613
|
+
treat summary records as derived view nodes over that history. This extension is
|
|
614
|
+
inspired by the immutable-store and expandable-summary architecture in the LCM
|
|
615
|
+
paper ([Ehrlich and Blackman, 2026](https://papers.voltropy.com/LCM)), but the
|
|
616
|
+
formalization here is adapted to this repository's existing compaction and
|
|
617
|
+
continuity math.
|
|
618
|
+
|
|
619
|
+
Let:
|
|
620
|
+
|
|
621
|
+
$$
|
|
622
|
+
\mathcal{R}_{\mathrm{session}}=\langle r_1,\dots,r_n\rangle
|
|
623
|
+
$$
|
|
624
|
+
|
|
625
|
+
be the immutable raw session history, and let:
|
|
626
|
+
|
|
627
|
+
$$
|
|
628
|
+
\mathbf{S}=\{s_1,s_2,\dots\}
|
|
629
|
+
$$
|
|
630
|
+
|
|
631
|
+
be the set of compacted summary nodes. Define the summary-coverage DAG:
|
|
632
|
+
|
|
633
|
+
$$
|
|
634
|
+
\mathcal{G}_{\mathrm{cont}}=(\mathbf{S}\cup\mathcal{R}_{\mathrm{session}}, E_{\triangleleft})
|
|
635
|
+
$$
|
|
636
|
+
|
|
637
|
+
with:
|
|
638
|
+
|
|
639
|
+
$$
|
|
640
|
+
E_{\triangleleft}\subseteq (\mathbf{S}\times\mathbf{S})\cup(\mathbf{S}\times\mathcal{R}_{\mathrm{session}})
|
|
641
|
+
$$
|
|
642
|
+
|
|
643
|
+
Recursive raw expansion is:
|
|
644
|
+
|
|
645
|
+
$$
|
|
646
|
+
\mathrm{Expand}^{*}(x)=
|
|
647
|
+
\begin{cases}
|
|
648
|
+
\{x\} & \text{if } x\in\mathcal{R}_{\mathrm{session}} \\
|
|
649
|
+
\bigcup_{y:(x,y)\in E_{\triangleleft}} \mathrm{Expand}^{*}(y) & \text{if } x\in\mathbf{S}
|
|
650
|
+
\end{cases}
|
|
651
|
+
$$
|
|
652
|
+
|
|
653
|
+
The continuity contract for this extension is:
|
|
654
|
+
|
|
655
|
+
$$
|
|
656
|
+
\forall s\in\mathbf{S},\ \mathrm{Expand}^{*}(s)\neq\emptyset
|
|
657
|
+
$$
|
|
658
|
+
|
|
659
|
+
and:
|
|
660
|
+
|
|
661
|
+
$$
|
|
662
|
+
\forall r\in\mathcal{R}_{\mathrm{session}},\ \exists x\in \mathbf{S}\cup T_{\mathrm{recent}} \text{ such that } r\in\mathrm{Expand}^{*}(x)
|
|
663
|
+
$$
|
|
664
|
+
|
|
665
|
+
Under this extension, compaction changes the active retrievable view and the
|
|
666
|
+
assembly surface, but not the existence of raw historical evidence. This is
|
|
667
|
+
compatible with the section-1 through section-5 retrieval math because the
|
|
668
|
+
hybrid score still applies to the injected/searchable nodes; the extension only
|
|
669
|
+
strengthens the recoverability contract beneath those nodes.
|
|
670
|
+
|
|
606
671
|
## 6. Why These Pieces Compose
|
|
607
672
|
|
|
608
673
|
The full quality loop is:
|
|
@@ -1226,3 +1291,98 @@ Q(d)\in[1-\delta,\,1]\subseteq[0,1]
|
|
|
1226
1291
|
$$
|
|
1227
1292
|
|
|
1228
1293
|
for all valid inputs with $\delta\in[0,1]$.
|
|
1294
|
+
|
|
1295
|
+
## 8. Theory Boundary And Future Refinement
|
|
1296
|
+
|
|
1297
|
+
Cross-review of this document and [`continuity.md`](./continuity.md) surfaced a
|
|
1298
|
+
useful mathematical boundary that this reference should keep explicit:
|
|
1299
|
+
|
|
1300
|
+
1. storage and continuity axioms
|
|
1301
|
+
2. primary retrieval and assembly math
|
|
1302
|
+
3. optional recoverability policy
|
|
1303
|
+
|
|
1304
|
+
### 8.1 What Is Core Math
|
|
1305
|
+
|
|
1306
|
+
The core retrieval theorem in this document is the scored, budgeted selection
|
|
1307
|
+
of retrievable nodes from $\mathcal{V}_{\mathrm{rest}}$ together with authored
|
|
1308
|
+
invariants and the exact recent tail. In other words, the primary law remains:
|
|
1309
|
+
|
|
1310
|
+
$$
|
|
1311
|
+
C_{\mathrm{total}}(q)=\mathcal{I}_1\cup \mathcal{I}_2^{*}\cup T_{\mathrm{recent}}\cup \mathrm{Proj}(\mathcal{V}_{\mathrm{rest}}, q)
|
|
1312
|
+
$$
|
|
1313
|
+
|
|
1314
|
+
with the retrieval side governed by:
|
|
1315
|
+
|
|
1316
|
+
$$
|
|
1317
|
+
S_{\mathrm{final}}(d)=S_{\mathrm{base}}(d)\cdot Q(d)
|
|
1318
|
+
$$
|
|
1319
|
+
|
|
1320
|
+
and the budget side governed by the residual variant budget
|
|
1321
|
+
$\tau_{\mathcal{V}}(q)$ defined in Section 7.8.
|
|
1322
|
+
|
|
1323
|
+
### 8.2 What Is Not Core Math
|
|
1324
|
+
|
|
1325
|
+
The following should be treated as policy or heuristic unless they are derived
|
|
1326
|
+
from the governing score equations and budget laws:
|
|
1327
|
+
|
|
1328
|
+
- automatic query-time summary expansion
|
|
1329
|
+
- fixed expansion penalties
|
|
1330
|
+
- fixed expansion token sub-budgets
|
|
1331
|
+
- confidence thresholds for expansion eligibility
|
|
1332
|
+
- recursion-depth limits for summary expansion
|
|
1333
|
+
|
|
1334
|
+
These controls may be useful in runtime experiments, but they are not theorem
|
|
1335
|
+
terms by default. They should not be mistaken for new axioms of the scoring
|
|
1336
|
+
model.
|
|
1337
|
+
|
|
1338
|
+
### 8.3 Lossless Does Not Mean Always Expand
|
|
1339
|
+
|
|
1340
|
+
The lossless extension in Section 5.6 strengthens the storage and
|
|
1341
|
+
recoverability contract. It does not imply that every relevant summary should be
|
|
1342
|
+
expanded into raw turns during ordinary retrieval.
|
|
1343
|
+
|
|
1344
|
+
The mathematically safe reading is:
|
|
1345
|
+
|
|
1346
|
+
- raw immutability is an axiom
|
|
1347
|
+
- $\mathrm{Expand}^{*}$ is a recoverability theorem over the summary DAG
|
|
1348
|
+
- query-time expansion is **explicit recovery/audit only** — it was removed from
|
|
1349
|
+
the hot retrieval path and is not the default behavior; any expansion beyond
|
|
1350
|
+
the core $C_{\mathrm{total}}(q)$ assembly must be triggered deliberately, not
|
|
1351
|
+
applied silently to ranked candidates
|
|
1352
|
+
|
|
1353
|
+
This distinction preserves the design goal that continuity and recoverability
|
|
1354
|
+
support retrieval without silently replacing it.
|
|
1355
|
+
|
|
1356
|
+
### 8.4 Preferred Direction For Future Refinement
|
|
1357
|
+
|
|
1358
|
+
If a future version wants query-time expansion inside the main retrieval path,
|
|
1359
|
+
the preferred direction is to re-derive it from the existing two-pass and
|
|
1360
|
+
multi-hop framework rather than introduce standalone penalties and thresholds
|
|
1361
|
+
that float outside the score model.
|
|
1362
|
+
|
|
1363
|
+
In practical terms, future refinement should prefer one of two paths:
|
|
1364
|
+
|
|
1365
|
+
1. keep summary expansion as a separate recovery or audit layer
|
|
1366
|
+
2. formally unify summary expansion with the existing hop-expansion math
|
|
1367
|
+
|
|
1368
|
+
What this document should avoid is an in-between state where recoverability
|
|
1369
|
+
logic behaves like a second retrieval theorem without being derived as one.
|
|
1370
|
+
|
|
1371
|
+
### 8.5 Preserved Research Ideas
|
|
1372
|
+
|
|
1373
|
+
The review process also surfaced several strong theoretical ideas that are worth
|
|
1374
|
+
retaining for future work:
|
|
1375
|
+
|
|
1376
|
+
- rate-distortion views of compaction quality
|
|
1377
|
+
- information-adaptive clustering instead of equal-size chronological buckets
|
|
1378
|
+
- hot-spot preservation tiers driven by access concentration
|
|
1379
|
+
- causal-centrality-aware compaction penalties or vetoes
|
|
1380
|
+
- entropy-based tail selection
|
|
1381
|
+
- retrieval-failure-triggered raw-history recovery (the specific observable
|
|
1382
|
+
signals S1/S2/S3 are defined in the vNext spec slice; this entry refers to the
|
|
1383
|
+
general concept, not the current implementation)
|
|
1384
|
+
- closed-loop compaction tuning driven by observed retrieval quality
|
|
1385
|
+
|
|
1386
|
+
These ideas are intentionally preserved as future mathematics rather than
|
|
1387
|
+
current contract. The present document remains normative only for the formulas
|
|
1388
|
+
and invariants already defined above.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Uninstall Guide
|
|
2
|
+
|
|
3
|
+
This guide covers safe removal of the OpenClaw / OpenClaw.ai plugin and the
|
|
4
|
+
separately managed `libravdbd` daemon.
|
|
5
|
+
|
|
6
|
+
If you only want to disable the memory replacement temporarily, remove the
|
|
7
|
+
plugin slot assignment first and leave the daemon plus data in place.
|
|
8
|
+
|
|
9
|
+
## 1. Disable the Plugin
|
|
10
|
+
|
|
11
|
+
Remove the plugin from the active OpenClaw slot in `~/.openclaw/openclaw.json`:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"plugins": {
|
|
16
|
+
"slots": {}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Treat that JSON as a minimal example only. If you assigned `libravdb-memory`
|
|
22
|
+
under both `memory` and `contextEngine`, remove those two slot entries and
|
|
23
|
+
leave any other plugin slots intact.
|
|
24
|
+
|
|
25
|
+
If you installed the package through the OpenClaw.ai plugin UI, remove or
|
|
26
|
+
disable the same package there as well. If you use the CLI, remove it through
|
|
27
|
+
your standard OpenClaw plugin removal flow for
|
|
28
|
+
`@xdarkicex/openclaw-memory-libravdb`.
|
|
29
|
+
|
|
30
|
+
## 2. Stop the Daemon
|
|
31
|
+
|
|
32
|
+
Stop the sidecar before deleting binaries or stored data.
|
|
33
|
+
|
|
34
|
+
Homebrew:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
brew services stop libravdbd
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Linux user service:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
systemctl --user disable --now libravdbd.service
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
macOS LaunchAgent:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
launchctl bootout gui/$(id -u)/com.xdarkicex.libravdbd
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Foreground manual run:
|
|
53
|
+
|
|
54
|
+
- stop the `libravdbd serve` process in the terminal where it is running
|
|
55
|
+
|
|
56
|
+
## 3. Remove Installed Assets
|
|
57
|
+
|
|
58
|
+
### Plugin Package
|
|
59
|
+
|
|
60
|
+
Remove the published plugin package from OpenClaw or OpenClaw.ai after it is no
|
|
61
|
+
longer assigned to an active slot.
|
|
62
|
+
|
|
63
|
+
### Homebrew Daemon
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
brew uninstall libravdbd
|
|
67
|
+
brew untap xDarkicex/openclaw-libravdb-memory
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Manual Daemon Install
|
|
71
|
+
|
|
72
|
+
Delete the service file or launch agent you installed, along with the daemon
|
|
73
|
+
binary you copied into place.
|
|
74
|
+
|
|
75
|
+
Common locations:
|
|
76
|
+
|
|
77
|
+
- `~/.config/systemd/user/libravdbd.service`
|
|
78
|
+
- `~/Library/LaunchAgents/com.xdarkicex.libravdbd.plist`
|
|
79
|
+
- `~/.local/bin/libravdbd`
|
|
80
|
+
|
|
81
|
+
## 4. Optional Full Data Cleanup
|
|
82
|
+
|
|
83
|
+
Only do this if you want to permanently remove stored LibraVDB memory.
|
|
84
|
+
|
|
85
|
+
Common local state:
|
|
86
|
+
|
|
87
|
+
- socket directory: `~/.clawdb/run/`
|
|
88
|
+
- database file: `~/.clawdb/data.libravdb`
|
|
89
|
+
|
|
90
|
+
If you configured a custom Unix socket endpoint in `sidecarPath`, remove that
|
|
91
|
+
socket path or containing directory if applicable. If you configured `dbPath`,
|
|
92
|
+
remove that custom database location instead of the default path. TCP
|
|
93
|
+
`sidecarPath` endpoints are not filesystem paths and do not have anything to
|
|
94
|
+
delete during uninstall.
|
|
95
|
+
|
|
96
|
+
## 5. Post-Uninstall Check
|
|
97
|
+
|
|
98
|
+
After cleanup, `openclaw memory status` should no longer show this plugin as the
|
|
99
|
+
active memory provider, and the daemon endpoint should no longer be reachable
|
|
100
|
+
unless you intentionally kept it running for another workflow.
|
package/openclaw.plugin.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"properties": {
|
|
11
11
|
"dbPath": { "type": "string" },
|
|
12
12
|
"sidecarPath": { "type": "string" },
|
|
13
|
+
"useSessionSummarySearchExperiment": { "type": "boolean" },
|
|
13
14
|
"embeddingRuntimePath": { "type": "string" },
|
|
14
15
|
"embeddingBackend": { "type": "string", "enum": ["bundled", "onnx-local", "custom-local"] },
|
|
15
16
|
"embeddingProfile": {
|
|
@@ -64,6 +65,10 @@
|
|
|
64
65
|
"type": "number",
|
|
65
66
|
"default": 10
|
|
66
67
|
},
|
|
68
|
+
"lifecycleJournalMaxEntries": {
|
|
69
|
+
"type": "number",
|
|
70
|
+
"default": 500
|
|
71
|
+
},
|
|
67
72
|
"compactionQualityWeight": {
|
|
68
73
|
"type": "number",
|
|
69
74
|
"default": 0.5,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xdarkicex/openclaw-memory-libravdb",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
"check": "./.ts-toolchain/node_modules/.bin/tsc --noEmit && pnpm run test:ts",
|
|
28
28
|
"test:ts": "./.ts-toolchain/node_modules/.bin/tsc -p tsconfig.tests.json && node --test .ts-build/test/unit/*.test.js",
|
|
29
29
|
"test:integration": "./.ts-toolchain/node_modules/.bin/tsc -p tsconfig.tests.json && node --test .ts-build/test/integration/checklist-validation.test.js .ts-build/test/integration/host-flow.test.js .ts-build/test/integration/sidecar-lifecycle.test.js",
|
|
30
|
+
"benchmark:session_search_mid": "./.ts-toolchain/node_modules/.bin/tsc -p tsconfig.tests.json && OPENCLAW_PROFILE_ASSEMBLE=1 node --test --test-name-pattern=\"real sidecar mid-sized session search benchmark\" .ts-build/test/integration/host-flow.test.js",
|
|
31
|
+
"gate:assemble_optimization": "./.ts-toolchain/node_modules/.bin/tsc -p tsconfig.tests.json && OPENCLAW_PROFILE_ASSEMBLE=1 OPENCLAW_ENFORCE_ASSEMBLE_EVIDENCE_GATE=1 node --test --test-name-pattern=\"real sidecar mid-sized session search benchmark\" .ts-build/test/integration/host-flow.test.js",
|
|
32
|
+
"probe:session_recall": "./.ts-toolchain/node_modules/.bin/tsc -p tsconfig.tests.json && OPENCLAW_PROFILE_ASSEMBLE=1 node --test --test-name-pattern=\"real sidecar mid-sized session search benchmark\" .ts-build/test/integration/host-flow.test.js",
|
|
33
|
+
"probe:session_recall_threshold": "./.ts-toolchain/node_modules/.bin/tsc -p tsconfig.tests.json && OPENCLAW_PROFILE_ASSEMBLE=1 node --test --test-name-pattern=\"real sidecar session_recall index threshold probe\" .ts-build/test/integration/host-flow.test.js",
|
|
30
34
|
"build:daemon": "bash scripts/build-daemon.sh"
|
|
31
35
|
},
|
|
32
36
|
"dependencies": {
|
package/packaging/README.md
CHANGED
|
@@ -11,16 +11,51 @@ The templates assume the default daemon endpoint contract used by the plugin:
|
|
|
11
11
|
- macOS/Linux: `unix:$HOME/.clawdb/run/libravdb.sock`
|
|
12
12
|
- Windows: `tcp:127.0.0.1:37421`
|
|
13
13
|
|
|
14
|
+
## LaunchAgent plist
|
|
15
|
+
|
|
14
16
|
Before loading the macOS plist, replace:
|
|
15
17
|
|
|
16
18
|
- `__LIBRAVDBD_PATH__` with the absolute path to the `libravdbd` binary
|
|
17
19
|
- `__HOME__` with the current user's home directory
|
|
20
|
+
- `__ONNX_RUNTIME_LIB__` with the absolute path to the ONNX runtime shared library (e.g. `/path/to/onnxruntime/onnxruntime-osx-arm64-1.23.0/lib/libonnxruntime.dylib`)
|
|
21
|
+
|
|
22
|
+
## Provisioning models and runtime
|
|
23
|
+
|
|
24
|
+
**Primary install path:** The Homebrew formula (`brew install libravdbd`)
|
|
25
|
+
provisions all required assets — ONNX Runtime, nomic-embed-text-v1.5,
|
|
26
|
+
all-minilm-l6-v2, and t5-small — inline during `brew install`. No
|
|
27
|
+
additional steps are needed for a clean install.
|
|
28
|
+
|
|
29
|
+
**Repair / recovery:** If assets are deleted or corrupted after install,
|
|
30
|
+
`scripts/provision.sh` can rebuild them. This is an operator tool, not
|
|
31
|
+
the normal install path.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
bash scripts/provision.sh # provisions into .daemon-bin/
|
|
35
|
+
bash scripts/provision.sh --target /opt/libravdbd/assets # custom target
|
|
36
|
+
bash scripts/provision.sh --skip-summarizer # skip optional t5-small model
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The script downloads models from HuggingFace and the ONNX runtime from
|
|
40
|
+
GitHub Releases, verifies SHA-256 checksums, and writes the `embedding.json`
|
|
41
|
+
manifests that `libravdbd` needs at startup. It is idempotent — existing
|
|
42
|
+
verified assets are left in place.
|
|
43
|
+
|
|
44
|
+
The npm package does not include `provision.sh` or any install-time
|
|
45
|
+
provisioning hooks. The `scripts/` directory is excluded from the
|
|
46
|
+
published npm tarball via the `files` whitelist in `package.json`.
|
|
47
|
+
|
|
48
|
+
## Homebrew formula
|
|
18
49
|
|
|
19
50
|
The release workflow now generates `dist/libravdbd.rb` from this template using
|
|
20
51
|
the release version and SHA-256 files. If `HOMEBREW_TAP_REPO` and
|
|
21
52
|
`HOMEBREW_TAP_TOKEN` are configured in GitHub Actions, the workflow also updates
|
|
22
53
|
the tap automatically.
|
|
23
54
|
|
|
55
|
+
The Homebrew formula stages the bundled ONNX Runtime archive, the shipped
|
|
56
|
+
embedding profile assets, and the T5 summarizer bundle into the install prefix
|
|
57
|
+
so the daemon can boot without an extra asset-unpack step.
|
|
58
|
+
|
|
24
59
|
Expected GitHub configuration:
|
|
25
60
|
|
|
26
61
|
- repository variable `HOMEBREW_TAP_REPO`, for example `xDarkicex/homebrew-openclaw-libravdb-memory`
|
|
@@ -33,3 +68,4 @@ Template placeholders:
|
|
|
33
68
|
- `__SHA256_DARWIN_AMD64__`
|
|
34
69
|
- `__SHA256_LINUX_ARM64__`
|
|
35
70
|
- `__SHA256_LINUX_AMD64__`
|
|
71
|
+
- `__SHA256_PROVISION__`
|