ContextFact: Remembering Facts in Context for Long-Term Conversational Agents
Jiayu Huang, Yichao Cai, Xinyu Li, Zhen Zhang, Javen Qinfeng Shi
Abstract
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 of the evidence tokens consumed by the strongest evaluated baseline, obtaining overall judge accuracy on LoCoMo and 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.
Create a lesson
Related papers
LongCat Recall Sparse Attention: Co-Designing Key Organization and Retrieval for Long-Context Inference
Shared title terminology · Hao Zhang, Bin Xiao, Kefeng Zhang
Where Do Fact-Checking Errors Arise? Separating Retrieval, Search Control and Judgement in Evidence-Grounded Verification
Shared title terminology · Martin Pavlíček, Martin Kotyrba, Eva Volná et al.
Do More Roles or Larger Models Improve LLM Fact-Checking? A Controlled Study on Fixed Evidence
Shared title terminology · Martin Pavlíček, Martin Kotyrba, Eva Volná et al.
MERIT: Experience-Guided Memory for Long-Horizon Persona-Specific Persuasive Dialogue
Shared title terminology · Rohan Kirti, Akash Ghosh, Pratik Amrit et al.
Position-Skipped Distillation of Sparse-Attention Indexers: Train Short, Serve Long
Shared title terminology · Fu Dai, Haodi Quan, Kamal Taha
Detectable Epistemic Attack Layers: A Coverage Theorem and Standardized Harness for Conversation-History Integrity
Shared title terminology · Fahrell Giovanny, Geby Bayuningtyas, Sahrul Mukharom