RoutePrism: Tracing Construction Order Effects in Agent Memory

Dong Xu, Zhangfan Yang, Jiantao Wu, Shipeng Zhang, Zexuan Zhu, Jiangqiang Li, Jun Zhang, Junkai JiarXiv 2026

This paper introduces RoutePrism, a diagnostic protocol designed to uncover a hidden vulnerability in AI agents: construction order effects. While we often evaluate agents based on their final answers, this research demonstrates that the sequence in which an agent processes its history can fundamentally alter what it remembers and, consequently, how accurately it performs.

TL;DR

RoutePrism reveals that simply reordering the input history of an AI agent can cause it to discard critical evidence, leading to massive accuracy drops that standard benchmarks fail to diagnose. By building memory twice in different orders and using a "support-restoration" intervention, the authors show that restoring a single displaced record can recover over 60 percentage points of lost accuracy.

What Problem Does This Paper Address?

As LLM-based agents handle longer interactions, they rely on memory systems (like MemGPT or MemoryBank) to select, summarize, or discard information to fit within fixed context windows. However, these memory "policies" are often sensitive to the order of arrival.

The authors identify a major gap in current evaluation: endpoint accuracy is a "conflated" metric. A single accuracy score mixes together source selection, context compilation, and the model's own sampling noise. If an agent fails, we don't know if it's because the memory policy threw away the right data, the context was poorly formatted, or the model just made a random error. RoutePrism disentangles these factors to show how the "construction path" itself creates failure modes.

Methods

The RoutePrism protocol operates in four distinct stages, as illustrated in the overview below:

Figure 1: RoutePrism overview. Given a question and its source pool, we build memory in two processing orders, record which sources and contexts differ, and test whether the displaced evidence matters via a four-condition support-restoration intervention. The protocol isolates construction-order effects from answer-model noise.
  1. Task-Preserving Eligibility: The researchers first ensure that the full pool of data actually contains the answer, regardless of order, using human and model-based audits.
  2. Paired Memory Construction: Memory is built twice from the same data pool: once in Forward (chronological) order and once in Replay (reversed) order. Everything else—the policy, the model, and the budget—remains identical.
  3. Observable Diagnostics: They measure three coordinates:
  4. Source Overlap ($J$): How much of the same raw data survived in both versions?
  5. Answer Disagreement ($H$): Did the two versions produce different answers?
  6. Correctness Change ($\Delta$): Did one order perform better than the other?
  7. Support Intervention: This is the core "stress test." If reordering caused a specific piece of evidence to be discarded, the researchers perform a four-condition test:
  8. Support Present ($S^+$): The original state.
  9. Support Absent ($S^-$): The state after reordering lost the evidence.
  10. Restored (Res.): Manually putting the lost record back in.
  11. Replacement (Pl.): Putting a random, non-supporting record of the same length back in.

Datasets

The protocol was evaluated on two major benchmarks:

  • PersonaMem-32K: A dataset of simulated user-assistant conversations where the agent must recall specific facts about a user's profile. It features short histories (4–7 records).
  • LongMemEval-S: A benchmark with significantly longer native histories (38–62 sessions), used to test if these order effects persist as the "memory" grows more complex.

Key Insights and Ideas

  • Survivor Selection is the Primary Driver: In policies that cluster similar information (compaction), the rule for which record to keep (e.g., "keep the most recent") is the main point of failure. Reversing the order changes which record is deemed "most recent" in a cluster, often discarding the only record that actually answers the question.
  • Distinct "Failure Signatures": Different memory architectures fail at different layers. Summarization-based policies (like MemoChat) might keep the same source IDs but change the content of the summary. Metadata-based policies (like A-MEM) might experience "metadata drift" where internal tags change even if the prompt looks the same.
  • Accuracy Hides Evidence Loss: A model can sometimes guess the right answer even if the evidence is missing, or a gain on one question can mask a loss on another. RoutePrism’s paired-path approach exposes these hidden instabilities.

Key Results

The most striking result comes from the support-restoration intervention. As shown in the figure below, the difference between having the right evidence and a random "placebo" record is night and day.

Figure 2: Support restoration (a–c) and state reuse (d). S+, Res., S−, and Pl. denote support present, rescue, support absent, and matched non-support replacement. Contrasts compare against S−. Panel (d) uses repeated answers, with Hin = Hwithin. The full route profiles are in Appendix I.3.
  • 60%+ Accuracy Recovery: Under both compaction and bounded recency policies, restoring the single record displaced by reordering recovered over 60 percentage points of accuracy.
  • Extreme Sensitivity: For the "focal compactor" policy, reversing the processing order resulted in a Jaccard similarity (source overlap) of only 0.057—meaning the two memory states were almost entirely different despite coming from the same data.
  • Cross-Model Robustness: These effects were consistent across five different LLMs (Astra, Sol, Terra, Luna, and Qwen3-8B), proving that the issue lies in the memory construction logic, not just the quirks of a specific model.

Limitations and Future Work

  • Scope of Support: The current study focuses primarily on "single-record support-loss" cases—where one specific record holds the key. Future work is needed to see how order affects "multi-hop" reasoning where evidence is spread across many records.
  • Short Histories: While LongMemEval-S was used, many agentic workflows involve even longer, more fluid histories than the 60 sessions tested here.
  • Stochasticity: The paper assumes a deterministic processing order. In production systems with concurrent processing, the order might be truly random, making these "failure signatures" even harder to pin down without a protocol like RoutePrism.

Summary updated

Abstract

Processing the same records in a different order can discard different evidence, yet endpoint accuracy alone cannot reveal what changed or whether it mattered. We introduce RoutePrism, a diagnostic protocol that builds memory twice from the same source pool in two processing orders, then traces which sources, compiled contexts, and answers differ. Because record content, timestamps, policy, and the answer model all stay fixed, any observed difference is localized to the memory construction step. A matched four-condition intervention tests whether a record displaced by reordering actually carried task-relevant evidence: restoring that single record recovers over 60 percentage points of lost accuracy, while substituting a non-supporting record of equal length does not. We evaluate the protocol on PersonaMem-32K (63 primary queries, 29 users) and 470 LongMemEval-S questions with histories spanning 38 to 62 sessions, replicating the core intervention across five answer models. Survivor selection, defined as the choice of which record a cluster retains, drives most source-level changes, while different memory policies (compaction, bounded recency, MemoChat-style summarization, A-MEM) produce distinct failure signatures at the source, context, and metadata layers.
BibTeX
@misc{xu2026routeprism,
  author = {Dong Xu and Zhangfan Yang and Jiantao Wu and Shipeng Zhang and Zexuan Zhu and Jiangqiang Li and Jun Zhang and Junkai Ji},
  title = {{RoutePrism: Tracing Construction Order Effects in Agent Memory}},
  year = {2026},
  eprint = {2609.34160},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.34160},
}
Figure