Hindsight is 20/20: Building Agent Memory that Retains, Recalls, and Reflects
MemoryAgentTemporal Graph18500+30+Vectorize.io华盛顿邮报弗吉尼亚理工大学Hindsight:构建能够保留、回忆与反思的智能体记忆
Abstract
Agent memory has been touted as a dimension of growth for LLM-based applications, enabling agents that can accumulate experience, adapt across sessions, and move beyond single-shot question answering. The current generation of agent memory systems treats memory as an external layer that extracts salient snippets from conversations, stores them in vector or graph-based stores, and retrieves top-
智能体记忆被视为基于 LLM 的应用的一个增长维度,使智能体能够积累经验、跨会话适应,并超越一次性问答。 当前一代智能体记忆系统把记忆视为一个外部层:从对话中抽取显著片段,将其存储在向量或图存储中,再把 top-
1. Introduction
AI agents are increasingly expected to behave less like stateless question answering systems and more like long-term partners: they are expected to remember past interactions, build up and track knowledge about the world, and maintain stable perspectives over time. However, the current generation of agent memory systems today are still built around short-context retrieval-augmented generation (RAG) pipelines and generic large language models (LLMs). Such designs treat memory as an external layer that extracts salient snippets from conversations, stores them in vector or graph-based stores, and retrieves top-k items into the prompt of an otherwise stateless model.
人们日益期望 AI 智能体不再像无状态问答系统,而更像长期伙伴:它们应当记住过去的交互,积累并追踪有关世界的知识,并随时间保持稳定的观点。 然而,当前一代智能体记忆系统仍然围绕短上下文检索增强生成(RAG)流水线和通用大语言模型(LLM)构建。 这类设计把记忆视为一个外部层:从对话中抽取显著片段,将其存储在向量或图存储中,再把 top-k 条目检索到原本无状态模型的提示中。
As a result, current approaches to modeling agent memory struggle with three recurring challenges. First, they are unable to preserve and granularly access long-term information across sessions. Second, AI agents are unable to epistemically distinguish what the agent has observed from what it believes. Finally, such agents are notorious for their inability to exhibit preference consistency, i.e., expressing a stable reasoning style and viewpoint across interactions rather than producing locally plausible but globally inconsistent responses.
因此,当前的智能体记忆建模方法反复面临三项挑战。 第一,它们无法跨会话保存并细粒度访问长期信息。 第二,AI 智能体无法在认识论层面区分自己观察到的内容与相信的内容。 最后,这类智能体因无法表现出偏好一致性而广受诟病,也就是说,它们不能跨交互表达稳定的推理风格和观点,而是生成局部看似合理、整体却不一致的响应。
Recent work has begun to address these challenges through dedicated memory architectures for agents. Systems like MemGPT introduce operating system-like memory management, while Zep proposes temporal knowledge graphs as an internal data structure. Other approaches focus on continual learning, reinforcement-based memory management, or production-ready memory systems. While these systems improve personalization and context carry-over, they still blur the line between evidence and inference, can struggle to selectively organize information over long horizons, and offer limited support for agents that must explain why they answered a question a certain way.
近期工作开始通过面向智能体的专用记忆架构来应对这些挑战。 MemGPT 等系统引入类似操作系统的记忆管理,而 Zep 则提出把时间知识图谱作为内部数据结构。 其他方法关注持续学习、基于强化学习的记忆管理或面向生产的记忆系统。 尽管这些系统改善了个性化和上下文延续,但它们仍然模糊证据与推断之间的界线,可能难以在长时间跨度上选择性组织信息,也只能有限地支持必须解释为何以特定方式回答问题的智能体。
We present Hindsight, a memory architecture for long-lived AI agents that addresses these challenges by unifying long-term factual recall with preference-conditioned reasoning. Each agent in Hindsight is backed by a structured memory bank that accumulates everything the agent has seen, done, and decided over time, and a reasoning layer that uses this memory to answer questions, execute workflows, form opinions, and update beliefs in a consistent way. Conceptually, Hindsight ties together two components: TEMPR (Temporal Entity Memory Priming Retrieval), which implements the retain and recall operations over long-term memory, and CARA (Coherent Adaptive Reasoning Agents), which implements the reflect operation over that memory. TEMPR builds a temporal, entity-aware memory graph and exposes an agent-optimized retrieval interface, while CARA integrates configurable disposition behavioral parameters into the reasoning process and maintains an explicit opinion network that evolves over time.
我们提出 Hindsight,这是一种面向长寿命 AI 智能体的记忆架构,通过统一长期事实回忆与偏好条件推理来应对这些挑战。 Hindsight 中的每个智能体都有一个结构化记忆库作为支撑,该记忆库随时间累积智能体见过、做过和决定过的一切;同时还有一个推理层,利用这些记忆回答问题、执行工作流、形成观点并以一致的方式更新信念。 从概念上看,Hindsight 联结了两个组件:TEMPR(Temporal Entity Memory Priming Retrieval,时间实体记忆启动检索),负责在长期记忆上实现保留和回忆操作;CARA(Coherent Adaptive Reasoning Agents,连贯自适应推理智能体),负责在该记忆上实现反思操作。 TEMPR 构建具备时间与实体感知能力的记忆图,并提供为智能体优化的检索接口;CARA 则把可配置的性情行为参数整合进推理过程,并维护一个随时间演化的显式观点网络。
At the core of Hindsight is a simple abstraction: a memory bank organized into four logical networks (world, experience, opinion, observation) and three core operations (retain, recall, and reflect, as mentioned earlier). The world and experience networks store objective facts about the external world and the agent's own experiences. The opinion network stores subjective beliefs with confidence scores that can be updated as new evidence arrives. The observation network stores preference-neutral summaries of entities synthesized from underlying facts. TEMPR implements retain and recall by extracting narrative facts with temporal ranges, resolving entities and constructing graph links, and retrieving memories via multi-strategy search. CARA implements reflect by combining retrieved memories with an agent profile (name, background, and disposition behavioral parameters) to generate preference-shaped responses and to form and reinforce opinions. As we will demonstrate empirically, this design provides several performance advantages over existing memory systems.
Hindsight 的核心是一个简单抽象:把记忆库组织为四个逻辑网络(世界、经验、观点、观察)和三项核心操作(前文提到的保留、回忆与反思)。 世界网络和经验网络存储关于外部世界以及智能体自身经历的客观事实。 观点网络存储带有置信度分数的主观信念,并可在新证据到来时更新。 观察网络存储由底层事实合成的、不带偏好的实体摘要。 TEMPR 通过抽取带时间范围的叙事事实、解析实体并构建图链接,以及通过多策略搜索检索记忆来实现保留和回忆。 CARA 通过把检索到的记忆与智能体画像(姓名、背景和性情行为参数)结合,生成受偏好塑造的响应,并形成和强化观点,从而实现反思。 正如我们将在实验中展示的那样,该设计相比现有记忆系统具有多项性能优势。
Our contributions are:
1. A unified memory architecture for agents. Hindsight's organization of memory into separate networks with core operations helps separate evidence, synthesize summaries better, and supports evolving beliefs, while supporting epistemic clarity and traceability.
2. Retain, recall and reflect layers specialized for agent memory. Our key operational primitives help turn conversational transcripts into a structured, queryable memory bank with ability to reason over this bank and update beliefs in a stable, auditable manner.
3. Empirical evaluation on long-horizon conversational benchmarks. We evaluate Hindsight on LongMemEval and LoCoMo: with an open-source 20B backbone it lifts overall accuracy from 39.0% to 83.6% over a full-context baseline on LongMemEval and from 75.78% to 85.67% on LoCoMo, and with larger backbones reaches 91.4% and 89.61% respectively, matching or surpassing prior memory systems and frontier-backed full-context baselines.
我们的贡献如下:
1. 面向智能体的统一记忆架构。 Hindsight 把记忆组织为带有核心操作的独立网络,有助于分离证据、更好地合成摘要并支持不断演化的信念,同时提供认识论清晰性和可追踪性。
2. 专门面向智能体记忆的保留、回忆和反思层。 我们的关键操作原语有助于把对话记录转化为结构化、可查询的记忆库,并能够在该记忆库上推理,以稳定、可审计的方式更新信念。
3. 在长程对话基准上的实证评估。 我们在 LongMemEval 和 LoCoMo 上评估 Hindsight:使用开源 20B 骨干时,它在 LongMemEval 上相比完整上下文基线把总体准确率从 39.0% 提升至 83.6%,在 LoCoMo 上从 75.78% 提升至 85.67%;使用更大骨干时则分别达到 91.4% 和 89.61%,达到或超过先前记忆系统以及由前沿模型支撑的完整上下文基线。
2. Related Work
Recent work in agent memory spans context management systems that handle LLM window constraints, structured memory architectures built on temporal knowledge graphs, evaluation benchmarks that test these systems, and cognitive frameworks inspired by human memory. We group related work into two categories and discuss how Hindsight differs.
近期智能体记忆工作涵盖处理 LLM 窗口约束的上下文管理系统、构建在时间知识图谱上的结构化记忆架构、用于测试这些系统的评估基准,以及受人类记忆启发的认知框架。 我们把相关工作分为两类,并讨论 Hindsight 的不同之处。
2.1 Memory Architectures and Systems
Tiered context management systems. Early systems extended context using tiered architectures. MemGPT pages information between active prompt and archival storage, treating memory as unstructured text blocks without separating facts from beliefs. LIGHT handles conversations up to 10 million tokens using episodic memory, working memory, and scratchpad buffers, but does not distinguish subjective beliefs from objective observations.
分层上下文管理系统。 早期系统使用分层架构扩展上下文。 MemGPT 在活动提示与归档存储之间分页调度信息,把记忆视为非结构化文本块,而不区分事实与信念。 LIGHT 使用情景记忆、工作记忆和草稿区缓冲区处理最多 1000 万 token 的对话,但不区分主观信念与客观观察。
Structured memory with knowledge graphs. Several systems use knowledge graphs for retrieval. Zep builds temporal knowledge graphs with bi-temporal modeling that tracks when facts are valid versus when they were recorded, but focuses on objective facts without modeling subjective beliefs or behavioral profiles. A-Mem uses the Zettelkasten method to create atomic notes with LLM-generated links that evolve over time, but treats all memory uniformly without separating facts from opinions. Mem0 focuses on production efficiency with dense retrieval and graph representations, handling fact conflicts through database updates rather than belief evolution. Memory-R1 uses reinforcement learning to train agents on memory operations to maximize QA accuracy, but does not focus on cognitive structure and behavioral profile consistency. MemVerse handles multimodal memory through a dual-path architecture combining retrieval and parametric memory via fine-tuning, which raises editability issues that Hindsight avoids by using only external memory. KARMA targets embodied AI with 3D scene graphs for spatial reasoning in robotics, not conversational agents. Table 1 compares these systems across key architectural features.
采用知识图谱的结构化记忆。 多个系统使用知识图谱进行检索。 Zep 通过双时间建模构建时间知识图谱,追踪事实何时有效以及何时被记录,但它关注客观事实,而不建模主观信念或行为画像。 A-Mem 使用卡片盒笔记法创建带有 LLM 生成链接且随时间演化的原子笔记,但统一处理所有记忆,不区分事实与观点。 Mem0 通过密集检索和图表示关注生产效率,并通过数据库更新而非信念演化来处理事实冲突。 Memory-R1 使用强化学习训练智能体执行记忆操作,以最大化问答准确率,但并不关注认知结构和行为画像一致性。 MemVerse 通过结合检索与经微调得到的参数记忆的双路径架构处理多模态记忆,这会引出可编辑性问题;Hindsight 只使用外部记忆,从而避免了该问题。 KARMA 面向具身 AI,使用 3D 场景图完成机器人空间推理,而不是面向对话智能体。 表1比较了这些系统的关键架构特征。
| Feature | MemGPT | LIGHT | Zep | A-Mem | Mem0 | Memory-R1 | MemVerse | KARMA | Hindsight (Ours) |
|---|---|---|---|---|---|---|---|---|---|
| Separates facts/opinions | × | × | × | × | × | × | × | × | ✓ |
| Temporal reasoning | × | × | ✓ | × | × | × | × | × | ✓ |
| Entity-aware graph | × | × | ✓ | ✓ | ✓ | × | × | ✓ | ✓ |
| Opinion evolution | × | × | × | × | × | × | × | × | ✓ |
| Behavioral parameters | × | × | × | × | × | × | × | × | ✓ |
| Confidence scores | × | × | × | × | × | × | × | × | ✓ |
| External-only memory | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | × | ✓ | ✓ |
| Multi-strategy retrieval | × | × | × | × | Partial | × | ✓ | × | ✓ |
2.2 Benchmarks and Cognitive Foundations
Evaluation benchmarks. Recent benchmarks that aim to evaluate long-context reasoning and selective recall have grown in prominence. LoCoMo features very long dialogues (up to 35 sessions) wherein LLMs and traditional RAG systems struggle with long-range temporal and causal reasoning. LongMemEval tests information extraction, multi-session reasoning, and temporal reasoning across conversations featuring upto 1.5 million tokens. MemoryBench tests continual learning from feedback and finds that existing systems fail to use feedback effectively without forgetting. These benchmarks show that current systems are unable to maintain consistent behavioral profiles or handle opinion evolution.
评估基准。 旨在评估长上下文推理和选择性回忆的近期基准越来越受重视。 LoCoMo 包含非常长的对话(最多 35 个会话),LLM 和传统 RAG 系统在其中难以完成长距离时间与因果推理。 LongMemEval 在包含多达 150 万 token 的对话上测试信息抽取、多会话推理和时间推理。 MemoryBench 测试从反馈中持续学习的能力,并发现现有系统无法在不遗忘的情况下有效利用反馈。 这些基准表明,当前系统无法保持一致的行为画像或处理观点演化。
Cognitive foundations. Several surveys have attempted to connect agent memory to human memory models. Recent work categorizes memory by source, form, and operations, noting that most work focuses on task completion over consistency and that parametric memory is hard to interpret. Other work draws parallels between episodic/semantic memory and RAG/knowledge graphs, pointing out gaps in implicit memory and forgetting. The memory quadruple framework highlights key facets of memory---storage, persistence, access, and controllability---arguing for external memory that supports dynamic updates. Work on cognitive memory distinguishes explicit and implicit memory and notes that LLMs struggle with human-like knowledge integration. Recent findings show that LLMs lack true working memory and must externalize state into context windows.
认知基础。 多项综述尝试把智能体记忆与人类记忆模型联系起来。 近期工作按来源、形式和操作对记忆进行分类,并指出多数工作更关注任务完成而非一致性,而且参数记忆难以解释。 其他工作把情景记忆和语义记忆分别类比于 RAG 和知识图谱,并指出隐式记忆与遗忘方面的缺口。 记忆四元组框架强调记忆的关键方面——存储、持久性、访问和可控性——并主张采用支持动态更新的外部记忆。 认知记忆研究区分显式记忆和隐式记忆,并指出 LLM 难以实现类似人类的知识整合。 近期发现表明,LLM 缺乏真正的工作记忆,必须把状态外化到上下文窗口中。
While earlier work has focused on storage, retrieval, and scale, recent developments in agent systems blur what agents observe versus what they believe, cannot maintain stable behavioral profiles across long interactions, and have no way to evolve subjective beliefs over time. In the rest of the paper, we demonstrate how Hindsight addresses these gaps.
尽管早期工作关注存储、检索和规模,但智能体系统的近期发展仍会混淆智能体观察到的内容与相信的内容,无法在长时间交互中保持稳定的行为画像,也没有办法使主观信念随时间演化。 在本文其余部分,我们将展示 Hindsight 如何弥补这些缺口。
3. Hindsight Overview
Hindsight is a memory architecture for AI agents that unifies long-term factual recall with preference-conditioned reasoning. Each agent is backed by a memory bank that accumulates interactions encountered over time, and a reasoning layer that uses this memory to answer questions, form opinions, and update its beliefs in a consistent way.
Hindsight 是一种面向 AI 智能体的记忆架构,统一了长期事实回忆与偏好条件推理。 每个智能体都有一个随时间累积所遇交互的记忆库作为支撑,以及一个利用这些记忆回答问题、形成观点并以一致方式更新信念的推理层。
3.1 Four-Network Memory Organization
At the core of Hindsight is a memory bank organized into four logical networks, each serving a distinct epistemic role. Let
Hindsight 的核心是一个由四个逻辑网络组织而成的记忆库,每个网络承担不同的认识论角色。 令
3.2 Three Core Operations
Hindsight exposes the four-network memory structure through three core operations that govern how information is added, accessed, and updated. Let
Hindsight 通过三项核心操作开放四网络记忆结构,这些操作控制信息如何被加入、访问和更新。 令
Finally,
最后,

