Skip to content

SodaMem: Evidence-Grounded Temporal Graph Memory for LLM Agents

MemoryAgentTemporal Graph北京大学

Wan F, Wu C, Lyu N. SodaMem: Evidence-Grounded Temporal Graph Memory for LLM Agents. arXiv:2608.08055v1, 2026.

https://github.com/SodaMem/SodaMem


SodaMem:面向 LLM 智能体的证据支撑时序图记忆

Abstract

Large language model (LLM) agents that assist users over weeks of conversation must remember what is currently true, not merely what was once said. Flat RAG diaries and Markdown logs optimize needle retrieval but under-serve currency, provenance, and ordered temporal reasoning. We present SodaMem, an evidence-grounded temporal graph memory that (i) extracts typed FactEvents with mandatory provenance spans, (ii) persists mention time, occurrence time, and validity with SUPERSEDES / CONTRADICTS / UPDATES edges under hybrid lexical--dense indexing, and (iii) answers via a planner--reader loop that gathers citable evidence before composing a final response. On LongMemEval-S, our store-of-record configuration reaches 92.8% accuracy (464/500; best of N=3) at mean $0.00161/question ( 18.3k tokens; median $0.00111 / 14.6k) with deepseek-v4-flash. We compile public systems with estimable API cost into a cost table and cost--accuracy map; under these estimates SodaMem sits near the accuracy frontier at Flash-tier spend and strictly dominates several higher-cost, lower-accuracy points. Accuracy uses the same Flash model as reader and judge (self-grading); costs exclude ingest/judge and cross-system comparisons are compiled estimates rather than a single-harness bake-off.

在持续数周的对话中协助用户的大语言模型(LLM)智能体必须记住当前为真的信息,而不只是曾经说过的信息 扁平 RAG 日志和 Markdown 记录针对针式检索进行了优化,却未能充分支持当前性、出处追溯和有序时序推理。 我们提出 SodaMem,一种以证据为基础的时序图记忆:它 (i) 提取带有强制出处跨度的类型化 FactEvent,(ii) 在混合词法--稠密索引下,通过 SUPERSEDES / CONTRADICTS / UPDATES 边持久化提及时间、发生时间和有效期,(iii) 通过规划器--阅读器循环回答问题,在组织最终回答前先收集可引用证据。 LongMemEval-S 上,我们的记录系统配置使用 deepseek-v4-flash,达到 92.8% 的准确率(464/500N=3 次运行中的最佳结果),每个问题的平均成本为 $0.00161( 18.3k tokens;中位数为 $0.00111 / 14.6k)。 我们将 API 成本可估算的公开系统汇总为成本表和成本--准确率图;在这些估算下,SodaMem 以 Flash 级别的开销接近准确率前沿,并严格支配多个成本更高、准确率更低的点。 准确率使用同一个 Flash 模型作为阅读器和评判器(自评);成本不包括摄取和评判,不同系统之间的比较来自汇总估算,而非统一评测框架下的直接对比。

1. Introduction

LLM agents that accompany users across days and weeks are routinely given a “memory”: append-only chat logs, Markdown diaries, vector stores, summarization pipelines, or increasingly elaborate graph and hierarchy designs. Despite rapid growth of this literature, the research focus of long-horizon personal memory has consolidated around a small set of measurable pressures rather than a single architecture. Benchmarks such as LoCoMo and LongMemEval probe multi-session fact recall, knowledge updates, temporal reasoning, preference tracking, and abstention; complementary suites stress implicit state invalidation, memory-operation correctness, prospective triggering, MemBench-style axes, and agent--environment experience beyond chat. In short, the field is no longer asking only “can the model find a needle in the transcript?”; but “can the agent maintain a coherent, updatable model of the user (or environment) and use it under the right conditions?”

陪伴用户数天乃至数周的 LLM 智能体通常会获得一种“记忆”:仅追加的聊天日志、Markdown 日记、向量存储、摘要流水线,或日益复杂的图与层级结构设计。 尽管相关文献迅速增长,长程个人记忆的研究重点已经集中到少数可衡量的压力因素上,而非某一种架构。 LoCoMo 和 LongMemEval 等基准考察跨会话事实召回、知识更新、时序推理、偏好跟踪和弃答;其他互补基准则强调隐式状态失效、记忆操作正确性、前瞻触发、MemBench 式评估维度,以及对话之外的智能体--环境经验。 简而言之,该领域不再只问“模型能否从对话记录中大海捞针?”,而是进一步追问“智能体能否维护一个连贯、可更新的用户(或环境)模型,并在适当条件下使用它?”

Method focus and open problems. Systems work spans a familiar pipeline---land, structure, index, link, maintain, retrieve/answer---but everyday assistants still hit four failure modes. (P1) Currency / conflict: preferences reverse; append-only logs leave “which value is current?” to an LLM over unordered chunks, where deterministic freshness often beats free-form judgment. (P2) Temporal structure: ordering / “most recently” / relative-date questions break when relative phrases lack a comparable timeline. (P3) Provenance: citations to source turns are needed for trust; lossy summaries and opaque vector hits weaken audit. (P4) Association: multi-hop synthesis needs entity/claim links beyond cosine neighbors, while avoiding context collapse from episode-wrong but similar memories.

方法重点与开放问题。 系统工作覆盖一条熟悉的流水线,即接入、结构化、索引、链接、维护和检索/回答,但日常助手仍会遇到四类失败模式。 (P1) 当前性/冲突: 用户偏好会发生反转;仅追加日志把“哪个值是当前值?”留给 LLM 在无序片段上判断,而确定性的新鲜度规则往往优于自由形式判断。 (P2) 时序结构: 当相对时间表述缺少可比较的时间线时,排序、“最近一次”和相对日期问题就会失效。 (P3) 出处: 为了建立信任,回答需要引用源对话轮次;有损摘要和不透明的向量命中会削弱审计能力。 (P4) 关联: 多跳综合需要超越余弦近邻的实体/断言链接,同时还要避免相似但情景错误的记忆造成上下文坍缩

