Skip to content

Fresh-install embedding fix + one-command LongMemEval reproduction harness#79

Merged
cdeust merged 2 commits into
mainfrom
docs/v4-banner-refresh
Jul 3, 2026
Merged

Fresh-install embedding fix + one-command LongMemEval reproduction harness#79
cdeust merged 2 commits into
mainfrom
docs/v4-banner-refresh

Conversation

@cdeust

@cdeust cdeust commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix a fresh-install bug that made the embedding model download unreachable: HF_HUB_OFFLINE=1 was set before importing sentence-transformers, and the unset-and-retry fallback was dead code because huggingface_hub freezes the env var into module constants at first import. New installs without a cached model failed with a misleading "couldn't connect to huggingface.co". Fixed with an explicit local_files_only=True first attempt (hermetic when cached, same privacy posture) and a plain online load on cache miss. Floors raised to sentence-transformers>=3.0.0 (kwarg introduced in v3.0.0, verified against tagged sources); psycopg-pool added to the benchmarks extra (pg_store.py imports ConnectionPool at module level).
  • make longmemeval: one-command reproduction of the full official 500-question benchmark — sha256-pinned dataset download from the authors' HF repo, ephemeral PostgreSQL+pgvector container isolated from any existing install, untouched production runner through the production PL/pgSQL recall path, table + repro manifest out, teardown. make longmemeval-smoke for a 10-question harness check.
  • benchmarks/README.md: requirements, measured wall-clock (39.6 min full run), and explicit metric scoping — session-level retrieval R@10/MRR vs the LongMemEval paper's best retrieval configuration (78.4%), not comparable to end-to-end QA-accuracy leaderboards.

Zetetic Checklist

  • No invented constants (zetetic-checker passed on both commits; dataset sha256 measured 2026-07-03, byte-identical to the file behind published results)
  • Sources cited for non-trivial claims (ST v3.0.0 kwarg introduction verified against tagged sources; wall-clock from benchmarks/results/a3_longmemeval_post_refactor.md)
  • Difficulty book: hardest cases addressed (checker clean)
  • Tests cover new behavior — 46 embedding-engine tests pass; the download-on-cache-miss branch requires an empty model cache so it is covered by a recorded clean-environment harness run instead of a unit test
  • Layer boundaries respected (fix confined to infrastructure; harness is tooling)

Review findings

No critical issues. Checked and resolved during review: container reuse under KEEP_DB=1 cannot contaminate results (BenchmarkDB.open() purges all benchmark rows before every run); the ephemeral container's hardcoded password guards a localhost-only throwaway DB with public benchmark data; the embedding change leaves the failure surface unchanged for genuine network errors.

Verification

Three independent reproductions on 2026-07-03: warm run, clean-environment run (fresh uv cache, fresh HF cache, no dataset, no Docker image — this run caught both fresh-install bugs), and a full 500-question harness run reproducing the published R@10 98.4% exactly (MRR 0.915; record committed at benchmarks/results/harness_repro/longmemeval_full_20260703.json).

🤖 Generated with Claude Code

https://claude.ai/code/session_01KVjk4LSGVEjuzCgLMBzvQ2

cdeust and others added 2 commits July 3, 2026 18:25
…hable

SentenceTransformer loading set HF_HUB_OFFLINE=1 before import, then
unset the env var and re-imported on cache miss — but huggingface_hub
freezes that env var into module constants at first import, so the
retry still ran offline and fresh installs failed with a misleading
"couldn't connect to huggingface.co" error. Load with an explicit
local_files_only=True first (hermetic when cached, same privacy
posture), fall back to a plain online load on cache miss. Reproduced
and verified in a clean-env harness run on 2026-07-03.

Requires sentence-transformers >= 3.0.0 (local_files_only kwarg absent
in v2.3.0, present in v3.0.0 — verified against tagged sources); floors
raised accordingly. Also add psycopg-pool to the benchmarks extra:
pg_store.py imports ConnectionPool at module level, so the extra could
not run the benchmarks it exists for.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KVjk4LSGVEjuzCgLMBzvQ2
make longmemeval runs the full official 500-question benchmark from a
clean machine: downloads the dataset from the authors' HF repository
(sha256-pinned, byte-identical to the file behind every published
result), provisions an ephemeral PostgreSQL + pgvector container
isolated from any existing install, runs the untouched production
runner through the production PL/pgSQL recall path, prints the metric
table, and tears down. make longmemeval-smoke gives a 10-question
harness check.

benchmarks/README.md documents requirements, measured wall-clock
(39.6 min full run, a3_longmemeval_post_refactor.md), and the metric
scope: session-level retrieval Recall@10/MRR versus the LongMemEval
paper's best retrieval configuration (78.4% R@10) — explicitly not
comparable to end-to-end QA-accuracy leaderboards.

Verified three ways on 2026-07-03: warm run, clean-environment run
(fresh uv cache, fresh HF cache, no dataset, no image), and a full
500-question run reproducing the published R@10 98.4% exactly
(MRR 0.915; record in benchmarks/results/harness_repro/).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KVjk4LSGVEjuzCgLMBzvQ2
@cdeust cdeust merged commit e0cd00d into main Jul 3, 2026
13 checks passed
@cdeust cdeust deleted the docs/v4-banner-refresh branch July 3, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant