benchmarks: v3.3.0 reproduction results + Ollama rerank backend - #895
Merged
Conversation
The rerank pipeline was hardcoded to Anthropic's /v1/messages.
Add a backend flag so the same code path can be exercised with
any OpenAI-compatible endpoint — local Ollama, Ollama Cloud,
or any gateway that speaks /v1/chat/completions.
Enables independent verification of the "100% with Haiku rerank"
claim by running the full benchmark with a different LLM family
(e.g. minimax-m2.7:cloud) and zero Anthropic dependency.
Both longmemeval_bench.py and locomo_bench.py:
- llm_rerank*() gain backend= / base_url= kwargs
- CLI: --llm-backend {anthropic,ollama}, --llm-base-url
- API key required only when backend=anthropic (diary/palace modes still require it)
- Parse last integer in response (reasoning models emit multi-int output)
- Fallback to message.reasoning when content is empty
- Raise max_tokens to 1024 for reasoning models
Addresses #875: every internal BENCHMARKS.md claim reproduced on Linux x86_64 (v3.3.0 tag, deterministic ChromaDB embeddings, seed=42 for the LongMemEval dev/held-out split). Scorecard — all reproduce exactly: LongMemEval raw R@5 96.6% (500/500) ✅ hybrid_v4 held-out 450 R@5 98.4% (442/450) ✅ hybrid_v4 + minimax rerank R@5 99.2% (496/500) * hybrid_v4 + minimax rerank R@10 100.0% (500/500) * LoCoMo (session, top-10) raw 60.3% (1986q) ✅ hybrid v5 88.9% (1986q) ✅ ConvoMem all-categories (250 items) 92.9% ✅ MemBench all-categories (8500) 80.3% ✅ * The minimax-m2.7:cloud rerank run replicates the "100%" claim with a different LLM family (no Anthropic dependency). R@10 is a perfect reproduction; R@5 misses 4 questions that the published Haiku run caught — consistent with BENCHMARKS.md's own disclosure that hybrid_v4 includes three question-specific fixes developed by inspecting misses, i.e. teaching to the test. The committed 50/450 split is the deterministic (seed=42) split BENCHMARKS.md references but wasn't previously in the repo. Full result JSONLs include every question, every retrieved id, and every score — auditable end-to-end.
4 tasks
jphein
added a commit
to techempower-org/mempalace
that referenced
this pull request
Apr 18, 2026
Upstream v3.3.1 headline: multi-language entity detection (PT-BR, Russian, Italian, Hindi, Indonesian, Chinese), BCP-47 case-insensitive locale resolution, UTF-8 encoding fix for non-UTF-8 Windows locales, combining-mark word-boundary fix for Devanagari/Arabic/Hebrew/Thai scripts. Also absorbs PR MemPalace#966 (honor silent_save), MemPalace#863 (precompact blocking fix), MemPalace#895/MemPalace#897 (benchmarks + README rewrite), MemPalace#946 (UTF-8 Path.read_text), and more. Conflict resolutions: - mempalace/hooks_cli.py: kept fork-only _desktop_toast + _mempalace_python (hook wrappers depend on these), adopted upstream's _get_mine_dir helper + _mine_sync function + _maybe_auto_ingest(transcript_path) signature, kept fork's silent-save MempalaceConfig branch, kept _ingest_transcript call in hook_precompact before the new _mine_sync so the session JSONL still gets captured on precompact. - tests/test_hooks_cli.py: merged both import sets. Updated test_stop_hook_rejects_injected_stop_hook_active to accept either the silent-save systemMessage output or the legacy decision=block — the security property (don't treat injected stop_hook_active as truthy) holds for both modes. - tests/test_miner.py: merged both import sets (CHUNK_* constants + load_config). - tests/test_readme_claims.py: accepted upstream's shift from README parsing to website/reference/mcp-tools.md and modules.md — website docs are now the source of truth for the tool table. - mempalace/entity_detector.py: accepted upstream wholesale — replaces hardcoded English STOPWORDS with i18n-JSON-backed patterns and backward- compat module constants. - README.md: kept fork README, bumped version badge 3.3.0 → 3.3.1. Verification: 995 tests pass, stop hook fires end-to-end ("✦ 13 memories woven into the palace"), 10/10 fresh-process palace opens + queries OK. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Reproduces every headline claim in
benchmarks/BENCHMARKS.mdagainst the taggedv3.3.0release on a clean Linux x86_64 environment, and commits the per-question result JSONLs that the doc already references but were not previously in the repo. Also adds an--llm-backend ollamaflag so the rerank pipeline can be exercised with any OpenAI-compatible endpoint — important for #875, because it lets the "100% with Haiku rerank" claim be verified with a different LLM family and zero Anthropic dependency.Paired with #875's public-surface rewrite (separate PR).
Scorecard — every BENCHMARKS.md claim reproduces
Run on
v3.3.0, seeded ChromaDB embeddings,seed=42for the 50/450 LongMemEval split.All 10 per-category MemBench numbers and all 5 per-category ConvoMem numbers match to the decimal; the same for LoCoMo per-category and LongMemEval per-category breakdowns.
What the minimax rerank result tells us
The hybrid_v4 + rerank pipeline was run on the full 500 LongMemEval questions with
minimax-m2.7:cloudvia Ollama Cloud's OpenAI-compatible endpoint — no Anthropic anywhere in the pipeline. Result: R@5 99.2% (496/500), R@10 100.0% (500/500), per-category R@10 all 6 at 100%.Three things fall out of this:
hybrid_v4(quoted-phrase boost, person-name boost, nostalgia patterns) — whichbenchmarks/BENCHMARKS.mdhas itself called "teaching to the test" since February. The generalisable number when an LLM rerank is in the loop is the clean held-out 98.4% R@5 on 450 questions the pipeline was never tuned on.Commits
8df7b9b—benchmarks: add --llm-backend ollama for non-Anthropic rerank(both scripts, +169/−66). Adds--llm-backend {anthropic,ollama}and--llm-base-urltolongmemeval_bench.pyandlocomo_bench.py. Response parsing handles reasoning models (minimax emits its final digit inmessage.contentwhenmax_tokensis large enough, or inmessage.reasoningwhen it isn't — we parse the last integer in either field). API key required only for the Anthropic backend; diary/palace modes still need it.ca0682a—benchmarks: apply ruff-format to llm_rerank(trivial line wrap, 3 lines).61d02e1—benchmarks: add v3.3.0 reproduction results + 50/450 split. Adds 8 result JSONLs (one per headline figure, including the smoke test and the full 500 minimax rerank) and the committed seed-42 train/held-out split.Reproducing
Test plan
ruff check+ruff format --check(benchmarks/ is in ruff'sextend-exclude, but pre-commit hook ran clean on both commits).results_mempal_hybrid_v4_llmrerank_session_20260414_1654.jsonlis that smoke run).result_file_pathheader;running R@5per-batch lines match the final aggregate in each log.