On Memory Construction and Retrieval for Personalized Conversational Agents

Zhuoshi Pan, Qianhui Wu, Huiqiang Jiang, Xufang Luo, Hao Cheng, Dongsheng Li, Yuqing Yang, Chin-Yew Lin, H. Vicky Zhao, Lili Qiu, Jianfeng GaoarXiv 2025 · DOI

Abstract

As conversational agents handle increasingly long-term interactions, managing "memory" becomes a critical bottleneck. Traditional approaches—storing every turn, entire sessions, or lossy summaries—often fail to balance context and relevance. This paper introduces SECOM (Conversation SEgmentation + COMpression), a framework that partitions histories into topically coherent segments and applies prompt compression as a denoising mechanism. Our results demonstrate that SECOM significantly enhances retrieval accuracy and response quality, outperforming standard memory architectures.

Introduction

Large Language Models (LLMs) are increasingly used for long-term personalized assistants. However, the "memory" of these agents is often limited by context windows or inefficient retrieval. Current systems typically fall into three categories:

  1. Turn-level storage: Fragmented and lacks sufficient context for effective retrieval.
  2. Session-level storage: Noisy, often containing multiple unrelated topics that distract the model.
  3. Summarization: Condenses history but loses fine-grained details necessary for precise answers.

The authors identify a "Goldilocks" problem: memory units must be large enough to be semantically meaningful but small enough to remain relevant. SECOM addresses this by optimizing the granularity of stored information.

Methodology: The SECOM Framework

SECOM introduces two primary innovations to refine memory construction:

Topical Segmentation

Instead of arbitrary fixed-length chunks, SECOM partitions conversations into "segments" based on topic shifts. This ensures each memory unit is a self-contained semantic block. The framework utilizes a zero-shot approach with a reflection mechanism: the model analyzes its own segmentation errors against ground-truth data to iteratively refine a "segmentation rubric," effectively learning complex linguistic boundaries without extensive supervised training.

Compression-based Denoising

Natural language contains inherent redundancy that can act as "noise" for retrieval algorithms. SECOM processes segments using LLMLingua-2, a prompt compression method. By stripping away redundant tokens, the framework increases the semantic similarity between a user's query and the relevant history while decreasing similarity with irrelevant parts.

Overview of the SECOM framework illustrating topical segmentation and compression-based denoising for improved memory retrieval.

Experimental Evaluation

The framework was evaluated on several benchmarks, including LOCOMO (averaging 300 turns/9K tokens) and Long-MT-Bench+. Segmentation accuracy was further validated on datasets like DialSeg711 and SuperDialSeg.

Results and Key Insights

Granularity and Retrieval Performance

The study confirms that segment-level memory strikes the optimal balance. As shown in the comparative analysis of retrieval metrics, segment-level memory consistently provides higher Discounted Cumulative Gain (DCG) compared to turn-level or session-level approaches.

Comparison of Discounted Cumulative Gain (DCG) across different memory granularities, showing the superiority of segment-level memory.

The Denoising Effect

A key finding is that "losing" information through compression actually aids retrieval. By removing linguistic "fluff," the core semantic signal becomes clearer to embedding models. Removing this denoising step resulted in a performance drop of up to 9.46 points on the LOCOMO benchmark.

Conclusion

SECOM demonstrates that effective memory for conversational agents is not just about capacity, but about the quality and granularity of stored information. By combining topical segmentation with compression-based denoising, SECOM achieves state-of-the-art performance in long-term dialogue management. Future work will explore joint optimization of the retriever and compressor to further minimize noise in AI memory systems.

Summary updated

BibTeX
@misc{pan2025memory,
  author = {Zhuoshi Pan and Qianhui Wu and Huiqiang Jiang and Xufang Luo and Hao Cheng and Dongsheng Li and Yuqing Yang and Chin-Yew Lin and H. Vicky Zhao and Lili Qiu and Jianfeng Gao},
  title = {{On Memory Construction and Retrieval for Personalized Conversational Agents}},
  year = {2025},
  eprint = {2502.05589},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.05589},
}
Figure