Add Loom memory-service integration for LongMemEval#2
Open
zlareb1 wants to merge 5 commits into
Open
Conversation
Loom (https://github.com/ClickHouse/loom) is a ClickHouse-backed memory service. This adds loom/run_loom.py, which plugs Loom in at the INDEXING + RETRIEVAL stages (ingest each haystack session via memory.set_from_messages, retrieve via memory.search) and reuses the official reader prompt + the official src/evaluation/evaluate_qa.py judge. It writes a hypotheses JSONL to grade with the existing judge, and reports evidence-session recall@k. The official src/retrieval/run_retrieval.py targets in-process retrievers (BM25/Contriever/Stella/GTE) over a flat corpus and has no hook for an external memory service, which is why this adapter exists. Includes README + requirements; validated end-to-end against a live Loom server. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The dataset is category-ordered, so a bare --limit samples a single question type. --shuffle (deterministic via --seed, default 42) gives a mixed sample for quick partial runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nostics Applied before --shuffle/--limit so a single LongMemEval category can be run complete (e.g. all single-session-assistant) for non-noisy per-category recall. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The published memory benchmarks (mem0, Zep) each grade LongMemEval with their own semantic-equivalence judge, not the bare upstream anscheck. Comparing Loom's strict-judge number against their lenient-judge numbers is apples-to- oranges. Add a `fair` judge (default) whose every added rule is one the official prompt OR both competitor graders already apply (meaning-not-wording, superset-correct, more-precise-correct, temporal off-by-one), while excluding mem0-only catch-alls — so it sits in the field's strictness band: no benchmin, no benchmax. Report this single number, like competitors do; keep the upstream strict judge available via --judge-style official for reproducibility. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
evaluate_qa.py grades by semantic equivalence (paraphrase / superset / more- precise correct; temporal off-by-one tolerated), per question type. run_loom.py adds fact-level recall@k (is the gold answer string actually in a retrieved excerpt — the metric that tracks QA, unlike session recall), renders dated history + derived-fact blocks for the reader, and leaves the generative reranker off by default so the number reflects real retrieval latency. Co-Authored-By: Claude Opus 4.8 <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.
What
Adds
loom/so a Loom memory service can be benchmarked on LongMemEval.loom/run_loom.py)src/generation/run_generation.pyprompt (replicated)src/evaluation/evaluate_qa.py(run unchanged)run_loom.pyingests each question haystack into Loom (onememory.set_from_messagesper session, concurrent), retrieves viamemory.search, generates an answer with the official reader prompt, and writes a hypotheses JSONL to grade with the existing judge. It also reports evidence-session recall@k.The official
src/retrieval/run_retrieval.pytargets in-process retrievers (BM25/Contriever/Stella/GTE) over a flat corpus and has no hook for an external memory service, which is why this adapter exists (the same pattern other memory products use to plug into LongMemEval).Usage
Validation
Smoke-tested end-to-end against a live Loom server (ingest -> retrieve -> official reader -> official judge runs clean). Details in
loom/README.md.🤖 Generated with Claude Code