A reproducible harness for the LoCoMo long-term conversational-memory QA benchmark. It runs a frozen protocol — fixed answerer, fixed judge, fixed prompts — against a memory server exposed over a small REST contract, and ships the certified per-run results so the numbers can be recomputed.
Repository: https://github.com/Astrix-Labs/locomo-harness
LoCoMo is licensed CC BY-NC 4.0 (Creative Commons Attribution-NonCommercial 4.0 International) by Maharana et al. (SNAP Research). It is not redistributed in this repo. Fetch it from the official source before running:
python download_locomo.py # writes locomo10.json next to the scripts- Dataset / license: https://github.com/snap-research/locomo (LICENSE: https://raw.githubusercontent.com/snap-research/locomo/main/LICENSE.txt)
- Attribution: Maharana et al., LoCoMo, https://snap-research.github.io/locomo
- Use is non-commercial, with attribution, per the upstream license.
pip install -r requirements.txt
cp .env.example .env # then set OPENAI_API_KEYThe harness talks to a memory server over HTTP only (it imports nothing from any
server implementation). The server must expose three endpoints, keyed by an
X-User-Id header for per-conversation isolation:
| Method & path | Purpose |
|---|---|
POST /api/memories |
store one memory (content, created_at, …) |
POST /api/recall |
retrieve top-k memories for a query |
POST /api/admin/clear-user |
clear a user scope before ingest |
Default base URL is http://localhost:8000 (override with --api).
locomo_run.py is the canonical, self-contained pipeline. For each conversation
it clears the user scope, ingests that conversation's turns, recalls + answers
each question, then judges every answer at the end:
python locomo_run.py --samples all --k 90 --route on --ingest turn --query-expand onThe result JSON (metadata + per-question results) is written to
--output (default locomo_judged.json). run_variants.sh launches several
full runs and hands their outputs to variant_analysis.py.
- Answerer:
gpt-4o-mini,temperature=0. - Judge:
gpt-4o-mini,temperature=0, forced JSON output; the Mem0-eraACCURACY_PROMPTverbatim (including the temporal-leniency clause). A judge parse failure scores WRONG — never defaults toward CORRECT. - Questions:
n = 1540across categories 1–4 — Multi-hop (282), Temporal (321), Open-domain (96), Single-hop (841). Category 5 (adversarial) is excluded by default (known-broken ground truth). - The J-score is the fraction of answers the judge labels CORRECT.
Over the 10 certified k=90 runs in cert/:
mean J = 85.55, std = 0.37.
Each file holds the per-question records of one certified run: sample_id,
question_idx, category, predicted_answer, num_memories_retrieved,
prompt_used, verdict, is_correct, plus a run metadata block (models,
config, per-category and per-conversation J-scores). This is enough to recompute
every J-score.
The LoCoMo-derived text fields (question, gold_answer, evidence) and the
model's chain-of-thought (full_completion) are redacted in these files
under the dataset's CC BY-NC 4.0 license. To materialize full records, run the
harness yourself against the downloaded locomo10.json.
# recompute per-run / per-category J, frozen guardrails, and the retention
# ledger of your run(s) against the certified 10-run consensus:
python variant_analysis.py --runs locomo_judged.jsonpytest -qThe reranker parity tests self-skip when the (unshipped) probe modules are absent; the freeze guards pin the frozen prompt texts and the request path.
Harness code: MIT (see LICENSE). The LoCoMo dataset is CC BY-NC 4.0
and carries its own upstream license — it is downloaded, not redistributed here.