3.3 Component Architecture
The two main components of Hindsight implement these operations with distinct responsibilities: TEMPR realizes the retain and recall stages. It builds the four-network memory graph via LLM-powered narrative fact extraction, entity resolution, and link construction. TEMPR provides a retrieval interface optimized for agents, with token budgets and multi-hop discovery over temporal and entity-aware links. The retain pipeline processes input data by extracting narrative facts, generating embeddings, resolving entities, and constructing four types of graph links: temporal, semantic, entity, and causal.
Hindsight 的两个主要组件以不同职责实现这些操作: TEMPR 实现保留和回忆阶段。 它通过由 LLM 驱动的叙事事实抽取、实体解析和链接构建来建立四网络记忆图。 TEMPR 提供为智能体优化的检索接口,支持 token 预算以及在时间与实体感知链接上的多跳发现。 保留流水线通过抽取叙事事实、生成嵌入、解析实体,并构建时间、语义、实体和因果四类图链接来处理输入数据。
CARA realizes the reflect stage. It integrates configurable disposition behavioral parameters into the reasoning process, operates over Hindsight's networks to separate facts from beliefs, and maintains a dynamic opinion network via opinion formation and reinforcement. The behavioral profile consists of three disposition parameters (skepticism, literalism, empathy), each ranging from 1 to 5, and a bias-strength parameter between 0 and 1. CARA uses this profile to modulate the generation process, ensuring that responses align with the configured behavioral style. Figure 2 provides a comprehensive view of the end-to-end architecture, showing the data flow from input through TEMPR's retain and recall pipelines, the four-network memory bank structure, and CARA's preference-conditioned reflect operation.
CARA 实现反思阶段。 它把可配置的性情行为参数整合进推理过程,在 Hindsight 的网络上运行以分离事实与信念,并通过观点形成和强化来维护动态观点网络。 行为画像由三个性情参数(怀疑性、字面性和共情性)以及一个偏置强度参数组成;每个性情参数取值为 1 到 5,偏置强度参数取值为 0 到 1。 CARA 使用该画像调节生成过程,确保响应符合配置的行为风格。 图2全面展示了端到端架构,包括输入经过 TEMPR 的保留与回忆流水线的数据流、四网络记忆库结构,以及 CARA 的偏好条件反思操作。
3.4 Design Principles
The architecture of Hindsight is designed around several goals that recur throughout the paper. First, we aim for epistemic clarity, wherein facts, observations, and opinions are kept structurally distinct so that developers and users can see what the agent knows versus what it believes. The four-network organization
Hindsight 的架构围绕本文反复出现的多项目标设计。 第一,我们追求认识论清晰性,在结构上区分事实、观察和观点,使开发者和用户能够看清智能体知道什么以及相信什么。 四网络组织
Third, this approach supports Entity-aware reasoning leveraging graph links over shared entities, semantic similarity, temporal proximity, and causal relationships support multi-hop discovery of indirectly related information. The memory graph is the underlying data structure that connects all memory units: formally,
第三,该方法支持实体感知推理,利用共享实体、语义相似性、时间邻近性和因果关系上的图链接,对间接相关信息进行多跳发现。 记忆图是连接所有记忆单元的底层数据结构:形式上,
The following sections instantiate Hindsight's architecture. Section 4 describes TEMPR, which implements Hindsight's retain and recall operations and builds the four-network memory graph. Section 5 then presents CARA, which implements the reflect operation and shows how preference-aware reasoning is layered on top of this memory substrate. Section 6 describes the unified integration of these components followed by experimental results.
以下各节具体说明 Hindsight 的架构。 第 4 节描述 TEMPR,它实现 Hindsight 的保留与回忆操作并构建四网络记忆图。 随后,第 5 节介绍 CARA,它实现反思操作,并展示如何在这一记忆基底上叠加偏好感知推理。 第 6 节描述这些组件的统一整合,之后给出实验结果。
4. TEMPR: Retain and Recall
As described earlier, TEMPR (Temporal Entity Memory Priming Retrieval) implements Hindsight's retain and recall operations. It is responsible for turning raw conversational transcripts into a structured, temporal, entity-aware memory graph, and for retrieving variable amounts of relevant information for downstream reasoning. We first describe how TEMPR retains information by organizing memories, extracting narrative facts, and constructing an entity-aware graph. We then describe how it recalls information using a four-way parallel retrieval architecture with fusion and neural re-ranking. The neural components used in this pipeline, including the embedding model for semantic retrieval, the cross encoder reranker, and the downstream LLM, can all be treated as configurable modules rather than fixed backbones.
如前所述,TEMPR(时间实体记忆启动检索)实现 Hindsight 的保留与回忆操作。 它负责把原始对话记录转化为结构化、具备时间与实体感知能力的记忆图,并为下游推理检索数量可变的相关信息。 我们首先描述 TEMPR 如何通过组织记忆、抽取叙事事实和构建实体感知图来保留信息。 随后,我们描述它如何使用具有融合和神经重排的四路并行检索架构来回忆信息。 该流水线使用的神经组件,包括用于语义检索的嵌入模型、交叉编码器重排器和下游 LLM,都可以视为可配置模块,而不是固定骨干。
4.1 Retain: Building a Temporal Entity Memory Graph
4.1.1 Memory Organization
As introduced in Section 3, Hindsight organizes memories into four networks to separate objective information, subjective beliefs, and synthesized summaries. TEMPR instantiates this design by storing each extracted fact in exactly one network and attaching it to the shared memory graph. Each fact
如第 3 节所述,Hindsight 把记忆组织为四个网络,以分离客观信息、主观信念和合成摘要。 TEMPR 通过把每个抽取事实仅存入一个网络,并将其附着到共享记忆图上来实现这一设计。 每个事实
Each memory is stored as a self-contained node that combines natural language, vector representations, and temporal metadata. Formally, a memory unit is a tuple:
每条记忆都被存储为一个结合自然语言、向量表示和时间元数据的自包含节点。 形式上,一个记忆单元是如下元组:
where
其中,
4.1.2 LLM-Based Narrative Fact Extraction
TEMPR uses an open-source LLM to convert conversational transcripts into narrative facts and associated metadata. Compared to rule-based or sentence-level pipelines, this approach lets us extract self-contained facts that preserve cross-turn context and reasoning.
TEMPR 使用开源 LLM 把对话记录转换为叙事事实及相关元数据。 相比基于规则或句子级的流水线,该方法使我们能够抽取保留跨轮次上下文和推理的自包含事实。
Chunking Strategy. We use coarse-grained chunking, extracting 2--5 comprehensive facts per conversation. Each fact is intended to cover an entire exchange rather than a single utterance, be narrative and self-contained, include all relevant participants, and preserve the pragmatic flow of the interaction. Figure 3 illustrates this approach. Instead of storing five fragmented facts, we store a single narrative fact that makes downstream retrieval and reasoning less sensitive to local segmentation decisions.
分块策略。 我们采用粗粒度分块,每段对话抽取 2--5 个综合事实。 每个事实都旨在覆盖完整交流而不是单条话语,采用叙事形式且自包含,纳入所有相关参与者,并保留交互的语用流程。 图3展示了这一方法。 我们不存储五个碎片化事实,而是存储一个叙事事实,使下游检索和推理对局部分割决策不那么敏感。
Fragmented Extraction (Avoided)
Five separate facts:- “Bob suggested Summer Vibes”
- “Alice wanted something unique”
- “They considered Sunset Sessions”
- “Alice likes Beach Beats”
- “They chose Beach Beats”
Narrative Extraction (Used)
Single narrative fact:Alice and Bob discussed naming their summer party playlist. Bob suggested “Summer Vibes” because it is catchy and seasonal, but Alice wanted something more unique. Bob then proposed “Sunset Sessions” and “Beach Beats,” with Alice favoring “Beach Beats” for its playful and fun tone. They ultimately decided on “Beach Beats” as the final name.
Extraction Pipeline. The extraction model is prompted to produce structured output containing the narrative text of each fact, normalized temporal information (including ranges), participants and their roles, a fact type indicating the target network, and a set of mentioned entities (see the Appendix for the complete prompt template and the structured output schema). Internally, we decompose this into the following steps: 1) coreference resolution over the conversation to identify entity mentions and their referents; 2) temporal expression normalization and range extraction to convert relative time references (last week'', in March'') into absolute timestamps
抽取流水线。 抽取模型根据提示生成结构化输出,其中包含每个事实的叙事文本、规范化时间信息(包括范围)、参与者及其角色、指示目标网络的事实类型,以及一组被提及实体(完整提示模板和结构化输出 schema 见附录)。 在内部,我们把它分解为以下步骤:1) 在对话上执行共指消解,以识别实体提及及其指代对象;2) 对时间表达进行规范化和范围抽取,把相对时间指代(“上周”“三月”)转换为绝对时间戳
4.1.3 Entity Resolution and Linking
Entity resolution links memories that refer to the same underlying entity, enabling multi-hop reasoning over the memory graph. Recognition and Disambiguation. The LLM used for fact extraction (described above) also identifies entity mentions during fact extraction. We then map mentions to canonical entities using a combination of string and name similarity (e.g., Levenshtein distance), co-occurrence patterns with other entities, and temporal proximity of mentions. Let
实体解析把指向同一底层实体的记忆连接起来,从而支持在记忆图上进行多跳推理。 识别与消歧。 上述用于事实抽取的 LLM 也会在事实抽取期间识别实体提及。 随后,我们综合使用字符串与名称相似度(例如 Levenshtein 距离)、与其他实体的共现模式,以及实体提及的时间邻近性,把提及映射到规范实体。 令
where
其中,
These entity links enable graph traversal to surface indirectly related facts. For example, conversations about the same person across distant time spans that would be difficult to retrieve with vector or keyword search alone can be discovered through entity links.
这些实体链接使图遍历能够找到间接相关的事实。 例如,仅用向量或关键词搜索难以检索到的、跨越遥远时间段且涉及同一个人的对话,可以通过实体链接发现。
4.1.4 Link Types and Graph Structure
In addition to entity links, the memory graph
除实体链接外,记忆图
1) Temporal Links. For any two memories
1) 时间链接。 对于带有时间元数据的任意两条记忆
where
其中,
2) Semantic Links. For any two memories
2) 语义链接。 对于嵌入为
3) Causal Links. Causal relationships are extracted by the LLM and represent cause-effect relationships. These links are upweighted during traversal to favor explanatory connections. Let
3) 因果链接。 因果关系由 LLM 抽取,表示原因与结果之间的关系。 遍历期间会提高这些链接的权重,以优先考虑解释性连接。 令
4.1.5 The Observation Paradigm
Observations provide structured, objective summaries of entities that sit on top of raw narrative facts. Motivation and Design. For simple entity-centric queries (e.g., ``Tell me about Alice''), retrieving all underlying facts can be inefficient and redundant. Instead, we maintain synthesized profiles (observations) that summarize salient properties of each entity and can be referenced directly in responses (see the Appendix for the complete observation generation prompt). Let
观察是在原始叙事事实之上建立的、关于实体的结构化客观摘要。 动机与设计。 对于简单的实体中心查询(例如“介绍一下 Alice”),检索所有底层事实可能既低效又冗余。 因此,我们维护概括每个实体显著属性的合成画像(观察),并可在响应中直接引用这些画像(完整观察生成提示见附录)。 令
where the LLM is instructed to produce a concise, preference-neutral summary. Observations vs. Opinions. Observations and opinions differ along several dimensions that matter for reasoning. Observations are generated without behavioral profile influence, whereas opinions are explicitly shaped by the bank's disposition behavioral parameters (skepticism, literalism, empathy). Observations provide objective summaries of entities (e.g., roles, attributes), while opinions capture subjective evaluations and judgments. Observations do not carry confidence scores, but opinions include a confidence score
其中,LLM 被要求生成简洁且不带偏好的摘要。 观察与观点。 观察和观点在多个与推理相关的维度上存在差异。 观察的生成不受行为画像影响,而观点会明确受到记忆库的性情行为参数(怀疑性、字面性、共情性)塑造。 观察提供实体的客观摘要(例如角色、属性),而观点捕获主观评价和判断。 观察不带有置信度分数,而观点包含表示信念强度的置信度分数
Background Processing. Observation generation and regeneration run asynchronously to maintain low-latency writes while gradually improving the quality of entity-centric summaries. When new facts mentioning entity
后台处理。 观察生成和再生成以异步方式运行,在保持低延迟写入的同时逐步提高实体中心摘要的质量。 当保留了提及实体
4.2 Recall: Agent-Optimized Retrieval Architecture
Given the memory graph described above, TEMPR must retrieve variable amounts of relevant context for a query while respecting the downstream LLM's context window. Unlike conventional search systems that expose a fixed top-
给定上述记忆图,TEMPR 必须在遵守下游 LLM 上下文窗口的同时,为查询检索数量可变的相关上下文。 与提供固定 top-
4.2.1 Agent-Optimized Retrieval Interface
Rather than exposing a fixed top-
TEMPR 不提供固定的 top-
where
其中,
where
其中,
4.2.2 Four-Way Parallel Retrieval
To populate the candidate set for a query, TEMPR runs four retrieval channels in parallel, each capturing a different notion of relevance. Let
为了填充查询的候选集合,TEMPR 并行运行四个检索通道,每个通道捕获一种不同的相关性概念。 令
Semantic Retrieval (Vector Similarity). The semantic retrieval channel performs vector similarity search using cosine similarity between the query embedding
语义检索(向量相似度)。 语义检索通道使用查询嵌入
We use an HNSW-based pgvector index to efficiently retrieve the top-
我们使用基于 HNSW 的 pgvector 索引,按语义分数高效检索 top-
This channel is responsible for capturing conceptual similarity and paraphrases, and typically provides high recall on meaning-level matches even when surface forms differ.
该通道负责捕获概念相似性和释义,即使表面形式不同,通常也能在含义级匹配上提供高召回率。
Keyword Retrieval (BM25). In parallel, we run a lexical channel using a full-text search with BM25 ranking over a GIN index on the memory text. Let
关键词检索(BM25)。 与此同时,我们运行一个词汇通道,在记忆文本的 GIN 索引上使用带 BM25 排名的全文搜索。 令
This channel excels at precise matching of proper nouns and technical terms (e.g., specific API names or dataset identifiers) and complements the semantic channel by recovering items that might be underrepresented or ambiguous in the embedding space.
该通道擅长精确匹配专有名词和技术术语(例如特定 API 名称或数据集标识符),并通过找回在嵌入空间中可能表示不足或含义模糊的条目来补充语义通道。
Graph Retrieval (Spreading Activation). The third channel exploits the memory graph
图检索(扩散激活)。 第三个通道通过扩散激活利用记忆图
where
其中,
Temporal Graph Retrieval. When a temporal constraint is detected in the query, we invoke a temporal graph retrieval channel backed by a hybrid temporal parser. We first run a rule-based analyzer that uses two off-the-shelf date parsing libraries with multilingual support to normalize explicit and relative expressions (for example, yesterday'', last weekend'', or ``June 2024'') into a date range. This heuristic path handles the majority of queries at low latency. For queries that cannot be resolved heuristically, we fall back to a lightweight sequence-to-sequence model (here, we use google/flan-t5-small), which converts the remaining temporal expressions into a concrete date range
时间图检索。 当查询中检测到时间约束时,我们调用一个由混合时间解析器支持的时间图检索通道。 我们首先运行基于规则的分析器,使用两个支持多语言的现成日期解析库,把显式和相对表达(例如“昨天”“上周末”或“2024 年 6 月”)规范化为日期范围。 该启发式路径能以低延迟处理大多数查询。 对于无法通过启发式方法解析的查询,我们回退到轻量级序列到序列模型(这里使用 google/flan-t5-small),把剩余时间表达转换为具体日期范围
Graph traversal is restricted to memories in
图遍历被限制在
where
其中,
4.2.3 Reciprocal Rank Fusion (RRF)
After parallel retrieval, TEMPR merges the four ranked lists using Reciprocal Rank Fusion. Let
并行检索后,TEMPR 使用倒数排名融合合并四个排名列表。 令
where
其中,
4.2.4 Neural Cross-Encoder Reranking
After RRF fusion, TEMPR applies a neural cross-encoder reranker to refine precision on the top candidates. We use cross-encoder/ms-marco-MiniLM-L-6-v2, which jointly encodes the query and each candidate memory and outputs a relevance score. Let
RRF 融合后,TEMPR 应用神经交叉编码器重排器,提高顶部候选的精确率。 我们使用 cross-encoder/ms-marco-MiniLM-L-6-v2,它联合编码查询和每条候选记忆,并输出相关性分数。 令
Compared to purely embedding-based similarity, the cross-encoder can model rich query-document interactions learned from supervised passage-ranking data, rather than relying on independent vector representations. In our setting, we also include formatted temporal information in the input text, allowing the reranker to incorporate simple temporal cues when deciding which memories are most relevant.
相比纯粹基于嵌入的相似度,交叉编码器能够建模从有监督段落排名数据中学到的丰富查询—文档交互,而不是依赖独立向量表示。 在我们的设置中,输入文本还包含格式化时间信息,使重排器在判断哪些记忆最相关时能够纳入简单时间线索。
4.2.5 Token Budget Filtering
In the final stage, TEMPR enforces the caller's token budget so that the selected memories fit within the downstream LLM's context window. Starting from the reranked list
在最后阶段,TEMPR 强制执行调用方的 token 预算,使选定记忆能够放入下游 LLM 的上下文窗口。 从重排列表
where
其中,
5. CARA: Coherent Adaptive Reasoning Agents
As described earlier, CARA (Coherent Adaptive Reasoning Agents) implements the reflect operation. Given the long-term memory bank built and maintained by TEMPR, CARA turns retrieved facts and observations into preference-conditioned reasoning and a layer of explicitly stored opinions that can change over time. CARA treats an agent's behavioral profile as a first-class part of the system configuration rather than as a one-off prompt decoration. Each memory bank is associated with a configurable disposition profile (skepticism, literalism, empathy) and a concise background description, and CARA uses this profile when forming and updating opinions over the world and experience networks. Concretely, CARA provides four key capabilities: disposition-profile integration, Hindsight memory integration, opinion formation and reinforcement, and background merging with conflict resolution.
如前所述,CARA(连贯自适应推理智能体)实现了反思操作。 给定由 TEMPR 构建和维护的长期记忆库,CARA 将检索到的事实与观察转化为偏好条件推理,并形成一层可随时间变化的显式存储观点。 CARA 将智能体的行为画像视为系统配置的一等组成部分,而不是一次性的提示装饰。 每个记忆库都关联一个可配置的性情画像(怀疑性、字面性、共情性)和一段简洁的背景描述,CARA 在基于世界网络和经历网络形成与更新观点时使用该画像。 具体而言,CARA 提供四项关键能力:性情画像整合、Hindsight 记忆整合、观点形成与强化,以及带冲突解决的背景合并。
5.1 Motivation
To motivate CARA, consider two configurations of the same agent discussing remote work. In the first configuration, given a behavioral profile with low skepticism (
为说明 CARA,考虑同一个智能体讨论远程工作的两种配置。 在第一种配置中,给定低怀疑性(
5.2 Preference Model
CARA first defines a preference space that can be parameterized and verbalized for prompting.
CARA 首先定义一个可参数化并可用语言表达以供提示使用的偏好空间。
5.2.1 Disposition Parameters
We use a three-dimensional disposition space as an interpretable set of ordered preference dimensions. Let
我们使用三维性情空间作为一组可解释的有序偏好维度。 令
The bias strength parameter
偏置强度参数
Rationale for using Disposition Parameters. We adopt these dimensions because they offer a compact, interpretable parameterization of reasoning style (trusting vs. skeptical, flexible vs. literal, detached vs. empathetic), intuitive axes that can be verbalized in prompts (e.g., “skeptical but highly empathetic”), and a simple interface for users configuring different agent styles.
**使用性情参数的理由。**我们采用这些维度,因为它们为推理风格(信任与怀疑、灵活与字面、疏离与共情)提供了紧凑且可解释的参数化形式、可在提示中用语言表达的直观轴线(例如“怀疑但高度共情”),以及供用户配置不同智能体风格的简单接口。
Intended Effects on Reasoning. CARA uses the behavioral profile to modulate prompts so that different configurations encourage different emphases when forming opinions. The mapping from preference values to reasoning behavior is achieved through natural language verbalization in system prompts. Higher Skepticism encourages more cautious evaluation of claims, greater emphasis on evidence quality, and reluctance to accept unsupported statements; lower Skepticism encourages more trusting and exploratory behavior. Similarly, higher Literalism encourages closer attention to exact wording and explicit instructions; lower Literalism encourages reading between the lines, inferring implicit goals, and using abstraction. Finally, higher Empathy encourages taking emotional context and interpersonal impact into account, using more supportive and face-saving language; lower Empathy encourages more blunt, task-first communication.
**对推理的预期影响。**CARA 使用行为画像调节提示,使不同配置在形成观点时鼓励不同的侧重点。 偏好值到推理行为的映射通过系统提示中的自然语言表达实现。 较高的怀疑性鼓励更谨慎地评估主张、更重视证据质量并避免接受缺乏支持的陈述;较低的怀疑性则鼓励更信任、更具探索性的行为。 类似地,较高的字面性鼓励更密切关注确切措辞和明确指令;较低的字面性鼓励领会言外之意、推断隐含目标并使用抽象。 最后,较高的共情性鼓励考虑情绪语境和人际影响,使用更具支持性和顾全面子的语言;较低的共情性则鼓励更直接、任务优先的交流。
5.3 Bank Profile Structure
Each memory bank has an associated profile that encodes the agent's identity and disposition configuration in a form suitable for prompting and reasoning. Formally, a bank profile is a tuple:
每个记忆库都有一个关联画像,以适合提示和推理的形式编码智能体的身份与性情配置。 形式上,记忆库画像是一个元组:
where
其中,
5.3.1 Preference Description Generation
The numeric behavioral profile
数值行为画像
This verbalization connects the numeric preference configuration to the LLM's behavior by providing an explicit description of how the agent is intended to reason and communicate.
这种语言化通过明确描述智能体预期如何推理和交流,将数值偏好配置与 LLM 的行为联系起来。
5.4 Opinion Network and Opinion Formation
5.4.1 Opinion Structure
Opinions are stored in the opinion network
观点存储在观点网络
where
其中,
5.4.2 Opinion Formation Process
Opinion formation sits at the interface between TEMPR and CARA (Figure 4). When a query calls for a subjective judgment, CARA performs the following steps (see the appendix for the complete opinion formation prompt template):
观点形成位于 TEMPR 与 CARA 的接口处(图 4)。 当查询需要主观判断时,CARA 执行以下步骤(完整的观点形成提示模板见附录):
1. use TEMPR to retrieve relevant world facts and experiences (and any existing opinions) for the query
2. construct a system message
3. run a reflect step in which the LLM produces both a natural language answer
4. parse the structured output and store any new or updated opinions in the opinion network
1. 使用 TEMPR 为查询
2. 构造系统消息
3. 执行反思步骤,LLM 同时生成自然语言回答
4. 解析结构化输出,并将任何新增或更新后的观点存入观点网络

The behavioral profile
行为画像
Each opinion formed in this way includes a confidence score
以这种方式形成的每个观点都包含置信度分数
Trusting, Flexible, Empathetic Profile (
“Remote work is a net positive because it removes commute time and creates space for more flexible, self-directed work.”
Emphasis: Autonomy, flexibility, creative freedomSkeptical, Literal, Detached Profile (
“Remote work risks undermining consistent performance because it makes it harder to maintain structure, oversight, and shared routines.”
Emphasis: Structure, accountability, consistencyFigure 5 illustrates how different behavioral profiles lead to systematically different opinions when presented with the same factual evidence.
图 5说明了在面对相同事实证据时,不同的行为画像如何系统地产生不同观点。
5.5 Opinion Reinforcement
So far, we have described how CARA forms new opinions. In a long-lived system, those opinions should also be able to evolve as new information is retained. When new facts arrive via TEMPR's retain pathway, CARA updates any related opinions in three steps:
到目前为止,我们已经描述了 CARA 如何形成新观点。 在长期运行的系统中,随着新信息被保留,这些观点也应能够演化。 当新事实通过 TEMPR 的保留路径到来时,CARA 分三个步骤更新任何相关观点:
1) Identify Candidates. Use entity overlap and semantic similarity to find opinions that are plausibly related to the new facts. For each new fact
**1)识别候选项。**使用实体重叠和语义相似性,寻找可能与新事实相关的观点。 对于每个具有实体
where
其中,
2) Assess the Evidence. For each candidate opinion
**2)评估证据。**对于每个候选观点
3) Apply an Update. Adjust the opinion's confidence score (and, for strong contradictions or refinements, optionally its text) according to the assessed relationship. Let
**3)应用更新。**根据评估出的关系调整观点的置信度分数(对于强烈反驳或细化,也可选择调整其文本)。 令
where
其中,
The update logic is designed to keep opinion trajectories stable but responsive. Small amounts of evidence lead to small changes, preventing opinions from oscillating in response to individual examples, while repeated reinforcement or strong contradictions can substantially shift the confidence. The behavioral profile can also influence how quickly opinions move (for example, a more cautious configuration may use a smaller
更新逻辑旨在使观点轨迹保持稳定但又能响应变化。 少量证据只会引起小幅变化,防止观点因单个样例而来回摆动;而反复强化或强烈反驳则可以大幅改变置信度。 行为画像也能影响观点变化的速度(例如,更谨慎的配置可以使用更小的
5.6 Background Merging
In addition to opinions, an agent's background description
除观点外,随着用户提供更多个人经历信息,智能体的背景描述
To keep the background coherent, CARA uses an LLM-powered merging procedure. Given the current background
为保持背景连贯,CARA 使用由 LLM 驱动的合并过程。 给定当前背景
“I was born in Colorado.”
New Snippet:“You were born in Texas and have 10 years of startup experience.”
Merged Background:“I was born in Texas and have 10 years of startup experience.”
Figure 6 illustrates this process. As a preprocessing step, user-provided snippets are normalized into first person before merging, so that inputs such as “You are a creative engineer” become “I am a creative engineer.” This keeps the internal representation consistent with the way backgrounds are referenced in prompts. By maintaining a single, merged background per bank, CARA keeps identity information compact and coherent even as new biographical details accumulate over time.
图 6说明了这一过程。 作为预处理步骤,用户提供的片段会在合并前统一转换为第一人称,因此“你是一名富有创造力的工程师”这样的输入会变为“我是一名富有创造力的工程师”。 这使内部表示与提示中引用背景的方式保持一致。 通过为每个记忆库维护一份合并后的背景,即使新的个人经历细节随时间累积,CARA 也能使身份信息保持紧凑和连贯。
5.7 Preference-Conditioned Reasoning Examples
We conclude this section with brief examples showing how CARA produces distinct and evolving viewpoints using the same underlying memory.
本节最后通过简短示例展示 CARA 如何使用相同的底层记忆产生不同且不断演化的观点。
5.7.1 Example: Opinion Evolution
CARA's reinforcement mechanism also supports opinion change over time. Suppose a bank starts with the opinion:
CARA 的强化机制也支持观点随时间变化。 假设一个记忆库从以下观点开始:
As new facts are retained via TEMPR, related evidence can strengthen or weaken this belief. For instance, a fact about Python's dominant ecosystem in AI/ML might lead to a modest increase in confidence:
随着新事实通过 TEMPR 被保留,相关证据可以强化或削弱这一信念。 例如,一条关于 Python 在 AI/ML 中占主导地位的生态系统的事实,可能会使置信度适度上升:
Later facts about performance advantages and growing adoption of alternatives (e.g., Julia or Rust in certain domains) might decrease confidence and encourage a more qualified opinion:
随后,关于替代方案性能优势及采用率不断提高的事实(例如 Julia 或 Rust 在某些领域中的情况),可能会降低置信度,并促成一个更审慎的观点:
In this way, opinions become trajectories rather than static labels. They start from an initial, preference-conditioned formation step and are subsequently adjusted as new evidence accumulates. Taken together, these mechanisms show how CARA turns the static memory structures provided by TEMPR into a configurable, preference-conditioned reasoning process. In Section 6, we combine TEMPR and CARA into the unified Hindsight architecture and examine the end-to-end properties and empirical behavior of the full system.
通过这种方式,观点成为轨迹而非静态标签。 它们始于初始的偏好条件形成步骤,随后随着新证据累积而调整。 综合来看,这些机制展示了 CARA 如何将 TEMPR 提供的静态记忆结构转变为可配置的偏好条件推理过程。 在第 6 节中,我们将 TEMPR 和 CARA 结合为统一的 Hindsight 架构,并考察完整系统的端到端特性与实证行为。
6. Putting it all together: Unified Hindsight Architecture
We have now described TEMPR, which implements Hindsight's retain and recall operations (Section 4), and CARA, which implements the reflect operation (Section 5). In this section, we show how these components compose into a single end-to-end system and highlight the system-level properties that emerge from their interaction. At a high level, Hindsight turns raw conversational input into a structured memory bank and then uses that bank to support preference-conditioned reasoning over time.
至此,我们已经介绍了实现 Hindsight 保留与回忆操作的 TEMPR(第 4 节),以及实现反思操作的 CARA(第 5 节)。 本节展示这些组件如何组成一个端到端系统,并强调其相互作用产生的系统级特性。 从高层来看,Hindsight 将原始对话输入转化为结构化记忆库,然后使用该记忆库支持随时间展开的偏好条件推理。
6.1 Integration: Retain, Recall, Reflect
The Hindsight system integrates TEMPR and CARA into a unified architecture centered on three core operations. We summarize each operation here for completeness, using the same definitions introduced in Section 3.
Hindsight 系统将 TEMPR 和 CARA 整合为一个以三项核心操作为中心的统一架构。 为完整起见,我们在此使用第 3 节介绍的相同定义概述每项操作。
Retain. The retain operation stores information into memory banks. Formally, given a memory bank
**保留。**保留操作将信息存入记忆库。 形式上,给定记忆库
where
其中,
1. LLM-powered fact extraction with temporal ranges to convert
2. entity recognition and resolution to map entity mentions to canonical entities
3. graph link construction to create edges of type temporal, semantic, entity, and causal in the memory graph
4. automatic opinion reinforcement for existing beliefs when new evidence arrives, where for each opinion
5. background merging to keep the bank profile coherent over time using the merging function
1. 由 LLM 驱动、带时间范围的事实提取,将
2. 通过实体识别与解析,将实体提及映射到规范实体
3. 构建图链接,在记忆图
4. 当新证据到来时自动强化已有信念:对于每个观点
5. 使用合并函数
Recall. The recall operation retrieves memories using multi-strategy search. Formally, given a memory bank
**回忆。**回忆操作使用多策略搜索检索记忆。 形式上,给定记忆库
where
其中,
1. four-way parallel retrieval (semantic, keyword, graph, temporal) to generate candidate sets
2. Reciprocal Rank Fusion to combine ranked lists using
1. 四路并行检索(语义、关键词、图、时间),生成候选集合
2. 使用倒数排序融合合并排序列表:
3. neural cross-encoder reranking for final precision using
4. token budget filtering to ensure
3. 使用
4. 通过贪心选择排名最高的事实直至预算耗尽,执行 token 预算过滤以确保
Reflect. The reflect operation generates preference-conditioned responses. Formally, given a memory bank
**反思。**反思操作生成偏好条件响应。 形式上,给定记忆库
where
其中,
1. use TEMPR to retrieve relevant memories from world, experience, opinion, and observation networks:
2. load the bank's preference profile
3. generate a response whose reasoning and tone are influenced by the configured preferences and bias-strength parameter
4. form new opinions with confidence scores when appropriate, where for each new opinion
5. store opinions for future retrieval and reinforcement, updating
1. 使用 TEMPR 从世界网络、经历网络、观点网络和观察网络中检索相关记忆:
2. 加载记忆库的偏好画像
3. 生成推理方式和语气受配置偏好及偏置强度参数
4. 在适当情况下形成带置信度分数的新观点:对于每个新观点
5. 存储观点以供未来检索和强化,将其更新为
Together, these operations define a full loop: new experiences are retained into structured memory, recalled as needed for a given query, and reflected upon in a way that updates the agent's beliefs and identity configuration.
这些操作共同定义了一个完整循环:新经历被保留到结构化记忆中,在给定查询需要时被回忆,并通过反思更新智能体的信念与身份配置。
7. Experiments
We evaluate Hindsight on two long-term conversational memory benchmarks to measure its ability to retain, recall, and reason over extended interactions. Our evaluation focuses on how well the system maintains coherent memory across many sessions and whether TEMPR and CARA together support accurate, preference-conditioned reasoning.
我们在两个长期对话记忆基准上评估 Hindsight,以衡量其在长时间交互中保留、回忆和推理的能力。 我们的评估重点考察系统在多个会话中维持连贯记忆的能力,以及 TEMPR 和 CARA 能否共同支持准确的偏好条件推理。
7.1 Datasets
We use two benchmarks designed to test long-term memory in conversational agents.
我们使用两个为测试对话智能体长期记忆而设计的基准。
7.1.1 LongMemEval
LongMemEval tests chat assistants on conversations that span many sessions and require recalling information from hundreds of thousands of tokens. The benchmark includes 500 questions that evaluate five core abilities:
LongMemEval 在跨越多个会话、需要从数十万 token 中回忆信息的对话上测试聊天助手。 该基准包含 500 个问题,用于评估五项核心能力:
- Information Extraction (IE): Retrieving basic facts from past conversations.
- Multi-session Reasoning (MR): Connecting information across different sessions.
- Temporal Reasoning (TR): Understanding when events occurred and their temporal relationships.
- Knowledge Update (KU): Handling updated or contradictory information over time.
- Abstention (ABS): Recognizing when information is not available rather than guessing.
- 信息提取(IE):从过去的对话中检索基本事实。
- 多会话推理(MR):连接不同会话中的信息。
- 时间推理(TR):理解事件发生的时间及其时间关系。
- 知识更新(KU):处理随时间更新或相互矛盾的信息。
- 拒答(ABS):在信息不可用时识别这一情况,而不是进行猜测。
The benchmark provides two conversation settings: the S setting with around 115,000 tokens spanning roughly 50 sessions, and the M setting with approximately 1.5 million tokens across about 500 sessions. Both settings test the same abilities but at different scales.
该基准提供两种对话设置:S 设置包含约 115,000 个 token,跨越大约 50 个会话;M 设置包含约 150 万个 token,跨越约 500 个会话。 两种设置测试相同的能力,但规模不同。
7.1.2 LoCoMo
LoCoMo evaluates very long-term conversational memory using 50 human-human conversations collected over multiple sessions. Each conversation averages 304.9 turns, 9,209.2 tokens, and 19.3 sessions, with some extending up to 35 sessions. The dataset includes multimodal information such as images shared during conversations, making it more realistic than text-only benchmarks. Questions test whether agents can recall personal details, preferences, past events, and context shared across distant sessions. Table 2 summarizes statistics for both benchmarks.
LoCoMo 使用跨多个会话收集的 50 段人类对话评估超长期对话记忆。 每段对话平均包含 304.9 轮、9,209.2 个 token 和 19.3 个会话,部分对话延伸至 35 个会话。 该数据集包含对话中分享的图像等多模态信息,因此比纯文本基准更贴近现实。 问题用于测试智能体能否回忆个人细节、偏好、过去事件以及跨远距离会话共享的语境。 表 2汇总了两个基准的统计信息。
| Statistic | LongMemEval | LoCoMo |
|---|---|---|
| Number of conversations | Varies (S/M) | 50 |
| Questions | 500 | Varies |
| Avg. turns per conversation | -- | 304.9 |
| Avg. tokens per conversation | 115k (S), 1.5M (M) | 9,209.2 |
| Avg. sessions per conversation | ~50 (S), ~500 (M) | 19.3 |
| Max sessions | ~500 | 35 |
| Multimodal | No | Yes (images) |
| Core abilities tested | 5 (IE, MR, TR, KU, ABS) | Memory recall |
7.2 Evaluation Metrics
We use an LLM-as-a-judge approach to evaluate response quality (see the appendix for the complete judge prompt templates). For each test question, Hindsight generates a response using its memory retrieval and reflection pipeline. We then present both the generated response and the ground truth answer to a separate judge LLM, which scores the response on correctness and completeness.
我们使用 LLM 评判方法评估响应质量(完整的评判提示模板见附录)。 对于每个测试问题,Hindsight 使用其记忆检索与反思流水线生成响应。 然后,我们将生成的响应和真实答案一并交给独立的评判 LLM,由其对响应的正确性与完整性评分。
The judge assigns binary correctness scores (0 or 1) for factual accuracy, checking whether the response contains the correct information and does not introduce errors. For questions requiring multi-hop reasoning or temporal awareness, the judge also checks whether the response demonstrates appropriate use of retrieved memories and temporal context. For the abstention ability in LongMemEval, we measure whether Hindsight correctly declines to answer when information is missing, rather than guessing or hallucinating facts.
评判模型为事实准确性分配二元正确性分数(0 或 1),检查响应是否包含正确信息且未引入错误。 对于需要多跳推理或时间感知的问题,评判模型还会检查响应是否恰当地使用了检索记忆和时间语境。 对于 LongMemEval 中的拒答能力,我们衡量 Hindsight 能否在信息缺失时正确拒绝回答,而不是猜测或虚构事实。
7.3 Experimental Setup
We evaluate Hindsight using GPT-OSS-20b as the underlying LLM for both TEMPR's fact extraction and CARA's reflection operations. All experiments use the same model configuration to isolate the contribution of the memory architecture from model-specific improvements. For evaluation, we use GPT-OSS-120b as the judge LLM with temperature set to 0.0 to ensure consistent and deterministic scoring across all responses.
我们使用 GPT-OSS-20b 作为 TEMPR 事实提取与 CARA 反思操作的底层 LLM 来评估 Hindsight。 所有实验均使用相同的模型配置,以将记忆架构的贡献与模型特定改进区分开来。 在评估中,我们使用 GPT-OSS-120b 作为评判 LLM,并将温度设为 0.0,以确保所有响应的评分一致且确定。
During retention, we process each conversation session through TEMPR's extraction pipeline, which produces narrative facts, builds entity links, and updates the memory graph. For each test question, we retrieve memories using the four-way parallel recall mechanism (semantic, keyword, graph, temporal) with Reciprocal Rank Fusion and neural reranking. Retrieved memories are then passed to CARA's reflection step, which generates the final response conditioned on the bank's behavioral profile.
在保留期间,我们通过 TEMPR 的提取流水线处理每个对话会话,该流水线生成叙事事实、构建实体链接并更新记忆图。 对于每个测试问题,我们使用带有倒数排序融合和神经重排的四路并行回忆机制(语义、关键词、图、时间)检索记忆。 随后,检索到的记忆被传递给 CARA 的反思步骤,该步骤以记忆库的行为画像为条件生成最终响应。
We configure memory banks with neutral behavioral profiles (disposition parameters skepticism, literalism, and empathy all set to 3) and low bias strength (0.2) for these experiments, since the benchmarks test factual recall rather than preference-conditioned reasoning. This setup allows us to measure the core memory and retrieval capabilities without introducing strong opinion formation. Token budgets for retrieval are set to <add> tokens for LongMemEval and <add> tokens for LoCoMo, balancing coverage and context efficiency. These budgets are well within the context windows of modern LLMs while providing enough retrieved information for multi-hop reasoning.
由于这些基准测试事实回忆而非偏好条件推理,我们在实验中为记忆库配置中性行为画像(怀疑性、字面性和共情性三个性情参数均设为 3)和较低的偏置强度(0.2)。 这一设置使我们能够在不引入强烈观点形成的情况下衡量核心记忆与检索能力。 LongMemEval 的检索 token 预算设为 <add>,LoCoMo 的检索 token 预算设为 <add>,以平衡覆盖范围与上下文效率。 这些预算远低于现代 LLM 的上下文窗口,同时为多跳推理提供了足够的检索信息。
For the Hindsight (OSS-20B) configuration, both the memory stack (TEMPR and CARA) and the answer generation model are instantiated with GPT-OSS-20b. For the Hindsight (OSS-120B) and Hindsight (Gemini-3) configurations, the Hindsight memory system itself (fact extraction, memory graph construction, and retrieval) is powered by GPT-OSS-120b. The Hindsight (Gemini-3) rows in both benchmarks use Gemini-3 Pro only as the final answer generator over the retrieved memories, while the underlying memory architecture and the LLM-as-a-judge remain based on GPT-OSS-120b.
对于 Hindsight (OSS-20B) 配置,记忆栈(TEMPR 和 CARA)与答案生成模型均使用 GPT-OSS-20b 实例化。 对于 Hindsight (OSS-120B) 和 Hindsight (Gemini-3) 配置,Hindsight 记忆系统本身(事实提取、记忆图构建与检索)由 GPT-OSS-120b 驱动。 两个基准中的 Hindsight (Gemini-3) 行仅使用 Gemini-3 Pro 作为基于检索记忆的最终答案生成器,而底层记忆架构和 LLM 评判仍基于 GPT-OSS-120b。
Baseline results. We describe next how we benchmark Hindsight against existing approaches. For LongMemEval (Table 3), baseline scores for Full-context GPT-4o, Zep (GPT-4o), and the three Supermemory configurations (GPT-4o, GPT-5, Gemini-3 Pro) are taken directly from the Supermemory technical report and use their published GPT-4o LLM-as-a-judge setup. For LoCoMo (Table 4), baseline scores for Backboard, Memobase, Zep, Mem0, Mem0-Graph, LangMem, and OpenAI are presented here as claimed on the official Backboard LoCoMo benchmark results. We treat these numbers as reported reference points rather than our independently reproduced baselines.
**基线结果。**下面介绍我们如何将 Hindsight 与现有方法进行比较。 对于 LongMemEval(表 3),Full-context GPT-4o、Zep(GPT-4o)和三种 Supermemory 配置(GPT-4o、GPT-5、Gemini-3 Pro)的基线分数直接取自 Supermemory 技术报告,并使用其发布的 GPT-4o LLM 评判设置。 对于 LoCoMo(表 4),Backboard、Memobase、Zep、Mem0、Mem0-Graph、LangMem 和 OpenAI 的基线分数按照 Backboard 官方 LoCoMo 基准结果中的声明呈现。 我们将这些数字视为报告的参考点,而不是我们独立复现的基线。
Our Hindsight results on both benchmarks are evaluated with a GPT-OSS-120B LLM-as-a-judge for all methods to ensure consistent scoring; in the Gemini-3 configuration, Gemini-3 is used only for answer generation, while memory retrieval and judging remain powered by GPT-OSS-120B. Readers wishing to reproduce our results or re-evaluate Hindsight can download our code and re-run benchmarks as described in Section 8. We provide access to our Github repository and an interactive results viewer.
为了确保评分一致,我们在两个基准上对所有方法的 Hindsight 结果均使用 GPT-OSS-120B 作为 LLM 评判;在 Gemini-3 配置中,Gemini-3 仅用于答案生成,而记忆检索与评判仍由 GPT-OSS-120B 驱动。 希望复现我们的结果或重新评估 Hindsight 的读者可以下载代码,并按照第 8 节所述重新运行基准。 我们提供 GitHub 仓库和交互式结果查看器的访问入口。
7.4 Results on LongMemEval
| Question Type | Full-context | Full-context | Zep | Supermemory | Supermemory | Supermemory | Hindsight | Hindsight | Hindsight |
|---|---|---|---|---|---|---|---|---|---|
| (GPT-4o) | (OSS-20B) | (GPT-4o) | (GPT-4o) | (GPT-5) | (Gemini-3) | (OSS-20B) | (OSS-120B) | (Gemini-3) | |
| single-session-user | 81.4 | 38.6 | 92.9 | 97.1 | 97.1 | 98.6 | 95.7 | 100.0 | 97.1 |
| single-session-assistant | 94.6 | 80.4 | 80.4 | 96.4 | 100.0 | 98.2 | 94.6 | 98.2 | 96.4 |
| single-session-preference | 20.0 | 20.0 | 56.7 | 70.0 | 76.7 | 70.0 | 66.7 | 86.7 | 80.0 |
| knowledge-update | 78.2 | 60.3 | 83.3 | 88.5 | 87.2 | 89.7 | 84.6 | 92.3 | 94.9 |
| temporal-reasoning | 45.1 | 31.6 | 62.4 | 76.7 | 81.2 | 82.0 | 79.7 | 85.7 | 91.0 |
| multi-session | 44.3 | 21.1 | 57.9 | 71.4 | 75.2 | 76.7 | 79.7 | 81.2 | 87.2 |
| Overall | 60.2 | 39.0 | 71.2 | 81.6 | 84.6 | 85.2 | 83.6 | 89.0 | 91.4 |
Table 3 compares Hindsight to full-context baselines and prior memory systems on the LongMemEval S setting. The two Full-context baselines pass the entire conversation history to the model as raw context without any structured memory, while Zep and Supermemory pair dedicated memory layers with strong frontier models (GPT-4o, GPT-5, Gemini-3). In contrast, our primary configuration uses a smaller open-source 20B model (GPT-OSS-20B) for both retention and reflection, chosen to be deployable on a single high-end consumer GPU rather than only in large datacenter settings.
表 3比较了 Hindsight、完整上下文基线和先前记忆系统在 LongMemEval S 设置上的表现。 两个完整上下文基线将全部对话历史作为原始上下文传给模型,不使用任何结构化记忆;Zep 和 Supermemory 则将专用记忆层与强大的前沿模型(GPT-4o、GPT-5、Gemini-3)结合。 相比之下,我们的主要配置使用较小的开源 20B 模型(GPT-OSS-20B)同时执行保留与反思,选择该模型是为了能够部署在单张高端消费级 GPU 上,而不是只能用于大型数据中心环境。
Despite this weaker base model, Hindsight with OSS-20B achieves 83.6% overall accuracy, a +44.6 point gain over the Full-context OSS-20B baseline (39.0%), and even surpasses Full-context GPT-4o (60.2%). Relative to other memory systems, Hindsight+OSS-20B matches or exceeds the performance of Zep+GPT-4o (71.2%) and Supermemory+GPT-4o (81.6%), demonstrating that the memory architecture, rather than sheer model size, is carrying much of the performance. The largest gains over the Full-context OSS-20B baseline appear exactly in the long-horizon categories LongMemEval was designed to stress: multi-session questions improve from 21.1% to 79.7% and temporal reasoning from 31.6% to 79.7%, and preference questions increase from 20.0% to 66.7%, indicating that TEMPR’s graph- and time-aware retrieval substantially mitigates context dilution at scale.
尽管基础模型较弱,采用 OSS-20B 的 Hindsight 仍达到 83.6% 的总体准确率,比 Full-context OSS-20B 基线(39.0%)高 44.6 个百分点,甚至超过 Full-context GPT-4o(60.2%)。 相较其他记忆系统,Hindsight+OSS-20B 达到或超过 Zep+GPT-4o(71.2%)和 Supermemory+GPT-4o(81.6%)的性能,这表明主要性能来自记忆架构,而不仅仅是模型规模。 相较 Full-context OSS-20B 基线,最大的提升恰好出现在 LongMemEval 旨在强调的长程类别中:多会话问题从 21.1% 提升至 79.7%,时间推理从 31.6% 提升至 79.7%,偏好问题从 20.0% 提升至 66.7%;这表明 TEMPR 的图感知与时间感知检索在大规模场景中显著缓解了上下文稀释。
Scaling the underlying model further amplifies these gains. With OSS-120B, Hindsight reaches 89.0% overall accuracy, outperforming Supermemory with GPT-4o and GPT-5 (81.6% and 84.6%), and with Gemini-3 Pro it attains 91.4%, the best result across all systems and model backbones. Because the Full-context OSS-20B baseline uses the same base model as Hindsight but with no structured memory, the consistent improvements across all question types provide direct evidence that the memory layer drives the observed performance rather than frontier-scale parameters alone.
扩大底层模型会进一步放大这些收益。 使用 OSS-120B 时,Hindsight 的总体准确率达到 89.0%,超过采用 GPT-4o 和 GPT-5 的 Supermemory(81.6% 和 84.6%);使用 Gemini-3 Pro 时则达到 91.4%,取得所有系统与模型骨干中的最佳结果。 由于 Full-context OSS-20B 基线使用与 Hindsight 相同的基础模型但没有结构化记忆,因此所有问题类型上的一致提升直接证明,观察到的性能由记忆层驱动,而不只是来自前沿规模参数。
7.5 Results on LoCoMo
Table 4 reports accuracy on LoCoMo. Across all backbone sizes, Hindsight consistently outperforms prior open memory systems such as Memobase, Zep, Mem0, and LangMem, raising overall accuracy from 75.78% (Memobase) to 83.18% with OSS-20B and 85.67% with OSS-120B. With Gemini-3 as the answer generator, Hindsight attains 89.61% overall accuracy and the highest Open Domain score (95.12%), effectively matching Backboard’s claimed 90.00% overall performance while doing so with a fully open-source memory stack, released evaluation code, and an interactive results viewer (Section 8). These results show that the gains from our memory architecture on LongMemEval transfer to realistic, multi-session human conversations.
表 4报告了 LoCoMo 上的准确率。 在所有骨干规模下,Hindsight 始终优于 Memobase、Zep、Mem0 和 LangMem 等先前开源记忆系统;总体准确率从 Memobase 的 75.78% 提升至 OSS-20B 的 83.18% 和 OSS-120B 的 85.67%。 使用 Gemini-3 作为答案生成器时,Hindsight 的总体准确率达到 89.61%,并取得最高的开放域分数(95.12%);它使用完全开源的记忆栈、已发布的评估代码和交互式结果查看器(第 8 节),同时基本追平 Backboard 声称的 90.00% 总体性能。 这些结果表明,我们的记忆架构在 LongMemEval 上的收益能够迁移到真实的多会话人类对话中。
| Method | Single-Hop | Multi-Hop | Open Domain | Temporal | Overall |
|---|---|---|---|---|---|
| Backboard | 89.36 | 75.00 | 91.20 | 91.90 | 90.00 |
| Memobase (v0.0.37) | 70.92 | 46.88 | 77.17 | 85.05 | 75.78 |
| Zep | 74.11 | 66.04 | 67.71 | 79.79 | 75.14 |
| Mem0-Graph | 65.71 | 47.19 | 75.71 | 58.13 | 68.44 |
| Mem0 | 67.13 | 51.15 | 72.93 | 55.51 | 66.88 |
| LangMem | 62.23 | 47.92 | 71.12 | 23.43 | 58.10 |
| OpenAI | 63.79 | 42.92 | 62.29 | 21.71 | 52.90 |
| Hindsight (OSS-20B) | 74.11 | 64.58 | 90.96 | 76.32 | 83.18 |
| Hindsight (OSS-120B) | 76.79 | 62.50 | 93.68 | 79.44 | 85.67 |
| Hindsight (Gemini-3) | 86.17 | 70.83 | 95.12 | 83.80 | 89.61 |
8. Code Availability
We release our implementation of Hindsight at github.com/vectorize-io/hindsight. The repository provides (i) the full memory architecture, including retain/recall/reflect pipelines and the four-network memory representation; (ii) scripts and configuration files to run LongMemEval and LoCoMo with different backbones and judging setups; and (iii) utilities for fact extraction, graph construction, and analysis of retrieved memories. To facilitate inspection and comparison of runs, we also provide the Hindsight Benchmarks Viewer, which hosts per-question results that users can drill into, retrieved memory contexts, model and judge configurations, and aggregate metrics for all Hindsight variants reported in this paper.
我们在 github.com/vectorize-io/hindsight 发布 Hindsight 的实现。 该仓库提供:(i)完整记忆架构,包括保留/回忆/反思流水线和四网络记忆表示;(ii)使用不同骨干模型与评判设置运行 LongMemEval 和 LoCoMo 的脚本及配置文件;以及(iii)用于事实提取、图构建和检索记忆分析的工具。 为便于检查和比较不同运行,我们还提供 Hindsight 基准查看器,其中包含可逐题深入查看的结果、检索记忆上下文、模型与评判配置,以及本文报告的所有 Hindsight 变体的汇总指标。
9. Conclusion
We have introduced Hindsight, an approach to treat agent memory as a first-class substrate for reasoning, rather than a thin retrieval layer around a stateless model. By organizing an agent’s long-term memory into world, bank, observation, and opinion networks and implementing retain, recall, and reflect as explicit operations, the architecture separates evidence from synthesized summaries and beliefs while remaining compatible with modern LLMs. Our experimental results demonstrate that this structure matters in practice and clearly leads to significant improvements in performance.
我们提出了 Hindsight,它将智能体记忆视为推理的一等基底,而不是围绕无状态模型构建的薄检索层。 通过将智能体的长期记忆组织为世界网络、记忆库网络、观察网络和观点网络,并将保留、回忆与反思实现为显式操作,该架构在保持与现代 LLM 兼容的同时,将证据与合成摘要及信念分离。 我们的实验结果表明,这种结构在实践中十分重要,并且确实带来了显著的性能提升。
Looking ahead, we see several directions for extending this work. On the modeling side, learning to jointly optimize fact extraction, graph construction, and retrieval—rather than treating them as fixed pipelines—could further improve robustness and efficiency, especially in noisy, open-domain settings. A reinforcement learning loop would be ideal to explore the interplay between retain, recall, and reflect as done here.
展望未来,我们看到若干扩展本工作的方向。 在建模方面,学习联合优化事实提取、图构建和检索,而不是将它们视为固定流水线,能够进一步提升鲁棒性与效率,尤其是在嘈杂的开放域环境中。 强化学习循环将非常适合探索本文所实现的保留、回忆与反思之间的相互作用。
On the application side, we plan to integrate Hindsight with richer tool-use and workflow orchestration, exploring more diverse benchmarks than the conversational setting considered here. Finally, extending the opinion and belief layer to support controlled forgetting, time-aware belief revision, and privacy-aware memory management offers a path toward long-lived agents.
在应用方面,我们计划将 Hindsight 与更丰富的工具使用和工作流编排相结合,探索比本文所考虑的对话设置更为多样的基准。 最后,扩展观点与信念层以支持受控遗忘、时间感知信念修正和隐私感知记忆管理,为构建长期运行的智能体提供了一条路径。