* Add sandboxed Python execution and home AutoBash plugin * Harden read-only shell commands and filesystem sandboxes * Group file sandbox backends in one package * Fix macOS file sandbox isolation and runtime access * Refine file sandbox limits and executor checks * Harden AutoBash policy and macOS sandbox supervision * fix(home): require ReMe release with file sandbox * refactor(home): simplify sandbox calls and redundant tests * fix(execution): bound output and clean up cancelled sandbox startup * fix(tests): mock Seatbelt platform requirements on Linux * fix(home): block Git help helpers and harden sandbox cleanup * Fix sandbox runtime links and subprocess cleanup * ci: cover Home plugin tests * test: wait for pipeline descendants to exit after cancellation * fix: align Home dependencies and preserve cleanup cancellation Require ReMe 0.4.2.1 and verify isolated Home wheel installation in package CI. Share cancellation-safe cleanup with thread calls, retain AnyIO cancellation semantics, and record Bubblewrap mount targets during argument construction. * feat(home): prepare self-evolution workspaces and benchmark inputs * fix(home): load only selected cases for debug derivation * feat(home): evaluate candidates with benchmark judges and prepare workspace docs * refactor(home): organize workflows and unify debug evaluation mode * fix(home): align Docker runtime and preserve evaluation failures * refactor(home): align evaluation summaries with dev_meta * feat(home): migrate agent, sampling and evidence inspection tooling * feat(home): add case-study agent and query evidence tracing tools - Add home_case_study job with CaseStudyAgentWrapper and a read-only sandboxed investigation step for per-case diagnostic reports - Add home_trace_query_evidence job/step to locate a query's source evidence sessions, memory checkpoints and answer/score previews - Compact evaluation summaries: record per-query failure errors, round scores to four decimals, expose scoring_enabled and observed means - Slim run manifests: drop schema_version and trusted_judge fingerprint, exclude debug/sampling_policy options, keep construction_source only for query-only replay - Simplify history index internals and update guide docs and tests * feat(home): support multi-case case-study runs with dedicated LLM and Git sandbox - Allow home_case_study to investigate up to eight ordered cases per invocation with a shared focus, one isolated agent per case, while keeping the legacy single-case selector as a deprecated alias - Configure a dedicated home_case_study LLM component instead of the shared judge backend - Wrap ReMe's OS file sandbox with a Home-specific Git runtime grant (developer directory on macOS) and argv-based child environment - Tighten case-study prompts around evidence certainty, code-tool path scoping, citation form, and unresolved-cause reporting - Extend evidence tracing and expand case-study/sandbox tests and docs * feat(home): run case studies with bounded concurrency and fix sandbox test * feat(home): guard repeated evaluations and preserve retry selections * feat(home): migrate optimization workflows and evaluation budgets * feat(home): add candidate admission gate and construction-equivalence replay Add host-side candidate gate agent that reviews committed changes before sampling, and construction-equivalence agent that compares a candidate against its nearest reusable ancestor to select query-only replay with 60% probability when construction is unchanged. Wire both into plugin.yaml application defaults, update optimizer prompt to explain the new host behaviors, extend snapshot/evaluation components with reuse support, and add focused tests. * feat(home): add structured-report agent and gate/equivalence test coverage Add StructuredReportAgent wrapper selectable via the _structured_report_model option in BoundedAgentWrapper, plus its dedicated unit tests. Extend candidate gate, construction equivalence, evaluation history, sampling, and validation budget tests, and document the new behavior in the plugin README. * feat(home): add standalone benchmark test evaluation and fix compression recovery * fix(home): preserve top-level answer failure classification * refactor(home): rename max_validations to max_evaluations * refactor(home): extract shared review_report workflow helper and bump version to 0.4.2.2 * fix(home): load runner credentials and localize dataset evaluation * fix(benchmark): propagate Home sandbox memory limits * refactor(home): consolidate Git exports and candidate validation * fix(home): clarify branch and diff tool parameter contracts * feat(home): bound case-study reports and migrate draft tools * fix(home): align benchmark report limits with plugin defaults * Fix Home evaluation recovery and cancellation boundaries * fix(home): tolerate fenced optimizer results and finalize exhausted budgets * fix(benchmark): align Docker runtime with AgentScope 2.0.11 * fix(home): unify history writes and cancellation cleanup * refactor(home): reuse structured report parsing * ci: remove redundant Home compatibility install check * fix(home): preserve literal formatting in structured reports * fix(home): continue optimization after baseline question errors * fix(sandbox): require explicit file write grants * test(home): verify host network isolation with connection probes * fix(sandbox): write to the validated canonical target * refactor(home): simplify optimizer evidence validation * feat(home): add targeted evaluation and controlled memory replay Expose optional case/question targets with bounded sampling and ignored invalid IDs. Reuse reviewed memory per case, preserve paired replay without targets, and sample every direct child of init. Restore the persistent optimizer overview and document optional targeted checks. Add regression coverage for selection, partial reuse, provenance, and frozen retries. * feat(home): preserve evaluated commits and compare validation evidence Add compact paired score and token comparisons, protected evaluated branches, and unique commit-prefix selection. Reveal comparison guidance during final selection and update optimizer tools, documentation, and regression tests. * feat(home): expand debug cases and diversify smoke questions * feat(home): prioritize reusable memory in targeted evaluation * fix(ci): limit coverage collection to repository sources * chore(home): remove legacy Meta-ReMe references * fix(home): harden evaluation and bound targeted reuse Normalize benchmark inputs while preserving standalone judge contracts. Protect initial baselines and completed evaluations, and scope targeted memory reuse to the selected sample. Simplify HoMe usage and agent documentation. * docs(home): explain how to use custom datasets * fix(home): validate explicit replay artifacts before sampling * fix(home): validate replay inputs before selection * fix(home): pin candidate admission and compact replay metadata * fix(home): address evaluation and preparation review findings Select baseline retries by attempt order and keep archive preflight outside the workspace lock. Base candidate admission on usable budgeted ancestors and validate normalized dataset IDs before publishing preparation. * docs(home): consolidate benchmark experiment guides Document the shared HoMe workflow and keep dataset setup, splits, and results in the BEAM and LongMemEval guides. * fix(home): resolve release and evaluation review findings Validate artifact IDs against the published runtime contract, cover the minimum ReMe wheel and Docker backend in CI, and keep sampling budgets and observations consistent when evaluation results are archived or restored. * test(home): seed durable validation history in optimizer fixtures * fix(ci): align Home wheel smoke test with minimum ReMe release * fix(ci): resolve unreleased minimum runtime from built wheels * fix(home): enforce full init baselines and retain replay evidence * docs: reorganize bilingual BEAM and LME benchmark guides * fix(home): bind optimizer sampling to the evaluated checkout * Validate retained replay configuration and pin explicit snapshots * docs(home): clarify final replay validation requirements --------- Co-authored-by: jinli.yl <jinli.yl@alibaba-inc.com>
7.4 KiB
LongMemEval 评测
LongMemEval 是一个面向多轮多会话历史的长期记忆能力的评测基准。每个条目提供一组按时间顺序排列的用户与助手之间的会话,以及一个只能通过推理用户自有记忆才能回答的探测问题。
1. 数据准备
题型包括单会话(user / assistant / preference)、多会话推理、知识更新与时间推理等。
ReMe 仅使用 cleaned-S 版本,数据托管在 HuggingFace:
agentscope-ai/ReMe_longmemeval_clean_s_v2。
下载脚本经 hf-mirror.com 镜像源获取,如需更换源请修改 download.py 中的
BASE_URL。
cd benchmark/longmemeval
python download.py # 保存为 dataset/longmemeval_s_reme_cleaned.json,已存在则自动跳过
ground truth 已内嵌在数据文件中。
2. 使用 LME 插件
2.1 简介
LME 插件加载内嵌 ground truth 的数据集,为每个条目创建独立工作区并按时间顺序摄入会话,再以 agentic(ReAct)模式回答探测问题,通过 LLM-as-judge 的 answer_judge 任务做二元(yes/no)评判并输出各类型准确率。若自定义应用配置启用了 auto_dream,会在相邻会话跨越配置时刻(默认 23:00)时触发;插件预设保持关闭。
2.2 如何使用
安装与环境配置
在仓库根目录以 editable 模式安装 ReMe 和 LongMemEval 插件:
python -m pip install -e ".[as]"
reme plugins install ./plugins/lme --editable
reme plugins install ./plugins/lme-judge --editable
reme plugins validate lme
runner 显式启用已安装的 lme 插件,并将插件默认配置与 ReMe 内置的 benchmark 配置组合。
editable 安装会让 plugins/lme 下的源码修改直接生效,无需重复安装。
自定义完整应用配置路径可通过 reme.config 指定,并可使用 extends: benchmark。
模型凭据通过公共 benchmark 配置中声明的环境变量设置。
关键配置 — benchmark/longmemeval/config.yaml
| 配置项 | 含义 |
|---|---|
dataset.path |
待评测的数据集文件(如 longmemeval_s_reme_cleaned.json),已包含 ground truth。 |
dataset.start_index / num_items |
评测条目的切片范围。 |
dataset.question_types |
按问题类型过滤,空表示全部。 |
dataset.workspace_root |
条目工作区根目录(benchmark/longmemeval/workspaces/longmemeval-s)。 |
evaluation.num_workers |
0 = 自动(cpu-2),1 = 串行,>1 = 并行。 |
evaluation.filter_future_sessions |
仅摄入时间戳 ≤ question_date 的会话。 |
reme.config |
使用的 ReMe 配置(benchmark)。 |
reme.dream_trigger_hour / dream_scan_days / dream_max_units |
dream 触发行为。 |
output.dir |
结果目录(benchmark/longmemeval/results)。 |
运行评测
在仓库根目录执行:
python benchmark/longmemeval/run.py
python benchmark/longmemeval/run.py --config benchmark/longmemeval/config.yaml
python benchmark/longmemeval/run.py -q # 安静模式:仅评测级日志
python benchmark/longmemeval/run.py --log-level WARNING # 降低评测 runner 日志
python benchmark/longmemeval/run.py --reme-log-level WARNING # 降低 reme 内部日志
python benchmark/longmemeval/run.py --eval_only # 复用已有工作区,仅执行查询 + 评判
2.3 结果
结果以 JSON 文件写入 output.dir,文件名为 results_<timestamp>.json,
同时控制台会打印含各类型准确率的汇总。日志约定在各基准间通用,见
总说明。
参考结果
cleaned-s
结果
agentscope==2.0.4.post1, conda reme env, 32 workers, eval-only(复用预构建记忆) (2026-08-06,500 题,总计 10.0 min)
| 类型 | Agentic | input tok/q | output tok/q | total tok/q | tool calls/q |
|---|---|---|---|---|---|
| 总体 | 0.894 | 43.4K | 0.9K | 44.3K | 3.69 |
| knowledge-update | 0.910 | 31.6K | 0.6K | 32.2K | 2.90 |
| multi-session | 0.842 | 52.8K | 1.5K | 54.3K | 4.21 |
| single-session-assistant | 1.000 | 15.6K | 0.3K | 15.9K | 1.89 |
| single-session-preference | 0.633 | 36.8K | 0.8K | 37.6K | 3.60 |
| single-session-user | 0.986 | 27.4K | 0.4K | 27.8K | 2.60 |
| temporal-reasoning | 0.902 | 62.7K | 1.0K | 63.7K | 4.97 |
3. 使用 HoMe 优化插件
3.1 简介
HoMe 从数据集和指定的 Git 版本准备实验工作区,评测基线后迭代优化 LME 插件代码,并返回候选版本的 commit_sha;随后可用该版本在配置的评测集上进行独立评测。
3.2 如何使用
实验准备
按上文获取数据集,并参照 HoMe 运行指南 完成安装。
config_home.yaml 默认在 benchmark/longmemeval/workspaces/home-groups-1-5 使用
group_1–group_5 的 250 个 case 进行优化。训练 ID 和独立审阅的证据标注来自
dev_meta 提交 b53048e44833937df80a52fccceea78d054790e8。原始划分使用 seed 42,按问题类型分层抽样。
config_home_eval.yaml 默认使用 benchmark/longmemeval/workspaces/home-test-held-out,
排除来源实验实际使用的训练 ID。使用默认训练集时,评测 group_6–group_10 的 250 个 case。
若要显式选择 case,将 exclude_training_cases 设为 false,并把 all_cases: true 替换为 case_ids: [...]。
从仓库根目录准备优化工作区:
python benchmark/longmemeval/run_home.py
实验运行
运行本地一次性优化:
python benchmark/longmemeval/run_home.py --optimize
将 CANDIDATE_SHA 设为优化器返回的 commit_sha 或其唯一十六进制前缀,再运行本地一次性评测:
python benchmark/longmemeval/run_home_eval.py --commit "$CANDIDATE_SHA"
服务方式见 HoMe 评测指南。
3.3 结果
HoMe 在 LongMemEval-S 的 250 个训练 case 上优化。ReMe 基线和 HoMe 均在同一组 250 个留出 case 上评测。 Token 用量和 LLM 调用次数均为问答阶段的每题平均值。
ReMe 基线
| 题型 | 得分 | 总 Token | 输入 Token | 输出 Token | LLM 调用 |
|---|---|---|---|---|---|
| 总体 | 0.888 | 43.9K | 43.2K | 0.8K | 4.7 |
| Knowledge Update | 0.921 | 29.0K | 28.5K | 0.6K | 3.8 |
| Multi-session | 0.836 | 54.5K | 53.2K | 1.3K | 5.2 |
| Single-session Assistant | 1.000 | 15.8K | 15.5K | 0.3K | 2.9 |
| Single-session Preference | 0.667 | 31.4K | 30.6K | 0.7K | 4.1 |
| Single-session User | 0.971 | 26.6K | 26.3K | 0.3K | 3.5 |
| Temporal Reasoning | 0.882 | 65.7K | 64.8K | 0.9K | 6.2 |
HoMe
| 题型 | 得分 | 总 Token | 输入 Token | 输出 Token | LLM 调用 |
|---|---|---|---|---|---|
| 总体 | 0.916 | 17.9K | 17.2K | 0.6K | 3.0 |
| Knowledge Update | 0.974 | 9.7K | 9.3K | 0.5K | 2.2 |
| Multi-session | 0.806 | 19.3K | 18.3K | 1.0K | 3.3 |
| Single-session Assistant | 1.000 | 9.8K | 9.5K | 0.3K | 2.2 |
| Single-session Preference | 0.933 | 11.8K | 11.0K | 0.9K | 2.7 |
| Single-session User | 0.971 | 11.2K | 11.0K | 0.2K | 2.3 |
| Temporal Reasoning | 0.940 | 29.2K | 28.5K | 0.7K | 4.0 |