Skip to content

Add Loom memory-service integration for LongMemEval#2

Open
zlareb1 wants to merge 5 commits into
mainfrom
add-loom-integration
Open

Add Loom memory-service integration for LongMemEval#2
zlareb1 wants to merge 5 commits into
mainfrom
add-loom-integration

Conversation

@zlareb1

@zlareb1 zlareb1 commented Jun 5, 2026

Copy link
Copy Markdown
Member

What

Adds loom/ so a Loom memory service can be benchmarked on LongMemEval.

stage who does it
indexing + retrieval Loom (loom/run_loom.py)
reading official src/generation/run_generation.py prompt (replicated)
judging official src/evaluation/evaluate_qa.py (run unchanged)

run_loom.py ingests each question haystack into Loom (one memory.set_from_messages per session, concurrent), retrieves via memory.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.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 (the same pattern other memory products use to plug into LongMemEval).

Usage

python loom/run_loom.py --base-url http://127.0.0.1:7777 --out loom/loom_hyp.jsonl --limit 40
python src/evaluation/evaluate_qa.py gpt-4o loom/loom_hyp.jsonl data/longmemeval_s_cleaned.json

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

zlareb1 and others added 5 commits June 5, 2026 16:23
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>
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