arXiv:2606.09900cs.CLcs.AI2026-06

用精简记忆提升大模型代理准确率,比全历史上下文还准。

Less Context, More Accuracy: A Bi-Temporal Memory Engine for LLM Agents Where a Lean Retrieved Context Beats the Full History

  • 构建双时间记忆模型,分快写和异步提取路径,高效生成事实图谱
  • 仅用9.6k token检索片段,准确率达83.6%,比全历史高10.4个百分点
  • 开源可复现评测框架,解决基准测试中的数据泄露与判断偏差问题

长时记忆是大模型代理的缺失环节:跨会话易遗忘,传统做法将完整历史重播至提示中,代价高、速度慢,且干扰项累积导致准确性下降。多数记忆系统在成本或延迟上表现良好,但在准确率上仍逊于全上下文基线,且评测结果因不一致、不可复现的评测环境而波动巨大。本文提出Engram,一个基于双时间数据模型的开源双进程记忆引擎。快速写入路径无损追加事件,不依赖大模型;异步路径提取原子三元组事实,构建双时间知识图谱,无需逐条调用大模型即可解决矛盾(仅作无效标记,不删除),保留每条事实的溯源与覆盖链。混合读取路径融合密集语义、词汇、图结构及新近/显著性信号,应用时间点筛选(“as-of”),组装紧凑且带溯源标签的上下文。在500题的LongMemEval_S全集上,经官方分类评分器评估,轻量配置(仅使用约9.6k token的检索片段,从不使用全历史)准确率达83.6%,相比全上下文基线(73.2%)提升10.4个百分点(McNemar p < 10^-6),token数减少约8倍(9.6k vs. 79k),且无任何错误。性能提升依赖混合读取路径:仅事实会损失召回,结合检索块则恢复细节。我们还提供内置官方评分器的中立评测工具包,包含全上下文基线,公开逐题日志,并披露截断、自研评分器、全历史泄露等测量缺陷对基准测试的隐性影响。所有数据均附可复现命令。

原文摘要 · Abstract (English)

Long-term memory is the missing layer for LLM agents: across sessions they forget, and the common workaround -- replaying the whole history into the prompt -- is expensive, slow, and, as distractors accumulate, less accurate. Most memory systems win on cost or latency but still lose to the full-context baseline on accuracy, and benchmark numbers are reported on inconsistent, non-reproducible harnesses, so one system appears at wildly different scores across sources. We present Engram, an open-source, dual-process memory engine on a bi-temporal data model. A fast write path appends lossless episodes with no LLM on the critical path; an asynchronous path extracts atomic (subject, predicate, object) facts, builds a bi-temporal knowledge graph, and resolves contradictions without an LLM call per fact -- invalidating, never deleting, so every fact keeps provenance and a supersession chain. A hybrid read path fuses dense, lexical, graph, and recency/salience signals, applies a point-in-time ("as-of") filter, and assembles a compact, provenance-tagged context. On the full 500-question LongMemEval_S, graded by the official category-specific judge, Engram's lean configuration -- answering from a ~9.6k-token retrieved slice, never the full history -- scores 83.6% vs. 73.2% for full-context (+10.4 points, McNemar p < 10^-6) at ~8x fewer tokens (9.6k vs. 79k), with 0/500 errored. The gain needs a hybrid read path: facts alone lose recall, while facts plus retrieved chunks recover detail. We also contribute a neutral, in-repo evaluation harness with the official judge baked in and the full-context baseline in every table, publish the raw per-question logs, and document the measurement-integrity pitfalls (truncation, home-grown judges, full-history leaks) that silently distort memory benchmarks. Every number ships with a command to reproduce it.

记忆机制大模型知识图谱可复现性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。