MemRefine: LLM-Guided Compression for Long-Term Agent Memory

Minjae Kim, Jinheon Baek, Soyeong Jeong, Sung Ju HwangarXiv 2026

TL;DR

As large language model (LLM) agents engage in long-term interactions, their memory stores grow uncontrollably, inflating storage costs and degrading retrieval performance. This paper introduces MemRefine, a post-construction memory compression framework that uses embedding similarity to surface related memories and an LLM judge to delete, merge, or preserve them. MemRefine successfully keeps memory within hard storage budgets while maintaining—and sometimes even improving—downstream task performance.

What Problem Does This Paper Address?

Long-term LLM agents rely on persistent memory stores to retain past context across extended conversations or sessions. However, over time, these stores grow without bound, filling up with redundant, overlapping, or low-value information. This causes two major issues: skyrocketing storage costs (a critical bottleneck for resource-constrained or on-device deployments) and degraded retrieval performance because near-duplicate entries crowd out the most useful evidence.

Existing compression techniques typically summarize raw text before it enters memory or compress context at inference time. They do not address how to shrink an already established, post-construction memory store down to a strict, predefined storage budget while preserving factual integrity.

Conventional vs. Budgeted Memory Management

Methods

The authors propose MemRefine, a query-agnostic framework that operates as an offline maintenance module between memory construction and retrieval.

Instead of scoring and deleting entries independently (which fails because memory value is relational), MemRefine uses an iterative, pairwise refinement approach:

  1. Candidate Pair Selection: It uses a lightweight embedding model (all-MiniLM-L6-v2) to find the most semantically similar pair of memories that haven't been evaluated yet.
  2. LLM-Guided Action: An LLM judge evaluates the pair based on factual content rather than surface-level wording. The judge chooses one of three actions:
  3. DELETE: Removes one node if it is entirely redundant.
  4. MERGE: Combines complementary facts into a single, concise entry via a separate merge LLM.
  5. PRESERVE: Keeps both entries intact if they contain distinct, important facts.
  6. Iterative Update: The store is updated, and the process repeats until the memory footprint fits the target storage budget.
Figure 2: Overview of the MEMREFINE pipeline. Given an already constructed memory store, MEMREFINE proposes semantically similar memory pairs and lets an LLM judge delete redundant, merge complementary, or preserve distinct memories, iterating until the store meets the storage budget.

Datasets

The framework was evaluated across multiple benchmarks and memory structures:

  • LoCoMo: A long-term conversational memory benchmark spanning five question categories (single-hop, multi-hop, temporal, open-ended, and counterfactual).
  • Scaled LoCoMo (3x and 10x): Synthetically generated datasets with up to 10 times longer conversations to stress-test compression under high redundancy and topic recurrence.
  • LongMemEvalS: A benchmark evaluating chat assistants across six distinct long-term memory interaction types.
  • Memory Frameworks: Tested on both graph-structured memory (A-MEM) and an ingestion-update pipeline (Mem0).

Key Insights and Ideas

  • Similarity is a proposal mechanism, not a decision-maker: High embedding similarity can mean two things are identical (redundant), complementary, or just topically related. Standard rule-based thresholds fail because they can't differentiate these cases. Deferring the final decision to an LLM judge prevents the accidental deletion of distinct but topically similar facts.
  • Compression can actually improve retrieval: For localized question types (like single-hop factual recall or temporal reasoning), moderate compression boosts accuracy. Cleaning out the clutter and merging fragmented memories makes the retriever's job easier and less noisy.
  • Graceful degradation over collapse: Under aggressive compression budgets (e.g., cutting memory down to 30%), MemRefine degrades gracefully rather than suffering a catastrophic drop in utility, making it highly predictable for production systems.

Key Results

  • On the standard LoCoMo benchmark, MemRefine compressed memory stores down to 50% or 40% of their original size with virtually no drop in downstream F1 score.
  • It significantly outperformed rule-based baselines (like RULESIM and RULEPR) under tight budgets, where factual reasoning becomes critical.
  • When scaling up to 10x longer conversations, MemRefine maintained a smooth storage-utility trade-off curve.
  • Stronger LLM judges (like GPT-5-mini vs. Qwen3-8B) showed a widening performance advantage as the storage budget became tighter, proving that advanced reasoning is essential for aggressive compression.

Limitations and Future Work

  • Scope of Memory Architectures: The evaluation was limited to two conversational memory frameworks (A-MEM and Mem0). Future work needs to explore how post-construction compression handles multi-agent systems or tool-use environments.
  • Synthetic Data: The long-context stress tests (3x and 10x datasets) relied on synthetically generated dialogues. Validating MemRefine on real-world, long-term longitudinal user logs remains an open next step.
  • Privacy and Security: Because MemRefine permanently deletes or merges data, deploying it in production requires careful integration with soft-deletion or audit logging mechanisms to ensure data maintenance decisions are reviewable and respect user privacy.

Summary updated

BibTeX
@misc{kim2026memrefine,
  author = {Minjae Kim and Jinheon Baek and Soyeong Jeong and Sung Ju Hwang},
  title = {{MemRefine: LLM-Guided Compression for Long-Term Agent Memory}},
  year = {2026},
  eprint = {2606.13177},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.13177},
}

Loading related content...

Figure