Skip to content

中文版 / Chinese version

LongMemEval Benchmark ​

LongMemEval is a benchmark for long-term memory over multi-session chat histories. Each item provides chronologically ordered user–assistant sessions and a probing question whose answer is only recoverable by reasoning over the user-owned memory.

1. Data preparation ​

Question types include single-session (user / assistant / preference), multi-session reasoning, knowledge update, and temporal reasoning.

ReMe uses only the cleaned-S split, hosted on HuggingFace: agentscope-ai/ReMe_longmemeval_clean_s_v2. The download script fetches it via the hf-mirror.com mirror; to use a different mirror, modify BASE_URL in download.py.

bash
cd benchmark/longmemeval
python download.py            # saves dataset/longmemeval_s_reme_cleaned.json; skips if already present

Ground truth is embedded in the data file.

2. Use the LME plugin ​

2.1 Overview ​

The LME plugin loads the dataset with embedded ground truth, creates an isolated workspace per item, ingests sessions chronologically, and answers probing questions via agentic (ReAct) mode. Its LLM-as-judge answer_judge job gives binary (yes/no) judgments and reports per-type accuracy. If a custom application configuration enables auto_dream, it triggers when sessions cross the configured hour (default 23:00); the packaged preset leaves it disabled.

2.2 How to use ​

Installation and environment ​

Install ReMe and the LongMemEval plugin in editable mode from the repository root:

bash
python -m pip install -e ".[as]"
reme plugins install ./plugins/lme --editable
reme plugins install ./plugins/lme-judge --editable
reme plugins validate lme

The runner explicitly enables the installed lme plugin and combines its defaults with ReMe's built-in benchmark preset. Editable installation keeps changes under plugins/lme visible without reinstalling the plugin. Custom application config paths still work through reme.config and can use extends: benchmark. Model credentials use the environment variables declared by the shared benchmark configuration.

Key configuration — benchmark/longmemeval/config.yaml ​

KeyMeaning
dataset.pathDataset file to evaluate (e.g. longmemeval_s_reme_cleaned.json); ground truth is included.
dataset.start_index / num_itemsSlice of items to evaluate.
dataset.question_typesFilter by question type; empty = all.
dataset.workspace_rootPer-item workspace root (benchmark/longmemeval/workspaces/longmemeval-s).
evaluation.num_workers0 = auto (cpu-2), 1 = sequential, >1 = parallel.
evaluation.filter_future_sessionsOnly ingest sessions with timestamp ≤ question_date.
reme.configReMe config used (benchmark).
reme.dream_trigger_hour / dream_scan_days / dream_max_unitsDream triggering behavior.
output.dirResults directory (benchmark/longmemeval/results).

Run the benchmark ​

From the repository root:

bash
python benchmark/longmemeval/run.py
python benchmark/longmemeval/run.py --config benchmark/longmemeval/config.yaml
python benchmark/longmemeval/run.py -q                        # quiet: only eval-level logs
python benchmark/longmemeval/run.py --log-level WARNING       # reduce eval runner logs
python benchmark/longmemeval/run.py --reme-log-level WARNING  # reduce reme internal logs
python benchmark/longmemeval/run.py --eval_only               # reuse existing workspaces, query + judge only

2.3 Results ​

Results are JSON files written to output.dir as results_<timestamp>.json, with a per-type accuracy summary also printed to the console. Logging conventions are shared across benchmarks — see the top-level README.

Reference results

cleaned-s ​

Results

agentscope==2.0.4.post1, conda reme env, 32 workers, eval-only (reusing prebuilt memory) (2026-08-06, 500 items, total 10.0 min)

TypeAgenticinput tok/qoutput tok/qtotal tok/qtool calls/q
Overall0.89443.4K0.9K44.3K3.69
knowledge-update0.91031.6K0.6K32.2K2.90
multi-session0.84252.8K1.5K54.3K4.21
single-session-assistant1.00015.6K0.3K15.9K1.89
single-session-preference0.63336.8K0.8K37.6K3.60
single-session-user0.98627.4K0.4K27.8K2.60
temporal-reasoning0.90262.7K1.0K63.7K4.97

3. Optimize the plugin with HoMe ​

3.1 Overview ​

HoMe prepares an experiment workspace from the dataset and a Git revision, evaluates the baseline, and iteratively improves the LME plugin code. The optimizer returns a candidate commit_sha, which can then be evaluated independently on the configured evaluation set.

3.2 How to use ​

Experiment setup ​

Get the dataset above and follow the HoMe setup and run guide. config_home.yaml defaults to benchmark/longmemeval/workspaces/home-groups-1-5 with 250 cases from groups 1–5 for optimization. The training IDs and reviewed evidence annotations come from dev_meta commit b53048e44833937df80a52fccceea78d054790e8. The original split used seed 42 and stratified the dataset by question type.

config_home_eval.yaml defaults to benchmark/longmemeval/workspaces/home-test-held-out and excludes the source experiment's training IDs. With the default training split, this selects 250 cases from groups 6–10. To choose cases explicitly, set exclude_training_cases: false and replace all_cases: true with case_ids: [...].

Prepare the optimization workspace from the repository root:

bash
python benchmark/longmemeval/run_home.py

Run the experiment ​

Run local one-shot optimization:

bash
python benchmark/longmemeval/run_home.py --optimize

Set CANDIDATE_SHA to the optimizer's commit_sha or a unique hexadecimal prefix, then run local one-shot evaluation:

bash
python benchmark/longmemeval/run_home_eval.py --commit "$CANDIDATE_SHA"

See the HoMe evaluation guide for service-based evaluation.

3.3 Results ​

HoMe is optimized on 250 LongMemEval-S training cases. ReMe and HoMe are evaluated on the same 250 held-out cases. Token counts and LLM calls are per-query averages for the answering stage.

ReMe baseline ​

Question categoryScoreTotal tokensInput tokensOutput tokensLLM calls
Overall0.88843.9K43.2K0.8K4.7
Knowledge Update0.92129.0K28.5K0.6K3.8
Multi-session0.83654.5K53.2K1.3K5.2
Single-session Assistant1.00015.8K15.5K0.3K2.9
Single-session Preference0.66731.4K30.6K0.7K4.1
Single-session User0.97126.6K26.3K0.3K3.5
Temporal Reasoning0.88265.7K64.8K0.9K6.2

HoMe ​

Question categoryScoreTotal tokensInput tokensOutput tokensLLM calls
Overall0.91617.9K17.2K0.6K3.0
Knowledge Update0.9749.7K9.3K0.5K2.2
Multi-session0.80619.3K18.3K1.0K3.3
Single-session Assistant1.0009.8K9.5K0.3K2.2
Single-session Preference0.93311.8K11.0K0.9K2.7
Single-session User0.97111.2K11.0K0.2K2.3
Temporal Reasoning0.94029.2K28.5K0.7K4.0

Released under the Apache-2.0 License.