Overview of SodaMem
图1:SodaMem 概览。多会话对话被摄取为带有出处检查和可选时间线解析的类型化 FactEvent。时序图存储保存 FactEvent 节点(类型、谓词、时间、有效期)、类型化边(SUPERSEDES、CONTRADICTS、UPDATES、DERIVED_FROM / 语义与关系边)以及 BM25 / 稠密双索引。回答问题时,带连接密度融合的多通道检索为使用记忆工具的规划器提供信息;独立阅读器生成带引用的最终回答。

Our stance. For retrospective personal QA we treat memory as an evidence-grounded temporal knowledge graph: typed FactEvents with source spans, temporal axes (mention, occurrence, validity), and SUPERSEDES / CONTRADICTS / UPDATES edges; a planner--reader loop gathers evidence before prose. This complements RL controllers and prospective-memory suites: we prioritize a maintainable, citable state for LongMemEval-style questions, with timeline resolution for temporal misses.

我们的立场。 对于回顾式个人问答,我们把记忆视为一个以证据为基础的时序知识图谱:它包含带源跨度的类型化 FactEvent、时序轴(提及、发生、有效期)和 SUPERSEDES / CONTRADICTS / UPDATES 边;规划器--阅读器循环先收集证据,再组织文字回答。 这与强化学习控制器和前瞻记忆基准形成互补:对于 LongMemEval 式问题,我们优先构建可维护、可引用的状态,并通过时间线解析处理时序检索失败。

We instantiate the stance with SodaMem (Figure 1):

我们用 SodaMem 将这一立场具体化(图1):

  1. Ingest: LLM extraction of FactEvents with provenance hard constraints and modality/calendar post-processing; optional entity-subject prompts to reduce star-graph collapse.
  2. Store & maintain: SQLite facts plus hybrid BM25--dense indexes; supersession and contradiction edges; dream/maintenance; optional session-anchored timeline resolution for relative dates.
  3. Answer: hybrid recall, a multi-step planner over memory tools, and a separate reader that emits cited answers.
  1. 摄取: LLM 提取带有出处硬约束的 FactEvent,并执行模态/日历后处理;可选的实体--主语提示用于减少星形图坍缩。
  2. 存储与维护: SQLite 事实加混合 BM25--稠密索引;超越与矛盾边;梦境式整理/维护;针对相对日期的可选会话锚定时间线解析。
  3. 回答: 混合召回、使用记忆工具的多步规划器,以及输出带引用答案的独立阅读器。

How SodaMem addresses (P1)--(P4). Supersession and validity closing target (P1); timeline resolution and temporal fields on FactEvents target (P2); mandatory source spans and reader citations target (P3); typed predicates, entity roles, and graph edges target (P4), while the planner can expand sessions and inspect cards to reduce episode confusion relative to single-shot RAG.

SodaMem 如何应对 (P1)--(P4)。 超越关系和有效期闭合针对 (P1);时间线解析与 FactEvent 上的时序字段针对 (P2);强制源跨度和阅读器引用针对 (P3);类型化谓词、实体角色和图边针对 (P4);同时,规划器可以扩展会话并检查记忆卡片,相比单次 RAG 减少情景混淆。

Contributions.

贡献。

  • Problem framing. We synthesize agent-memory research foci and method axes, and isolate currency, temporal structure, provenance, and association as the failure modes that Markdown/flat RAG leave unresolved for long-horizon personal assistants.
  • System. We present SodaMem's ingest--store--planner--reader pipeline: FactEvent schema, hybrid retrieval, supersession semantics, and a proposed timeline-resolution layer aimed at temporal-reasoning errors.
  • Cost--accuracy evaluation. On LongMemEval-S we report a store-of-record 92.8% run at mean $0.00161/question ( 18.3k tokens; median $0.00111 / 14.6k), compile public baselines with estimable API cost into a cost table and cost--accuracy map, and analyze the dominated (higher-cost, lower-accuracy) region relative to SodaMem.
  • 问题框定。 我们综合智能体记忆的研究重点与方法维度,并将当前性、时序结构、出处和关联确定为 Markdown/扁平 RAG 尚未为长程个人助手解决的失败模式。
  • 系统。 我们提出 SodaMem 的摄取--存储--规划器--阅读器流水线:FactEvent 模式、混合检索、超越语义,以及一个旨在解决时序推理错误的时间线解析层。
  • 成本--准确率评估。LongMemEval-S 上,我们报告了记录系统配置的 92.8% 运行结果,平均成本为每个问题 $0.00161( 18.3k tokens;中位数为 $0.00111 / 14.6k);我们还把 API 成本可估算的公开基线汇总为成本表和成本--准确率图,并分析相对于 SodaMem 而言被支配的区域(成本更高、准确率更低)。

Benchmarks. LoCoMo and LongMemEval are the main yardsticks for retrospective personal-memory QA (multi-session recall, updates, temporal reasoning, preference, abstention). Broader suites probe implicit invalidation, memory-operation correctness, prospective triggering, and agent--environment experience. We evaluate on LongMemEval-S and treat the others as orthogonal pressures.

基准。 LoCoMo 和 LongMemEval 是回顾式个人记忆问答的主要衡量标准,涵盖跨会话召回、更新、时序推理、偏好和弃答。 更广泛的基准还考察隐式失效、记忆操作正确性、前瞻触发和智能体--环境经验。 我们在 LongMemEval-S 上进行评估,并将其他基准视为相互正交的压力因素。

External memory and structure. RAG and long-context readers serve static corpora; agent settings continually write user state. MemGPT-style paging, MemoryBank / hierarchical summarization, and Mem0-style extractive APIs establish the need for an external store. Hierarchical and note/graph designs move beyond flat chunks via compression, Zettelkasten links, or bi-temporal graphs with edge invalidation. SodaMem is closest to extraction-plus-temporal-graph lines, but requires provenance spans, mention/occurrence/validity axes, write-time supersession, and a cited planner--reader loop.

外部记忆与结构。 RAG 和长上下文阅读器服务于静态语料库;智能体场景则会持续写入用户状态。 MemGPT 式分页、MemoryBank / 层级摘要和 Mem0 式提取 API 确立了对外部存储的需求。 层级与笔记/图设计通过压缩、卡片盒式链接或带边失效的双时态图超越扁平片段。 SodaMem 最接近“提取加时序图”这一技术路线,但它要求出处跨度、提及/发生/有效期轴、写入时超越关系,以及带引用的规划器--阅读器循环。

Indexing, conflict, and controllers. SimpleMem stresses density gating and multi-view indexes; RaMem highlights context collapse; deterministic conflict work favors explicit version marks over free-form freshness judgment. Parallel lines learn memory-tool policies with RL or optimize multi-turn search. Markdown diaries remain a strong simplicity baseline---cheap but weak on currency, order, provenance, and association. SodaMem is an engineering-first temporal graph substrate for retrospective personal QA; learned controllers can later sit on the same FactEvent contract.

索引、冲突与控制器。 SimpleMem 强调密度门控和多视图索引;RaMem 突出上下文坍缩;确定性冲突研究更倾向于显式版本标记,而不是自由形式的新鲜度判断。 与此并行的研究路线使用强化学习学习记忆工具策略,或优化多轮搜索。 Markdown 日记仍是一个有力的简洁性基线:成本低,但在当前性、顺序、出处和关联方面较弱。 SodaMem 是一个面向工程实现的回顾式个人问答时序图底座;学习型控制器未来可以建立在同一个 FactEvent 契约之上。

3. Motivation and Preliminaries

3.1 Motivation

Currency and multi-signal recall. Consider “I love spicy food,” later “I am cutting down on spice,” then “What should I cook tonight?” A Markdown log keeps all three; a flat retriever may surface the first. A temporal graph should supersede (or validity-close) the old preference, answer from the latest state, and still cite the justifying turns---the pattern behind LongMemEval knowledge-update items. Even with correct facts stored, single-channel retrieval is brittle: embeddings can be episode-wrong, BM25 may miss paraphrase, and entity expansion can explode. We therefore use wide multi-signal recall (graph, BM25, dense) and rank by connection density across auditable links, not cosine alone.

当前性与多信号召回。 假设用户先说“我喜欢吃辣”,后来又说“我正在减少辣味摄入”,然后问“我今晚应该做什么菜?” Markdown 日志会保留这三条信息;扁平检索器却可能返回第一条。 时序图应当让新偏好超越旧偏好(或关闭旧偏好的有效期),根据最新状态作答,同时仍引用支撑结论的对话轮次;这正是 LongMemEval 知识更新题目的典型模式。 即使正确事实已经存储,单通道检索仍然脆弱:嵌入可能返回情景错误的结果,BM25 可能遗漏释义,实体扩展则可能失控膨胀。 因此,我们采用宽范围多信号召回(图、BM25、稠密检索),并依据可审计链接上的连接密度排序,而不是只依赖余弦相似度。

Soft time and design principles. Users often misremember windows (“two months ago” for a three-month-old fact); hard temporal filters then drop the right evidence. We store comparable temporal fields, parse query time into a soft window plus sort direction, and treat window match as a bonus in ranking confidence. Principles:

软时间与设计原则。 用户经常记错时间范围,例如把三个月前的事实说成“两个月前”;硬时序过滤器便会丢弃正确证据。 我们存储可比较的时序字段,把查询时间解析为软窗口和排序方向,并将窗口匹配视为排序置信度中的奖励项 原则如下:

  1. Evidence first: no durable claim without a source span.
  2. Explicit time: mention, occurrence, and validity; query window + sort direction.
  3. Writable currency: supersession/contradiction are first-class; invalid facts are excluded.
  4. Multi-signal wide recall with per-head expansion, then fusion.
  5. Connection-density ranking with soft time bonuses and near-duplicate merge.
  6. Toolful answering: planner--reader gather-then-read.
  1. 证据优先: 没有源跨度,就不形成持久断言。
  2. 显式时间: 保存提及、发生和有效期;查询 窗口 + 排序方向。
  3. 可写的当前性: 将超越/矛盾作为一等关系;排除无效事实。
  4. 多信号宽范围召回: 先按搜索头扩展,再进行融合。
  5. 连接密度排序: 使用软时间奖励和近重复项合并。
  6. 工具化回答: 规划器--阅读器先收集、后阅读。

3.2 Preliminaries

Definition (FactEvent). A FactEvent is f=(κ,π,m,τ,ρ,S,σ): kind κ, predicate π, modality m, temporal fields τ, entity roles ρ, source spans S (MessagePieces), and status σ (active / superseded / invalid).

定义(FactEvent)。 FactEvent 表示为 f=(κ,π,m,τ,ρ,S,σ):类型 κ、谓词 π、模态 m、时序字段 τ、实体角色 ρ、源跨度 S(MessagePiece),以及状态 σ(活动 / 已被超越 / 无效)。

Retrieval units are FactEvents, MessagePieces, or raw turns (stable IDs for fusion). Temporal axes: mention (session time ts), occurrence (occurred_start/end), and validity (valid_from/until), closed under supersession.

检索单元为 FactEvent、MessagePiece 或原始对话轮次,它们具有用于融合的稳定 ID。 时序轴包括:提及时间(会话时间 ts)、发生时间occurred_start/end)和有效期valid_from/until),有效期会在发生超越时闭合。

Definition (Evidence-grounded answer). Answer a is evidence-grounded if each material claim is supported by retrieved EM with non-empty provenance S(f) for fE, and citations name those records.

定义(以证据为基础的回答)。 如果回答 a 中的每个实质性断言都得到检索证据 EM 的支持,且对每个 fE 都有非空出处 S(f),引用也明确指向这些记录,那么该回答就是以证据为基础的。

Definition (Supersession). fnew supersedes fold on a competing subject--predicate slot (or matched update pattern); then σ(fold) becomes superseded and valid_until(fold) closes at the effective time of fnew.

定义(超越)。 在相互竞争的主语--谓词槽位(或匹配的更新模式)上,fnew 超越 fold;此时,σ(fold) 变为“已被超越”,且 valid_until(fold)fnew 的生效时间闭合。

Definition (Query temporal intent). A parser maps q to (W,δ): window W and sort δ{nearfar,farnear}. Absent cues, W= and δ=nearfar.

定义(查询时序意图)。 解析器将 q 映射为 (W,δ):窗口 W 和排序方向 δ{nearfar,farnear} 当不存在时间线索时,W=δ=nearfar

4. Proposed Method: SodaMem

SodaMem is a memory infrastructure for LLM agents comprising ingest, durable storage with hybrid multi-signal retrieval, optional maintenance (dream / timeline resolution), and a planner--reader answering loop (Figure 1). Relative to Markdown diaries and flat RAG, the design goal is a maintainable user knowledge state that remains citable---and a retrieval stack that ranks evidence by connection density across graph, lexical, and dense channels under soft temporal scoring.

SodaMem 是面向 LLM 智能体的记忆基础设施,由摄取、支持混合多信号检索的持久存储、可选维护(梦境式整理 / 时间线解析)和规划器--阅读器回答循环组成(图1)。 相较于 Markdown 日记和扁平 RAG,其设计目标是构建一个仍可引用的、可维护的用户知识状态,以及一个在软时序评分下,依据图、词法和稠密通道间的连接密度对证据排序的检索栈。

4.1 Problem Statement

Given a user u, multi-session dialogue history Hu={Hs}s=1S with session times {ts}, and question q, produce an evidence-grounded answer a maximizing judge agreement with gold a. We factor the system as

给定用户 u、带会话时间 {ts} 的多会话对话历史 Hu={Hs}s=1S 和问题 q,系统需要生成以证据为基础的回答 a,使评判器与标准答案 a 的一致性最大化。 我们将系统分解为

Mu=Ingest(Hu),E=Retrieve(q,Mu),a=Read(q,E).

SodaMem specifies Ingest, the schema of Mu, Retrieve (multi-signal recall + density fusion + optional planner tools), and Read.

SodaMem 具体定义了 IngestMu 的模式、Retrieve(多信号召回 + 密度融合 + 可选规划器工具)和 Read

4.2 Ingest: From Turns to FactEvents

Segmentation and extraction. For each session Hs with time ts, turns are segmented and passed to an extractor LLM that emits FactEvent candidates under a fixed schema: kind, predicates, modality, temporal expressions, entity roles, source_span_ids, and support_text. Candidates must name spans that literally occur in the source turn (MessagePieces).

分段与提取。 对每个时间为 ts 的会话 Hs,系统会将对话轮次分段并交给提取器 LLM;该模型按照固定模式输出 FactEvent 候选,包括类型、谓词、模态、时间表达式、实体角色、source_span_idssupport_text 候选项必须明确给出源对话轮次(MessagePiece)中实际出现的跨度。

Provenance hard constraint. Candidates whose spans do not land in the source turn are rejected. Raw turns keep stable rawTurn_ids so later BM25/embedding hits can carry full turn text for similarity, deduplication, and density accounting.

出处硬约束。 如果候选项的跨度未落在源对话轮次中,系统就会拒绝该候选项。 原始对话轮次保留稳定的 rawTurn_id,使后续 BM25/嵌入命中能够携带完整轮次文本,用于相似度计算、去重和密度统计。

Deterministic post-processing. Post-steps normalize modality, resolve absolute dates when stated, and attach ts as the mention-time anchor. Optional coarse and entity-subject prompts control granularity and reduce star-graph collapse onto entityuser.

确定性后处理。 后处理步骤会规范化模态,在明确给出绝对日期时解析日期,并将 ts 作为提及时间锚点。 可选的粗粒度实体--主语提示用于控制粒度,并减少图结构向 entityuser 坍缩成星形图的现象。

Algorithm 1: IngestSession(Hs, ts)

  1. CExtractLLM(Hs)
  2. F
  3. for each candidate cC do
  4. if SpansValid(c,Hs) then
  5. cNormalizeModalityAndDates(c,ts)
  6. FF{c}
  7. end if
  8. end for
  9. FTimelineResolve(F,ts) (optional)
  10. WriteFactsAndEdges(F)
  11. return F

4.3 Timeline Resolution Layer

Relative phrases at ingest are under-specified if left only as text. We optionally apply

如果摄取阶段的相对时间短语仅以文本形式保留,其含义是不充分确定的。 我们可以选择应用

τ^(f)=T(τraw(f),ts(f),context(f)),

producing comparable timestamps. Unresolvable cases are marked unresolved. At query time, a separate parser yields temporal intent (W,δ) used in soft temporal scoring below---aligned with bi-temporal / episodic concerns, but coupled to density fusion rather than hard episode filters alone.

从而生成可比较的时间戳。 无法解析的情况会被标记为 unresolved 查询阶段,另一个解析器会生成时序意图 (W,δ),用于下文的软时序评分;这一做法与双时态/情景记忆关注点一致,但它与密度融合结合,而不是只依赖硬情景过滤器。

4.4 Store: Hybrid Index and Graph Relations

Persistence. Facts persist in SQLite with dense vectors (MiniLM / GTE-class) and BM25 over fact text, spans, and raw turns. Cards expose predicate text, temporal fields, entity roles, status, and provenance.

持久化。 事实持久化到 SQLite 中,并配有稠密向量(MiniLM / GTE 类模型)以及覆盖事实文本、跨度和原始对话轮次的 BM25 索引。 记忆卡片公开谓词文本、时序字段、实体角色、状态和出处。

Edges. We maintain mention / DERIVED_FROM links to spans; SUPERSEDES / CONTRADICTS / UPDATES among facts; and graph expansion edges of two flavors used at retrieve time: semantic edges (content-driven neighbor links) and relation-type edges (typed predicates between entities). Product defaults write supersession; observe-only frozen stores are an experimental axis. Dreaming rebuilds dirty entity profiles.

边。 我们维护指向跨度的提及 / DERIVED_FROM 链接、事实之间的 SUPERSEDES / CONTRADICTS / UPDATES 关系,以及检索时使用的两类图扩展边:语义边(由内容驱动的邻居链接)和关系类型边(实体之间的类型化谓词)。 产品默认配置会写入超越关系;仅观察的冻结存储作为一个实验维度。 梦境式整理会重建有变动的实体画像。

4.5 Retrieve: Multi-Tunnel Recall and Connection-Density Fusion

Retrieval is the core of Retrieve(q,Mu) and follows the initial SodaMem design: wide multi-path recall, per-tunnel head expansion, validity gates, then fusion by connection density with soft time bonuses.

检索是 Retrieve(q,Mu) 的核心,并遵循 SodaMem 的初始设计:进行宽范围多路径召回、逐通道搜索头扩展和有效性门控,再依据连接密度融合,并加入软时间奖励。

Query analysis. Parse q into entity mentions, lexical keys, an embedding query, and temporal intent (W,δ). Vague cues (“recently”, “a few months ago”) are mapped to wide windows to prefer recall over precision; missing cues disable the time bonus rather than inventing a window.

查询分析。q 解析为实体提及、词法关键词、嵌入查询和时序意图 (W,δ) 模糊线索(“最近”“几个月前”)会映射到较宽的窗口,以优先保证召回率而非精确率;当缺少线索时,系统会禁用时间奖励,而不是虚构一个窗口。

Three tunnels (strong vs. weak).

三条通道(强与弱)。

  • Graph / entity tunnel (strong): hit entities or facts as search heads; expand along selected semantic or relation-type edges (1-hop or limited multi-hop). Each head expands independently, then applies validity, relevance, and soft time scoring; keep search_head_rerank_top_K.
  • BM25 tunnel (strong): lexical hits on facts, MessagePieces, or raw turns. Span hits attach neighboring spans and the parent rawTurn (full text as a field for similarity/dedup); raw-turn hits expand to temporally adjacent turns (±2) for local context.
  • Embedding tunnel (weak): dense neighbors with the same expansion patterns as BM25, but lower base weights because similarity may retrieve related-but-irrelevant episodes.
  • 图 / 实体通道(强): 把命中的实体或事实作为搜索头;沿选定的语义边或关系类型边扩展(单跳或受限多跳)。每个搜索头独立扩展,然后应用有效性、相关性和软时间评分;保留 search_head_rerank_top_K 个结果。
  • BM25 通道(强): 对事实、MessagePiece 或原始对话轮次进行词法命中。跨度命中会附加相邻跨度和父级 rawTurn(以完整文本作为相似度/去重字段);原始轮次命中会向时间上相邻的轮次扩展(±2),以获得局部上下文。
  • 嵌入通道(弱): 使用与 BM25 相同的扩展模式检索稠密近邻,但赋予更低的基础权重,因为相似度可能召回相关却无关紧要的情景。

Each tunnel uses at most H search heads (default H=10). Direct hits from strong tunnels receive higher base mass than weak-tunnel or derived (expanded) hits.

每条通道最多使用 H 个搜索头(默认 H=10)。 强通道的直接命中会获得比弱通道命中或派生(扩展)命中更高的基础质量。

Validity gate (hard). Exclude content whose status is invalid/superseded-as-inactive when inappropriate, or whose validity interval is incompatible with W when a window is stated and the fact's validity is known. This is the only hard temporal/status exclusion; occurrence-time mismatch alone does not drop a high-density candidate.

有效性门控(硬)。 排除状态不适用的无效内容或被超越且不再活动的内容;当查询给出了窗口、事实的有效期也已知时,还会排除有效区间与 W 不兼容的内容。 这是唯一的硬时序/状态排除规则;仅发生时间不匹配并不会丢弃高密度候选项。

Connection density and ranking confidence. Let each (tunnel, head, hit) award a mass w to an evidence ID i (fact / span / rawTurn). Defaults (tunable): strong direct 0.4, weak direct 0.2, strong derived 0.1, weak derived 0.05. Masses accumulate when multiple heads hit the same ID (by ID equality, or by embedding similarity θ, e.g. 0.8, for near-duplicate merge). Writing H(i) for the hits on i,

