Temporal Order Matters for Agentic Memory: Segment Trees for Long-Horizon Agents

Yifan Simon Liu, Liam Gallagher, Faeze Moradi Kalarde, Jiazhou Liang, Armin Toroghi, Scott SannerarXiv 2026

TL;DR

Existing tree-based memory systems for long-horizon conversational LLMs organize past interactions purely by topical similarity, ignoring when events actually happened. This paper introduces Segment Tree Memory (SEGTREEMEM), an architecture that structures conversation history as a temporally ordered segment tree to preserve chronological context. By updating memory along a "rightmost frontier" and using PageRank-style relevance propagation for retrieval, SEGTREEMEM improves LLM-judge accuracy by nearly 20% over non-temporal baselines.

What Problem Does This Paper Address?

Long-horizon conversational agents (like advanced personal assistants) need to maintain context over multi-turn, multi-session interactions. To do this efficiently, many state-of-the-art systems use tree-based memory structures to summarize and index past dialogues.

However, current tree-based methods (such as RAPTOR) rely heavily on semantic clustering. They group utterances based on topical similarity, completely ignoring temporal order. For example, if a user talks about their dog in January and again in June, a semantic tree might lump these conversations together under a single internal node. This breaks local contextual dependencies and risks retrieving contextually misaligned information. Furthermore, figuring out how to dynamically update a temporally ordered tree online as new utterances arrive—without rebuilding the entire tree from scratch—remains a major challenge.

Figure 1: Memory tree representations. Semantic trees may group non-consecutive utterances, ignoring temporal order (top), while SEGTREEMEM preserves temporal order by assigning each node a contiguous span of utterances (bottom).

Methods

The authors propose SEGTREEMEM, which models conversation history using a Segment Tree structure where leaf nodes are individual utterances and internal nodes represent contiguous, non-overlapping spans of time.

The architecture consists of two main components:

  1. Online Memory Construction via the Rightmost Frontier: When a new utterance arrives, SEGTREEMEM avoids a global tree rebuild by only evaluating nodes along the rightmost frontier—the path of active nodes whose intervals end at the current time step. A compatibility model (which can use Cosine Similarity, Pointwise LLM scoring, or Batch LLM ranking) decides whether the new utterance belongs to the current topic segment (merging it into the frontier) or represents a context shift (starting a new branch).
  2. Structure-Aware Score Propagation for Retrieval: Instead of treating tree nodes as independent candidates during retrieval, SEGTREEMEM uses a matrix-based, multi-hop propagation mechanism inspired by PageRank. It calculates initial semantic relevance scores for nodes and then propagates these signals across the tree structure using one of two policies:
  3. Top-down: Distributes relevance from parent summary nodes down to specific child utterances.
  4. Bottom-up: Propagates relevance from specific utterance matches up to their broader enclosing temporal summaries.

Datasets

The authors evaluated SEGTREEMEM across three long-horizon memory benchmarks:

  • LoCoMo: Features long-term conversational memory across multi-session dialogues, requiring the retrieval of specific facts, preferences, and events.
  • LongMemEval-MAB: An incremental dialogue setup where memory is built turn-by-turn and queried repeatedly.
  • RealMem: A benchmark evaluating memory-driven interactions based on evolving project states and user personas.

Key Insights and Ideas

  • Temporal Order is a Strong Prior for Coherence: The authors conducted a temporal permutation experiment, randomly swapping 30% of dialogue turns before building the memory tree. While this barely affected non-temporal clustering baselines, it caused a massive performance drop for SEGTREEMEM. This proves that SEGTREEMEM successfully exploits chronological structure to generate superior, highly fluent internal summaries.
  • Propagation Direction Controls Granularity: The choice between top-down and bottom-up retrieval propagation acts as a task-specific granularity dial. Top-down propagation works best for detail-oriented datasets (like LoCoMo) because it funnels attention toward specific, localized utterances. Bottom-up propagation shines in state-oriented datasets (like RealMem) because it helps the agent capture the broader project context surrounding a match.

Key Results

  • Superior Accuracy: SEGTREEMEM consistently outperformed flat retrieval (BM25, Dense RAG), graph-structured memory (Mem0, HippoRAG), and tree-structured baselines (RAPTOR, MemTree), boosting LLM-judge accuracy by up to 20% on the evaluated benchmarks.
  • Cost-Efficiency Tradeoff: While using a Batch LLM for online construction yields the highest accuracy, the Cosine Similarity variant requires zero LLM calls for frontier matching. This makes the Cosine variant 5× faster in construction latency and 10× cheaper in token usage while remaining highly competitive in final accuracy.

Limitations and Future Work

The authors note several areas for improvement:

  • Static Propagation Policies: The retrieval mechanism currently uses fixed propagation horizons and directions across all queries, whereas a query-dependent policy selection would be more optimal.
  • Text-Only Modality: The current system is designed purely for text dialogues. Extending this temporal segment tree approach to multimodal inputs, tool calls, and agent action traces is a crucial next step.
  • Long-Term Maintenance: For extremely long, multi-year deployments, the system will eventually require additional maintenance operations like local subtree rebuilding or periodic memory compression.

Summary updated

BibTeX
@misc{liu2026temporal,
  author = {Yifan Simon Liu and Liam Gallagher and Faeze Moradi Kalarde and Jiazhou Liang and Armin Toroghi and Scott Sanner},
  title = {{Temporal Order Matters for Agentic Memory: Segment Trees for Long-Horizon Agents}},
  year = {2026},
  eprint = {2606.04555},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.04555},
}
Figure