ContextFact:让长期对话智能体按上下文记住事实
ContextFact: Remembering Facts in Context for Long-Term Conversational Agents
长期对话里事实散落各轮,检索时缺上下文就答不准。ContextFact 把事实和实体两条线分开存,token 用量只有最强基线的 21%,LoCoMo 准确率 86.49%。做聊天记忆、客服智能体的开发者可以看看它的检索和重排设计。
论文提出 ContextFact,一种面向长期对话智能体的记忆构建与检索方法,基于 Qwen3.5-27B 骨干模型,在 LoCoMo 上取得 86.49% 的整体 judge 准确率,在 LongMemEval-S 上达到 91.00%,同时只消耗最强基线 21% 的证据 token。作者首先分析了记忆构建和检索单元边界对答案可答性与证据获取的影响,发现仅靠检索选择无法弥补通读整个记忆库时暴露的上下文缺口,说明部分上下文必须在记忆构建阶段保留。
方法上,ContextFact 将保留上下文的事实记忆与源文本锚定的实体表示链接起来:会话内为每条事实收集解读所需的局部上下文;跨会话对齐重复出现的指称对象,并回访源对话重建连贯的实体表示。查询时分别检索事实视图与实体视图并独立重排,再通过实体链接扩展找出相关事实,完整的实体表示提供有组织的跨会话证据。
消融实验支持保留上下文的事实边界划分和源文本锚定的实体重建两个设计,实体读取(entity readout)能提升多跳准确率,效果超出单纯增加事实数量的做法。相邻轮次分组在相同唯一轮次预算下改善证据获取,更宽的窗口则没有稳定收益。
ContextFact: Remembering Facts in Context for Long-Term Conversational Agents
Agents built on large language models must maintain continuity across repeated interactions with users. However, long-term conversations scatter facts across turns and sessions, making it difficult to retrieve the right evidence with enough context. Memory for such conversations must therefore preserve facts with their context while keeping evidence selectively accessible. We first study how memory construction and retrieval-unit boundaries affect answerability and evidence access. Reading the entire memory bank reveals gaps that cannot be resolved by retrieval selection alone, showing that some context must be preserved during memory construction. Adjacent-turn grouping improves evidence access at matched unique-turn budgets, while wider windows do not consistently help. This motivates keeping fact-specific context local while organizing cross-session evidence separately. We propose ContextFact, which links context-preserving fact memories with source-grounded entity representations. Within sessions, it gathers the context needed to interpret each fact. Across sessions, it aligns recurring referents and revisits the source dialogue to reconstruct coherent entity representations linked to the supporting facts. At query time, ContextFact retrieves fact and entity views, reranks them independently, and uses entity-linked expansion to surface related facts; complete entity representations then provide organized cross-session evidence. With Qwen3.5-27B as the backbone, ContextFact achieves state-of-the-art performance while using only $21\%$ of the evidence tokens consumed by the strongest evaluated baseline, obtaining $86.49\%$ overall judge accuracy on LoCoMo and $91.00\%$ on LongMemEval-S. Controlled ablations support context-preserving fact boundaries and source-grounded entity reconstruction, while entity readout improves multi-hop accuracy beyond adding more facts.
This report is categorized under AITOP's "Papers" desk. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include ContextFact, LoCoMo, LongMemEval, Qwen3.5.
Source attribution: curated from arXiv cs.AI (@Jiayu Huang, Yichao Cai, Xinyu Li, Zhen Zhang, Javen Qinfeng Shi).