连接密度与排序置信度。 令每个(通道、搜索头、命中)为证据 ID i(事实 / 跨度 / 原始轮次)赋予质量 w 默认值(可调)为:强直接命中 0.4、弱直接命中 0.2、强派生命中 0.1、弱派生命中 0.05 当多个搜索头命中同一 ID 时,质量会累加;判定依据可以是 ID 相等,也可以是在合并近重复项时嵌入相似度 θ,例如 0.8 H(i) 表示对 i 的命中集合,则

density(i)=hH(i)wh,conf(i)=density(i)+β1[iW].

with time bonus β (default 0.3) awarded at most once per merged item if any constituent falls in W. Sort by conf (ties broken by δ). Time thus acts as a ranking feature rather than a hard filter, so user-misdated queries remain recoverable.

如果合并项中的任一组成部分落入 W,则每个合并项至多获得一次时间奖励 β(默认 0.3)。 系统按 conf 排序,并用 δ 打破平局。 因此,时间充当排序特征,而非硬过滤条件,使带有错误日期的用户查询仍有可能找到正确结果。

Fusion. Merge per-tunnel lists by ID/similarity, recompute conf, and emit a unique ranked pool (Recall@k cutoffs are experimental knobs).

融合。 按 ID/相似度合并各通道列表,重新计算 conf,并输出去重后的排序池;Recall@k 截断值是可调实验参数。

Algorithm 2: MultiTunnelRetrieve(q, Mu)

  1. (W,δ)ParseTemporal(q)
  2. pools
  3. for tunnel t{graph,BM25,embed} do
  4. headsTopHeads(t,q,Mu;H)
  5. for head hheads do
  6. LExpand(h,t); LValidityFilter(L,W)
  7. LRerankLocal(L,q,W,δ;top_K)
  8. poolspoolsAwardMass(L,t)
  9. end for
  10. end for
  11. EMergeByIdOrSim(pools;θ); score conf on E
  12. return top evidence by conf under δ

4.6 Answer: Planner--Reader Loop

Planner. An LLM may further call tools (search, inspect, session_expand, timeline, count, compute) under a step budget to grow the fused pool---implementing memory-in-the-loop when density ranking alone is insufficient (e.g., explicit enumeration).

规划器。 在步数预算内,LLM 可以进一步调用工具(searchinspectsession_expandtimelinecountcompute)来扩展融合池;当仅靠密度排序不足以完成任务时,例如需要显式枚举时,这便实现了记忆在环。

Reader. A separate prompt composes the user-facing answer from selected evidence IDs with mandatory citations. Separation keeps citation discipline out of the tool policy.

阅读器。 一个独立提示根据选定的证据 ID 组织面向用户的回答,并强制要求引用。 这种分离使引用规范不必混入工具策略。

Algorithm 3: Answer(q, Mu)

  1. EMultiTunnelRetrieve(q,Mu)
  2. open{q}
  3. for t=1 to Tmax do
  4. actPlanner(q,E,open)
  5. if act=stop then break
  6. EEExecTool(act,Mu)
  7. end for
  8. aReader(q,E)
  9. return a with citations into E

4.7 Implementation Notes

Frozen LongMemEval stores open read-only with fingerprint echo. Density weights (0.4,0.2,0.1,0.05), β, θ, H, and search_head_rerank_top_K are exposed for Recall@k sweeps.

冻结的 LongMemEval 存储以只读方式打开,并回显指纹。 密度权重 (0.4,0.2,0.1,0.05)βθHsearch_head_rerank_top_K 均可配置,用于 Recall@k 扫描实验。

5. Experiments

We evaluate SodaMem on LongMemEval-S (500 questions; 115k-token histories) via the accuracy--cost trade-off against publicly reported systems with estimable per-question API cost. We compile disclosed scores, models, and token/$ figures from primary sources (rather than re-running every baseline under one harness), convert them with 2026 list prices, and situate our store-of-record run in that landscape. Table 1 sorts methods by accuracy; Figure 2 plots the same points.

我们在 LongMemEval-S(500 个问题;约 115k-token 的历史)上,通过准确率--成本权衡,将 SodaMem 与那些每题 API 成本可估算的公开系统进行比较。 我们从一手来源汇总公开的分数、模型和 token/美元数据,而不是在同一个评测框架下重新运行所有基线;随后按照 2026 年的标价进行换算,并把我们的记录系统运行结果置于这一图景中。 表1按准确率对方法排序;图2绘制了相同的数据点。

表1:LongMemEval-S 上 API 成本可估算的方法,按准确率降序排列。Token 成本为每 10³ 个问题的美元成本,即每题成本的 1000 倍。SodaMem 按基线惯例报告平均成本;中位数为每 10³ 个问题 1.11 美元(约 14.6k tokens)。Est. 表示根据公开 token 用量估算;Meas. 表示作者报告或实测的美元成本。SodaMem 行以浅色突出显示。
MethodDateModelAcc.Cost / 10³ Q
agentmemory V42026-03Claude Opus 4.696.2%$60 (est.)
Mem0 (2026 research)2026-04Managed (GPT-4o est.)94.4%$22 (est.)
SodaMem (ours)2026-08deepseek-v4-flash92.8%$1.61 (meas.)
Cersei Full-context2026-04Gemini 2.5 Flash87.6%$33 (meas.)
Cersei Embed2026-04Gemini 2.5 Flash86.6%$1.84 (meas.)
Cersei Hybrid2026-04Gemini 2.5 Flash86.3%$10–$16 (meas.)
AgentOS2026-04GPT-4o85.6%$7.7 (meas.)
LC GPT-5-mini2026-03GPT-5-mini82.4%$29.3 (meas.)
EmergenceMem Simple Fast2025-06GPT-4o79.0%$46 (meas.)
MemOS (eval set)2025-07GPT-4o-mini77.8%$0.33 (est.)
TiMem2026-01GPT-4o-mini76.9%$0.31 (est.)
Memobase2025-07GPT-4o-mini72.4%$0.35 (est.)
MemOS (TiMem repro)2026-01GPT-4o-mini68.7%$0.28 (est.)
Mem0 (TiMem repro)2026-01GPT-4o-mini65.0%$0.37 (est.)
Zep (eval set)2025-07GPT-4o-mini63.8%$0.36 (est.)
Supermemory (eval set)2025-07GPT-4o-mini58.4%$0.18 (est.)
MemoryOS2026-01GPT-4o-mini58.0%$1.26 (est.)
A-MEM2026-01GPT-4o-mini55.4%$0.72 (est.)
Fact-Mem0 (read)2026-03GPT-5-mini49.0%$1.3 (meas.)
MemU2025-07GPT-4o-mini38.4%$0.20 (est.)
MemoryBank2026-01GPT-4o-mini21.0%$2.21 (est.)

