LazyMem: Retrieve Broadly, Construct Selectively for Efficient Long-Term Agent Memory

AuthorsJing Yu, Yibo Zhao, Jiaming Zhang, Xiang Li

arXiv 20262026

TL;DR

LazyMem defers all lossy memory construction to query time with overlapping window compression, reaching 0.85 LJ on LongMemEval using only 213 memory tokens.

SharePost on XLinkedIn

Read our summary here, or open the publisher PDF on the next tab.

THE PROBLEM

Long-term agents drown in noisy history even when evidence is sparse

Dialogue histories quickly exceed the context window, and useful evidence is sparse and scattered across verbose conversations, making retrieval difficult.

When agents broaden recall to improve coverage, they flood downstream reasoning with noise, while write-time compression irreversibly discards details future queries may need.

HOW IT WORKS

LazyMem: Retrieve broadly, construct selectively at query time

LazyMem’s core mechanism chains Hybrid Retrieval, History Windowing, and a lightweight Memory-Processing Model to build query-conditioned compact memory.

You can think of LazyMem like disk plus RAM: all raw conversations stay on disk, and only query-relevant slices are loaded and compressed into a small RAM-like context.

This design lets LazyMem retrieve broadly for coverage but surface only compressed, useful evidence, avoiding permanent write-time loss that a plain context window cannot prevent.

DIAGRAM

LazyMem query-time memory construction flow

This diagram shows how LazyMem turns retrieved raw messages into compact, query-conditioned memory via overlapping windows and KEEP DROP decisions.

DIAGRAM

LazyMem training pipeline with SFT and GRPO

This diagram shows how LazyMem trains its memory-processing model using teacher supervision and group-based reinforcement learning with action and quality rewards.

PROCESS

How LazyMem Handles a Query over Long Conversation History

  1. 01

    Retrieve broadly

    LazyMem runs Hybrid Retrieval with dense and BM25 retrievers plus Reciprocal Rank Fusion and a cross-encoder reranker to build a high-recall candidate pool Rq of up to 50 messages.

  2. 02

    History windowing

    LazyMem applies History Windowing, expanding each retrieved hit with w neighboring messages, merging overlaps, and splitting long spans into overlapping sub-windows capped at L messages.

  3. 03

    Query-conditioned memory construction

    For each window, the Memory-Processing Model predicts KEEP DROP per message and rewrites kept messages into compressed, query-relevant content, then deduplicates across overlapping windows.

  4. 04

    Answer generation

    LazyMem concatenates compressions into compact memory mq and feeds mq plus the query to the Answer Model, which produces the final prediction under a fixed reasoning prompt.

KEY CONTRIBUTIONS

Key Contributions

  • 01

    Lazy retrieve-then-construct memory system

    LazyMem preserves raw interactions, retrieves broadly at query time, and constructs compact evidence via overlapping windows, avoiding irreversible write-time loss while bounding context length and latency.

  • 02

    4B memory-processing model with SFT plus GRPO

    LazyMem trains a 4B Memory-Processing Model using supervised fine-tuning and format-gated GRPO with action and quality rewards, boosting LongMemEval LJ from 0.41 to 0.85.

  • 03

    Efficient long-term memory with strong generalization

    LazyMem-4B reaches 0.85 LJ on LongMemEval using 213 memory tokens and 0.68 LJ on LoCoMo without target-domain training, reducing answer-context tokens by 68.7× versus RAG Top50.

RESULTS

By the Numbers

LongMemEval LJ

0.85 score

+0.03 over StructMem

LoCoMo LJ

0.68 score

+0.11 over NanoMemory

Answer-context memory tokens

213 tokens

21.0× fewer than StructMem

Latency on LongMemEval

40.86 s

14.49 s faster than NanoMemory

On LongMemEval, which tests multi-session and temporal reasoning over long histories, LazyMem-4B attains 0.85 LLM-judge accuracy with only 213 answer-context memory tokens. On LoCoMo, which stresses multi-hop and temporal memory, LazyMem-4B reaches 0.68 LJ without target-domain training, showing that query-time construction scales beyond its training corpus.

BENCHMARK

By the Numbers

On LongMemEval, which tests multi-session and temporal reasoning over long histories, LazyMem-4B attains 0.85 LLM-judge accuracy with only 213 answer-context memory tokens. On LoCoMo, which stresses multi-hop and temporal memory, LazyMem-4B reaches 0.68 LJ without target-domain training, showing that query-time construction scales beyond its training corpus.

BENCHMARK

LongMemEval overall LLM-judge accuracy comparison

Overall LLM-judge accuracy (LJ) on the LongMemEval test split.

BENCHMARK

LoCoMo overall LLM-judge accuracy comparison

Overall LLM-judge accuracy (LJ) on LoCoMo categories 1–4 from the last two conversations.

KEY INSIGHT

The Counterintuitive Finding

LazyMem-4B, a 4B memory-processing model, matches or beats several systems that use Qwen3-32B for memory, reaching 0.85 LJ on LongMemEval.

This is surprising because builders often assume larger memory models are necessary for high-quality selection and compression, yet LazyMem shows training and architecture can offset scale.

WHY IT MATTERS

What this unlocks for the field

LazyMem unlocks long-term agents that can safely store raw histories and still answer queries using small, high-utility memory slices at inference time.

Builders can now design agents that retrieve broadly, construct selectively, and keep latency and context budgets manageable without sacrificing multi-session reasoning quality.

~12 min read← Back to papers

Related papers

BenchmarkAgent Memory

Active Context Compression: Autonomous Memory Management in LLM Agents

Nikhil Verma

· 2026

Focus Agent adds start_focus, complete_focus, a persistent Knowledge block, and an optimized Persistent Bash plus String-Replace Editor scaffold to actively compress context during long software-engineering tasks. On five hard SWE-bench Lite instances against a Baseline ReAct agent, Focus Agent achieves 22.7% token reduction (14.9M → 11.5M) while matching 3/5 = 60% task success.

Agent Memory

ActMem: Bridging the Gap Between Memory Retrieval and Reasoning in LLM Agents

Xiaohui Zhang, Zequn Sun et al.

· 2026

ActMem transforms dialogue history into atomic facts via Memory Fact Extraction, groups them with Fact Clustering, links them through a Memory KG Construction module, and uses Counterfactual-based Retrieval and Reasoning for action-aware answers. On ActMemEval, ActMem reaches 76.52% QA accuracy with DeepSeek-V3, beating LightMem’s 63.97% by 12.55 points and NaiveRAG’s 61.54%.

Questions about this paper?

Paper: LazyMem: Retrieve Broadly, Construct Selectively for Efficient Long-Term Agent Memory

Answers use this explainer on Memory Papers.

Checking…