Dual-Layer Agentic Memory with Fast Write Routing and Slow Consolidation

Wenzhi Li, Dong Nie, Rui Lan, Tongtong Lyu, Peiyao Wang, Lingzi Hong, Weihang Pan, Binbin Lin, Boyuan Pan, Yao HuarXiv 2026

TL;DR

Existing LLM memory systems suffer from "memory bloat" because they unconditionally append every new observation into external storage, degrading retrieval over time. Inspired by neuroscience, Dual-Layer Agentic Memory introduces a cost-aware model cascade that filters redundant information at the write phase and periodically consolidates high-value facts directly into the model's weights. This approach prunes up to 68% of redundant memory while retaining over 98% of downstream question-answering accuracy.

What Problem Does This Paper Address?

When LLM agents operate in long-horizon, dynamic environments (like personal assistants or autonomous research tools), knowledge constantly evolves. Traditional memory systems typically handle this using Retrieval-Augmented Generation (RAG), treating external databases as permanent, monotonically growing dumping grounds. Because filtering happens during the read phase, retrieval becomes slower, noisier, and more computationally expensive over time.

Conversely, directly updating model parameters via continuous learning or knowledge editing is computationally prohibitive and highly susceptible to catastrophic forgetting.

The authors argue that the core challenge is managing the knowledge lifecycle: deciding what to externalize, what to update, and what to ultimately internalize.

Figure 1: Comparison of agent memory paradigms. (a) Pure external memory: Monotonically appending facts to an external database often leads to memory bloat and degrades retrieval precision. (b) Pure parametric memory: Directly incorporating continuous updates into model weights is computationally expensive and susceptible to catastrophic forgetting. (c) Dual-Layer Agentic Memory (ours): We formulate memory as a knowledge lifecycle. A cost-aware cascade router (Fast Write Routing) filters incoming facts, escalating uncertain items to maintain a compact external memory. Retained external memories are periodically internalized via supervised fine-tuning (Slow Consolidation). This process updates the model’s parametric knowledge, shifting its epistemic boundaries to reduce future reliance on external memory.

Methods

The proposed Dual-Layer Agentic Memory framework mimics the Complementary Learning Systems (CLS) theory of the human brain, balancing a fast-learning "hippocampal" external buffer with a slower "cortical" parametric memory.

The architecture operates across two main phases:

  1. Fast Write Routing (Small-to-Large Cascade): When a new fact arrives, a lightweight router (built on a 1.7B parameter model) evaluates it using semantic and epistemic uncertainty features. Easy cases (e.g., highly redundant info) are discarded early. Ambiguous or highly novel facts trigger an escalation gate, passing the decision to a larger, more accurate router (an 8B model). The system makes a binary decision: write to external memory or discard.
  2. Slow Consolidation (Write-Back): Periodically, the system takes facts stored in the external memory and internalizes them into the 8B model's weights using Supervised Fine-Tuning (SFT). If a post-consolidation validation check shows the model can now answer questions about that fact without retrieval, the fact is successfully evicted from the external database.

Datasets

The authors constructed a new online streaming knowledge lifecycle benchmark derived from the Zero-Shot Relation Extraction (ZsRE) dataset.

Unlike static benchmarks that present facts and queries simultaneously, this streaming setup evaluates continuous memory management across 300 episodes. Each episode features 500 interleaved turns consisting of 100 candidate fact injections and downstream QA interactions. This setup forces the agent to make immediate write-vs-discard decisions prior to seeing associated queries, effectively decoupling write-time admission from read-time retrieval.

Key Insights and Ideas

  • Shifting Gating to the Write Phase: Filtering information at the point of entry completely circumvents the storage-performance trade-offs that plague traditional RAG systems.
  • Adaptive Epistemic Shift: The write router naturally senses when the underlying model has internalized knowledge. Once a fact is baked into the parameters via consolidation, its shifted internal representation prompts the router to automatically discard future encounters with that same fact.
  • The Necessity of the Dual-Layer Buffer: During consolidation, the authors observed a phenomenon called Parametric Interference, where updating weights to learn new facts caused the model to forget a small subset of previously stable facts. This highlights why a standalone parametric update model fails, and why a fast-routing external memory layer is required to act as a safety buffer to override newly induced parametric errors.

Key Results

The framework demonstrates exceptional efficiency gains without sacrificing task performance:

  • Memory Pruning: The 1.7B/8B cascade router successfully prunes up to 68% of redundant external memory.
  • Compute Savings: The cascade escalates fewer than 50% of incoming inputs to the larger 8B model, reducing routing inference costs by roughly 30% to 39%.
  • Accuracy Retention: Despite a drastically minimized external memory footprint, the system retains over 98.2% of the downstream QA Exact Match (EM) performance achieved by an exhaustive "store-everything" baseline.
  • Effective Internalization: After undergoing periodic consolidation, the required storage ratio dropped from 64.81% to just 32.08% because the model could answer queries zero-shot.
Figure 2: EM–storage Pareto frontiers for the main cascade configuration under escalation thresholds ρ ∈{0.4, 0.6}.

Limitations and Future Work

While the framework provides a principled approach to the knowledge lifecycle, the authors note several areas for improvement:

  • Internalization Latency: The offline SFT write-back phase introduces high compute costs and latency. Exploring parameter-efficient, continuous adaptation methods (like online LoRA) could tighten this loop.
  • Conflict Resolution: The current system treats the external buffer as a uniform dataset during consolidation, lacking a mechanism to resolve temporally conflicting updates (e.g., if a user changes their preference multiple times within one cycle).
  • Catastrophic Forgetting: Actively mitigating parametric interference during the write-back phase remains an open challenge that might require episodic replay or weight regularization techniques.

Summary updated

BibTeX
@misc{li2026dual,
  author = {Wenzhi Li and Dong Nie and Rui Lan and Tongtong Lyu and Peiyao Wang and Lingzi Hong and Weihang Pan and Binbin Lin and Boyuan Pan and Yao Hu},
  title = {{Dual-Layer Agentic Memory with Fast Write Routing and Slow Consolidation}},
  year = {2026},
  eprint = {2608.22215},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.22215},
}
Figure