500 个问题上的平均值(规划器 + 阅读器;不包括摄取/评判)。中位数:每 10³ 个问题 $1.11,约 14.6k tokens/问题,更能代表典型查询;长尾拉高了平均值。

LongMemEval-S accuracy versus estimated API cost
图2:LongMemEval-S 准确率与每题估算 API 成本(x 轴为对数刻度)。星形表示 SodaMem(平均成本 0.00161 美元;中位数 0.00111 美元 / 约 14.6k tokens)。蓝色虚线表示我们的平均成本和 92.8% 准确率;阴影象限中的方法均被 SodaMem 严格支配,即成本高于平均运行点且准确率更低。

5.1 Setup and Cost Protocol

SodaMem run. Entity-subject store-of-record (500 users, 235,840 facts). Planner, reader, and judge are deepseek-v4-flash with LongMemEval's official yes/no templates. Accuracy is 464/500 (92.8%; best of N=3; median 90.6%). End-to-end planner+reader usage_totals (excluding ingest and judge), priced at Flash list rates ($0.14 / $0.0028 / $0.28 per 1M for cache-miss / cache-hit input / output), yield a mean of 18,348 tokens/question and $0.00161/question ($1.61 per 103Q in Table 1). A long tail pulls the mean up: the median is 14,640 tokens and $0.00111/question ($1.11 per 103Q), 25% lower, so a typical question is cheaper than the mean bill suggests. The same Flash model grades the run (self-grading); absolute accuracy may shift under an independent GPT-4o judge, but released hypotheses support re-evaluation and cost is judge-independent.

SodaMem 运行。 使用实体--主语记录系统,其中包含 500 位用户和 235,840 条事实。 规划器、阅读器和评判器均为 deepseek-v4-flash,并使用 LongMemEval 的官方是/否模板。 准确率为 464/50092.8%N=3 次运行中的最佳结果;中位数为 90.6%)。 端到端规划器 + 阅读器的 usage_totals 不包括摄取和评判;按照 Flash 标价计费,即每 100 万 cache-miss 输入 / cache-hit 输入 / 输出 tokens 分别为 $0.14 / $0.0028 / $0.28,得到的平均用量为每题 18,348 tokens,成本为每题 $0.00161表1中每 103 个问题 $1.61)。 长尾拉高了平均值:中位数14,640 tokens 和每题 $0.00111(每 103 个问题 $1.11),低约 25%,因此典型问题的成本低于平均账单所显示的水平。 同一个 Flash 模型还负责评判此次运行(自评);在独立 GPT-4o 评判器下,绝对准确率可能变化,但公开的答案假设支持重新评估,而且成本与评判器无关。

Baseline cost estimation. Author-reported USD (or $/correct) is used when available (AgentOS, Cersei, Fact-Mem0 read, EmergenceMem Simple Fast via AgentOS). Otherwise we price disclosed tokens with the reported answering model: GPT-4o-mini $0.15/$0.60, GPT-4o $2.50/$10, Gemini 2.5 Flash $0.30/$2.50, Claude Opus 4.6 $5/$25, GPT-5-mini $0.25/$2 (per 1M tokens; 90%/10% in/out prior if undisclosed). TiMem Table 6 and MemOS_eval_result report recalled context length; we price that plus 200 output tokens as an answer-stage lower bound. Mem0's 2026 research mean tokens are priced as GPT-4o under the same prior. Unless marked measured, costs are estimates---order-of-magnitude comparisons, not milli-dollar rankings. Frozen store fingerprints and usage totals accompany the 92.8% artifact.

基线成本估算。 在可获得时,我们使用作者报告的美元成本(或每个正确答案的美元成本),包括 AgentOS、Cersei、Fact-Mem0 read,以及由 AgentOS 报告的 EmergenceMem Simple Fast。 否则,我们根据公开的 token 用量和所报告的回答模型计价:GPT-4o-mini 为 $0.15/$0.60,GPT-4o 为 $2.50/$10,Gemini 2.5 Flash 为 $0.30/$2.50,Claude Opus 4.6 为 $5/$25,GPT-5-mini 为 $0.25/$2(每 100 万 tokens;若未公开输入/输出比例,则采用 90%/10% 先验)。 TiMem 表 6 和 MemOS_eval_result 报告的是召回上下文长度;我们将其加上约 200 个输出 tokens 后计价,作为回答阶段成本的下界。 Mem0 2026 年研究中的平均 token 用量在同一先验下按 GPT-4o 计价。 除非标记为实测,否则成本都是估算值,适合数量级比较,而非毫美元级排序。 冻结存储的指纹和用量汇总会与 92.8% 的结果产物一同提供。

5.2 Result Analysis

