@xdarkicex/openclaw-memory-libravdb 1.3.17 → 1.3.18

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
@@ -185,6 +185,59 @@ The formal math lives in:
185
185
  - [docs/ast-v2.md](./docs/ast-v2.md)
186
186
  - [docs/elevated-guidance.md](./docs/elevated-guidance.md)
187
187
 
188
+ ## LongMemEval Harness
189
+
190
+ For internal tuning, the repo includes a local LongMemEval harness that runs the
191
+ dataset through the plugin layer and measures whether the assembled prompt still
192
+ contains the evidence turns.
193
+
194
+ The benchmark runner is committed, but the dataset and generated reports are not.
195
+ Keep downloaded data and local outputs under `benchmarks/longmemeval/`, which is
196
+ ignored by default.
197
+
198
+ The harness writes JSONL incrementally, so partial results survive if a transient
199
+ daemon failure interrupts a long run.
200
+
201
+ The run summary now prints a compact table with total questions, processed rows,
202
+ skipped abstentions, errors, session hit rate, turn hit rate, and average prompt
203
+ size.
204
+
205
+ Run it with:
206
+
207
+ ```bash
208
+ LONGMEMEVAL_DATA_FILE=/path/to/longmemeval_oracle.json pnpm run benchmark:longmemeval
209
+ ```
210
+
211
+ If you already have a daemon running and do not want the benchmark to spawn
212
+ another one, set:
213
+
214
+ ```bash
215
+ LONGMEMEVAL_USE_EXISTING_DAEMON=1 LONGMEMEVAL_SIDECAR_PATH=unix:/path/to/libravdb.sock
216
+ ```
217
+
218
+ If the local test daemon drops mid-run, the benchmark will restart it and retry
219
+ the current instance once before recording an error result.
220
+
221
+ Optional outputs:
222
+
223
+ - `LONGMEMEVAL_LIMIT` to cap the number of questions
224
+ - `LONGMEMEVAL_TOPK` to change the search budget
225
+ - `LONGMEMEVAL_OUT_FILE` to write JSONL records for analysis
226
+
227
+ To score a hypothesis JSONL file with the official LongMemEval evaluator, point
228
+ the repo at a local checkout of the benchmark and run:
229
+
230
+ ```bash
231
+ LONGMEMEVAL_EVAL_REPO=/path/to/LongMemEval \
232
+ LONGMEMEVAL_HYPOTHESIS_FILE=/path/to/hypotheses.jsonl \
233
+ LONGMEMEVAL_DATA_FILE=/path/to/longmemeval_oracle.json \
234
+ OPENAI_API_KEY=... \
235
+ pnpm run benchmark:longmemeval:score
236
+ ```
237
+
238
+ That scorer wrapper shells out to the official Python evaluation script and then
239
+ prints the aggregate metrics from the generated log when available.
240
+
188
241
  ## Compaction Model
189
242
 
190
243
  This system does not treat long chats as append-only forever.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xdarkicex/openclaw-memory-libravdb",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -31,6 +31,9 @@
31
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
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
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",
34
+ "benchmark:longmemeval": "./.ts-toolchain/node_modules/.bin/tsc -p tsconfig.tests.json && node --test .ts-build/test/integration/longmemeval-benchmark.test.js",
35
+ "benchmark:longmemeval:score": "node scripts/longmemeval-score.mjs",
36
+ "benchmark:longmemeval:diagnose": "node scripts/longmemeval-diagnose.mjs",
34
37
  "build:daemon": "bash scripts/build-daemon.sh"
35
38
  },
