Repository navigation
feat: LongMemEval-S benchmark (R@5=98.00%) + chunk embedding fixes (v0.2.1) - #6
Merged
Merged
Conversation
Adds benchmark infrastructure and first published dev-split result for
memweave on LongMemEval (50 dev questions, all-MiniLM-L6-v2, raw vector
mode, seed=42 split shared with mempalace baseline).
- benchmarks/BENCHMARK_PLAN.md — milestone plan with integrity rules
- benchmarks/longmemeval_bench.py — per-question isolation, JSONL output,
Recall@K/NDCG@K metrics, raw/hybrid/
hybrid_mmr modes
- benchmarks/verify_milestone1.py — preflight checks (Ollama, dataset, split)
- benchmarks/results/results_mw_raw_dev_20260501_1727.jsonl
— dev result: R@5=0.9400, NDCG@5=0.8807
(mempalace raw baseline: 96.6% on 500 Qs)
…ving When a batch embedding call fails (e.g. one chunk exceeds the model's 256-token context limit), fall back to per-chunk embedding instead of dropping all chunks in the file. Oversized individual chunks are split at a word boundary near the midpoint, both halves are embedded, and the vectors are averaged + L2-normalised (_embed_with_halving). Also promotes _upsert_vec log level DEBUG → WARNING so sqlite-vec INSERT failures surface immediately.
LiteLLM's APIConnectionError misreports Ollama HTTP 400 errors as status_code=500 (retryable), causing 3 redundant retries (~5s) per oversized chunk. Parse the status from the exception message string first (httpx format: "Client error '4XX'") before falling back to the status_code attribute.
- lme_split_50_450.json: canonical fixed split (50 dev / 450 held-out)
- splits/lme_stratified_split_seed{42,0,1,2,3}.json: five stratified
50/450 splits with largest-remainder rounding to preserve question-type
proportions, used for the 5-seed cross-validated benchmark run
…98.00%, CV=97.24%±0.12%)
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6 +/- ##
==========================================
- Coverage 89.74% 88.70% -1.05%
==========================================
Files 26 26
Lines 1863 1894 +31
==========================================
+ Hits 1672 1680 +8
- Misses 191 214 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Core library fixes (v0.2.1)
Oversized chunk handling (
store.py): when a batch embedding call fails(e.g. a chunk exceeds the model's context limit), the pipeline now retries
each chunk individually. Chunks that are still too large are split
recursively at a word boundary near the midpoint — both halves are embedded
and their vectors are averaged + L2-normalised (
_embed_with_halving).Previously the entire file's batch was silently dropped.
HTTP 400 non-retryable fix (
embedding/provider.py): LiteLLM'sAPIConnectionErrormisreports Ollama HTTP 400 errors asstatus_code=500,causing 3 redundant retries (~5 s overhead) per oversized chunk. Now parses
the status from the exception message string first so 4xx errors are
immediately classified as non-retryable.
_upsert_veclog level (store.py): sqlite-vec INSERT failures promotedfrom
DEBUG→WARNINGso silent vector drops surface immediately.LongMemEval-S benchmark
Evaluates memweave on 500-question multi-session memory retrieval using the
ECR + IDF + CAATB post-processor pipeline. All runs are fully local —
all-MiniLM-L6-v2via Ollama, no LLM, no API key, no cloud.Results (held-out, 450 questions): R@5 = 98.00%, R@23 = 100%
Cross-validated (5 seeds): R@5 = 97.24% ± 0.12%
Adds:
benchmarks/strategies/— ECR, IDF, CAATB post-processorsbenchmarks/longmemeval_bench.py— fixed-split benchmark runner (with full docstrings)benchmarks/multiseed_sweep.py— 5-seed cross-validated runnerbenchmarks/data/— canonical split + 5 stratified CV seedsbenchmarks/final_results/— JSONL/JSON result artifacts