Manuscript Offprint

arXiv:2610.21900

TEM: Temporal State Tracking Memory for Large Language Model Agents

Pengfeng Song, Yunkai Zhuang, Liye Shi

Abstract

An agent's memory must remain useful as information changes across conversations. A new fact may replace an earlier value without making that value irrelevant to a later question. We present Temporal State Tracking Memory (TEM), a training-free framework for tracking these changes. TEM stores facts as versioned records linked to their sources. It retrieves relevant versions, places them in source order and labels historical records before passing the evidence to the answer model. Event memory and original dialogue turns provide details missing from structured facts. We evaluated TEM on 420 questions drawn from 600 sessions involving 60 personas. Across four open-weight models, key-entity hit rates reached 75.71–97.62% overall and 96.67–100.00% on the historical-residence subset. Adding historical labels to otherwise identical, source-ordered facts increased overall hit rates by 17.14–55.95 percentage points. The evidence was compact: 94–118 tokens per answer, or 48.75–56.73% less than session-aware retrieval-augmented generation (RAG). A further evaluation on 1,540 LoCoMo questions tested hybrid memory under a fixed evidence budget. TEM exceeded session-aware RAG with both backbones; conservative score differences were 7.92 and 10.58 percentage points. The results support preserving fact versions and exposing their temporal status to the generator when answering questions about repeatedly updated information.

Keywords: large language model agents; long-term memory; temporal state tracking; fact versions; retrieval-augmented generation

1 Introduction

A long-term agent accumulates records that may no longer describe its user. Residence, occupation, employer and preferences can change several times across sessions [1−3][1-3]. Earlier records still matter when a question refers to the past. The agent therefore needs to know which version applies to the question, including whether the latest record is relevant at all.

Suppose a user moves from Shanghai to Chengdu and then to Suzhou. Suzhou answers “Where does the user live now?” The question “Where did the user live before moving to Chengdu?” requires Shanghai. A memory that keeps only the latest address cannot answer both. Keeping all three addresses makes the historical answer available, but the model still has to identify the right one.

Persistent memory, action feedback and experience-based reflection have extended agents' use of past interactions [4–6]. Work on hierarchical storage, memory updates, associative retrieval and temporal graphs has also improved access to this information [7–14]. Repeated updates pose a particular problem: several retrieved values may be equally relevant to a question yet refer to different states. We examine how the memory can convey these version relationships to the answering model.

TEM records cross-session changes as fact versions without retraining the backbone. New facts are appended, and the status of earlier records is updated from their source order. At query time, relevance scores select the evidence. TEM then orders the selected facts by source and labels historical versions. This separates evidence selection from the presentation of temporal information. Event memory and original turns supply details that the fact records do not capture.

Our contribution is a history-preserving update rule that assigns state over complete fact-version groups. The evidence construction procedure carries this status into retrieval output, so an older record stays historical when the latest version is not retrieved. We evaluate both components across multiple backbones and examine hybrid memory on public multi-session questions.

References (34)