36
39
  "dependencies": {
@@ -32,12 +32,12 @@ class Libravdbd < Formula
32
32
  if Hardware::CPU.arm?
33
33
  resource "onnxruntime" do
34
34
  url "https://github.com/microsoft/onnxruntime/releases/download/v1.23.0/onnxruntime-linux-aarch64-1.23.0.tgz"
35
- sha256 :no_check
35
+ sha256 :no_check # TODO: pin real checksum when Linux ARM64 CI is available
36
36
  end
37
37
  else
38
38
  resource "onnxruntime" do
39
39
  url "https://github.com/microsoft/onnxruntime/releases/download/v1.23.0/onnxruntime-linux-x64-1.23.0.tgz"
40
- sha256 :no_check
40
+ sha256 :no_check # TODO: pin real checksum when Linux AMD64 CI is available
41
41
  end
42
42
  end
43
43
  end
@@ -54,12 +54,12 @@ class Libravdbd < Formula
54
54
 
55
55
  resource "all-minilm-l6-v2-model" do
56
56
  url "https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/onnx/model.onnx"
57
- sha256 "759c3cd2b7fe7e93933ad23c4c9181b7396442a2ed746ec7c1d46192c469c46e"
57
+ sha256 "6fd5d72fe4589f189f8ebc006442dbb529bb7ce38f8082112682524616046452"
58
58
  end
59
59
 
60
60
  resource "all-minilm-l6-v2-tokenizer" do
61
61
  url "https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/tokenizer.json"
62
- sha256 "da0e79933b9ed51798a3ae27893d3c5fa4a201126cef75586296df9b4d2c62a0"
62
+ sha256 "be50c3628f2bf5bb5e3a7f17b1f74611b2561a3a27eeab05e5aa30f411572037"
63
63
  end
64
64
 
65
65
  resource "t5-small-encoder" do
@@ -88,7 +88,7 @@ class Libravdbd < Formula
88
88
  end
89
89
 
90
90
  resource "provision" do
91
- url "https://github.com/xDarkicex/openclaw-memory-libravdb/releases/download/v#{version}/provision.sh"
91
+ url "https://github.com/xDarkicex/openclaw-memory-libravdb/releases/download/v__VERSION__/provision.sh"
92
92
  sha256 "__SHA256_PROVISION__"
93
93
  end
94
94
 
@@ -107,7 +107,13 @@ class Libravdbd < Formula
107
107
  t5_dir.mkpath
108
108
 
109
109
  resource("onnxruntime").stage do
110
- cp_r Dir["onnxruntime-*"].first, runtime_dir
110
+ # Homebrew may auto-strip the top-level dir from the tgz
111
+ subdir = Dir["onnxruntime-*"].first
112
+ if subdir
113
+ cp_r "#{subdir}/.", runtime_dir
114
+ else
115
+ cp_r ".", runtime_dir
116
+ end
111
117
  end
112
118
 
113
119
  resource("nomic-embed-text-v1.5-model").stage do
@@ -143,12 +149,14 @@ class Libravdbd < Formula
143
149
  end
144
150
  write_summarizer_manifest(t5_dir, "t5-small")
145
151
 
146
- libexec.install resource("provision")
152
+ resource("provision").stage do
153
+ libexec.install "provision.sh"
154
+ end
147
155
  chmod 0755, libexec/"provision.sh"
148
156
  end
149
157
 
150
158
  def post_install
151
- (var/"clawdb/data").mkpath
159
+ (var/"clawdb").mkpath
152
160
  (var/"clawdb/run").mkpath
153
161
  end
154
162
 
@@ -160,7 +168,8 @@ class Libravdbd < Formula
160
168
 
161
169
  #{libexec}/provision.sh --target #{prefix}/models
162
170
 
163
- Data directory: #{var}/clawdb/data
171
+ Data directory: #{var}/clawdb
172
+ Database file: #{var}/clawdb/data.libravdb
164
173
  Socket directory: #{var}/clawdb/run
165
174
  EOS
166
175
  end
@@ -202,7 +211,8 @@ class Libravdbd < Formula
202
211
  service do
203
212
  run [opt_bin/"libravdbd", "serve"]
204
213
  environment_variables LIBRAVDB_RPC_ENDPOINT: "unix:#{var}/clawdb/run/libravdb.sock",
205
- LIBRAVDB_DB_PATH: "#{var}/clawdb/data",
214
+ LIBRAVDB_DB_PATH: "#{var}/clawdb/data.libravdb",
215
+ LIBRAVDB_ONNX_RUNTIME: "#{opt_prefix}/models/onnxruntime/lib/libonnxruntime.dylib",
206
216
  LIBRAVDB_SUMMARIZER_BACKEND: "bundled"
207
217
  keep_alive true
208
218
  working_dir var/"clawdb"