Where SodaMem sits. At 92.8% and mean $0.00161/question ( 18.3k tokens), SodaMem occupies a high-accuracy, mid-low-cost point (Figure 2); the median ($0.00111; 14.6k) is more favorable for a typical query, so the plotted mean is a conservative reading of our own distribution. Two higher scores---agentmemory V4 at 96.2% and Mem0 2026 at 94.4%---sit roughly an order of magnitude to the right ($0.06 and $0.022 under our assumptions), reflecting Opus / GPT-4o-class generators rather than Flash. Unified GPT-4o-mini academic pipelines (TiMem, MemOS, Memobase, Zep) are cheaper on the answer-stage lower bound but land at 58--78%---well below our planner--reader loop.

SodaMem 所处的位置。 SodaMem 以 92.8% 的准确率和每题 $0.00161 的平均成本(约 18.3k tokens)处于高准确率、中低成本的位置(图2);中位数($0.00111;约 14.6k)对典型查询更有利,因此图中采用平均值是对我们自身分布的保守解读。 两个得分更高的系统,即准确率为 96.2% 的 agentmemory V4 和准确率为 94.4% 的 Mem0 2026,大约位于右侧一个数量级(按我们的假设分别为 $0.06 和 $0.022),这反映的是 Opus / GPT-4o 级生成器,而不是 Flash。 采用统一 GPT-4o-mini 的学术流水线(TiMem、MemOS、Memobase、Zep)在回答阶段成本下界上更便宜,但准确率约为 58--78%,明显低于我们的规划器--阅读器循环。

Dominated quadrant and reader tier. The shaded region (cost > mean $0.00161 and accuracy < 92.8%) contains Cersei Embed / Hybrid / Full-context, AgentOS, long-context GPT-5-mini, EmergenceMem Simple Fast, and MemoryBank under TiMem---strictly worse (cost, accuracy) pairs even against our mean. Under the median ($0.00111), MemoryOS and Fact-Mem0 read would enter as well. Public accuracy jumps often track reader upgrades (e.g., Mastra 84.23%94.87% from GPT-4o to GPT-5-mini); SodaMem's claim is near-frontier accuracy at Flash-tier spend, undercutting Opus/GPT-4o high-score systems by 10--40× in estimated $/question. Caveats: protocols and judges differ; recall-context pricing undercounts multi-call planners; ingest amortization varies. With those limits, Figure 2 still shows a competitive accuracy band outside the high-cost frontier cluster, and strict dominance of several published points.

被支配象限与阅读器层级。 阴影区域(成本 > 平均值 $0.00161 且准确率 < 92.8%)包含 Cersei Embed / Hybrid / Full-context、AgentOS、长上下文 GPT-5-mini、EmergenceMem Simple Fast,以及 TiMem 下的 MemoryBank;即使与我们的平均值相比,它们也是严格更差的(成本、准确率)组合。 若采用中位数($0.00111),MemoryOS 和 Fact-Mem0 read 也会进入该区域。 公开结果中的准确率跃升常常伴随阅读器升级,例如 Mastra 从 GPT-4o 换为 GPT-5-mini 后由 84.23%94.87%;SodaMem 的主张是以 Flash 级开销取得接近前沿的准确率,估算每题成本比 Opus/GPT-4o 高分系统低约 10--40× 需要注意:不同工作的协议和评判器并不相同;按召回上下文计价会低估多次调用规划器的成本;摄取成本的摊销方式也不同。 在这些限制下,图2仍显示出位于高成本前沿集群之外的有竞争力准确率区间,并表明 SodaMem 严格支配多个已发表的数据点。

Limitations. This preprint reports a single store-of-record configuration under Flash self-grading; we do not claim a unified re-run of all baselines. Cost figures for many peers are reconstructed from disclosed tokens or author USD and should be read as order-of-magnitude. Ingest-time spend and timeline-resolution ablations are left for follow-up.

局限。 本预印本只报告了 Flash 自评下的一种记录系统配置;我们并未声称在统一设置下重新运行了所有基线。 许多对比方法的成本数据根据公开 token 用量或作者报告的美元成本重建,应按数量级理解。 摄取阶段开销和时间线解析消融留待后续研究。

6. Conclusion

We presented SodaMem, an evidence-grounded temporal graph memory for LLM agents: typed FactEvents with provenance, temporal axes and supersession, hybrid retrieval, and a planner--reader answering loop. On LongMemEval-S, our store-of-record configuration reaches 92.8% accuracy at mean $0.00161 per question ( 18.3k tokens; median $0.00111 / 14.6k) with deepseek-v4-flash. Relative to public systems with estimable API cost, this point sits near the accuracy frontier while avoiding the Opus/GPT-4o high-spend cluster, and it strictly dominates several published (cost, accuracy) pairs. Remaining misses---especially temporal reasoning under self-grading---motivate session-anchored timeline resolution at ingest and independent re-judging of released answer hypotheses. We plan to release code, prompts, frozen store fingerprints, and the cost--accuracy compilation to support reproducible comparison.

我们提出了面向 LLM 智能体、以证据为基础的时序图记忆 SodaMem:它包含带出处的类型化 FactEvent、时序轴与超越关系、混合检索,以及规划器--阅读器回答循环。 在 LongMemEval-S 上,我们的记录系统配置使用 deepseek-v4-flash,以每题平均 $0.00161 的成本(约 18.3k tokens;中位数为 $0.00111 / 约 14.6k)取得 92.8% 的准确率。 相较于 API 成本可估算的公开系统,该点在避开 Opus/GPT-4o 高开销集群的同时接近准确率前沿,并严格支配多个已发表的(成本、准确率)组合。 剩余错误,尤其是自评条件下的时序推理错误,促使我们在摄取阶段采用会话锚定的时间线解析,并对公开的答案假设进行独立重新评判。 我们计划发布代码、提示、冻结存储指纹和成本--准确率汇总,以支持可复现比较。