Memory OS of AI Agent
Paper · 2025 · Jiazheng Kang, Mingming Ji, Zhe Zhao et al.
Summary
LLM-based agents lose track of earlier exchanges because their context window has a fixed size. This hurts factual consistency and personalization in long, multi-session dialogues. Prior memory approaches, such as A-Mem, MemoryBank and MemGPT, each address only one aspect: how knowledge is structured, how it is retrieved, or how context is controlled.
Kang et al. borrow segment-paging ideas from operating systems to build MemoryOS, a single framework that handles memory storage, updating, retrieval and response generation. Memory sits in three tiers:
- short-term memory, which keeps recent dialogue pages linked into chains;
- mid-term memory, which groups pages into topic segments;
- long-term personal memory, which holds user and agent personas.
Pages move from the short-term to the mid-term tier in FIFO order. A heat score then decides which segments are promoted into the persona store and which are evicted.
On the LoCoMo benchmark with GPT-4o-mini, MemoryOS outperforms baselines by roughly 49% F1 and 46% BLEU-1 on average. It also needs fewer LLM calls and tokens than the strongest competitors. This makes it a practical, open-source option for coherent, personalized long-term agents.
Key points
- Architecture: three storage tiers (STM, MTM, LPM) and four modules (Storage, Updating, Retrieval, Generation).
- Each STM page records a query, a response and a timestamp, plus an LLM-generated chain summary.
- MTM assigns pages to segments by adding cosine embedding similarity and keyword Jaccard similarity, then comparing the sum to a threshold θ.
- Main result: on LoCoMo with GPT-4o-mini, average gains over baselines are 49.11% in F1 and 46.18% in BLEU-1.
- Efficiency: about 4.9 LLM calls per response versus 13 for A-Mem*, and about 3,874 tokens versus 16,977 for MemGPT.
- Ablation and tuning:
- Removing MTM causes the largest performance drop, followed by LPM; the dialogue chain contributes least.
- Retrieving k = 10 MTM pages balances quality against cost, since gains level off at larger k.
- Code: released at github.com/BAI-LAB/MemoryOS. The authors note that capacity settings are chosen empirically and that redundant topic segments are not yet merged.
Institutions
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 works
Cite
Cite as Jiazheng Kang, Mingming Ji, Zhe Zhao and Ting Bai. 2025. Memory OS of AI Agent. Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing.
@inproceedings{kang2025memory,
title = {{Memory OS of AI Agent}},
author = {Jiazheng Kang, Mingming Ji, Zhe Zhao and Ting Bai},
booktitle = {Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing},
year = {2025},
doi = {10.18653/v1/2025.emnlp-main.1318},
url = {https://doi.org/10.18653/v1/2025.emnlp-main.1318}
}References
- André Bensoussan, C. T. Clingen, and R. C. Daley. 1972. The multics virtual memory: Concepts and design. Communications of the ACM, 15(5):308– 318. find
- Weijie Chen, Ting Bai, Jinbo Su, Jian Luan, Wei Liu, and Chuan Shi. 2024. Kg-retriever: Efficient knowledge indexing for retrieval-augmented large language models. arXiv preprint arXiv:2412.05547. — [arXiv:2412.05547](https://arxiv.org/abs/2412.05547) find
- Prateek Chhikara, Dev Khant, Saket Aryan, Taranjeet Singh, and Deshraj Yadav. 2025. Mem0: Building production-ready ai agents with scalable long-term memory. arXiv preprint arXiv:2504.19413.
- Peter J. Denning. 1970. Virtual memory. ACM Computing Surveys, 2(3):153–189. find
- Yiming Du, Wenyu Huang, Danna Zheng, Zhaowei Wang, Sebastien Montella, Mirella Lapata, Kam-Fai Wong, and Jeff Z Pan. 2025. Rethinking memory in ai: Taxonomy, operations, topics, and future directions. arXiv preprint arXiv:2505.00675. — [arXiv:2505.00675](https://arxiv.org/abs/2505.00675) find
- Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang, Xiao Bi, and 1 others. 2025. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning. arXiv preprint arXiv:2501.12948.
- Le Huang, Hengzhi Lan, Zijun Sun, Chuan Shi, and Ting Bai. 2024. Emotional rag: Enhancing role-playing agents through emotional retrieval. In 2024 IEEE International Conference on Knowledge Graph (ICKG), pages 120–127. find
- Hao Li, Chenghao Yang, An Zhang, Yang Deng, Xiang Wang, and Tat-Seng Chua. 2024. Hello again! llm-powered personalized agent for long-term dialogue. arXiv preprint arXiv:2406.05925.
- Jia-Nan Li, Jian Guan, Songhao Wu, Wei Wu, and Rui Yan. 2025. From 1,000,000 users to every user: Scaling up personalized preference for user-level alignment. Preprint, arXiv:2503.15463. find
- Lei Liu, Xiaoyan Yang, Yue Shen, Binbin Hu, Zhiqiang Zhang, Jinjie Gu, and Guannan Zhang. 2023. Think-in-memory: Recalling and post-thinking enable llms with long-term memory. arXiv preprint arXiv:2311.08719. — [arXiv:2311.08719](https://arxiv.org/abs/2311.08719) find
- Adyasha Maharana, Dong-Ho Lee, Sergey Tulyakov, Mohit Bansal, Francesco Barbieri, and Yuwei Fang. 2024. Evaluating very long-term conversational memory of LLM agents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 13851–13870… find
- Felix Ocker, Jörg Deigmöller, Pavel Smirnov, and Julian Eggert. 2025. A grounded memory system for smart personal assistants. Preprint, arXiv:2505.06328. — [arXiv:2505.06328](https://arxiv.org/abs/2505.06328) find
- Charles Packer, Vivian Fang, Shishir_G Patil, Kevin Lin, Sarah Wooders, and Joseph_E Gonzalez. 2023. Memgpt: Towards llms as operating systems. find
- Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting of the Association for Computational Linguistics, pages 311–318.
- Joon Sung Park, Joseph O’Brien, Carrie Jun Cai, Meredith Ringel Morris, Percy Liang, and Michael S Bernstein. 2023. Generative agents: Interactive simulacra of human behavior. In Proceedings of the 36th annual acm symposium on user interface software and technology, pages 1–22. find
- Bing Wang, Xinnian Liang, Jian Yang, Hui Huang, Shuangzhi Wu, Peihao Wu, Lu Lu, Zejun Ma, and Zhoujun Li. 2025. Scm: Enhancing large language model with self-controlled memory framework. Preprint, arXiv:2304.13343. — [arXiv:2304.13343](https://arxiv.org/abs/2304.13343) find
- Yaxiong Wu, Sheng Liang, Chen Zhang, Yichao Wang, Yongyue Zhang, Huifeng Guo, Ruiming Tang, and Yong Liu. 2025. From human memory to ai memory: A survey on memory mechanisms in the era of llms. arXiv preprint arXiv:2504.15965. — [arXiv:2504.15965](https://arxiv.org/abs/2504.15965) find
- Wujiang Xu, Zujie Liang, Kai Mei, Hang Gao, Juntao Tan, and Yongfeng Zhang. 2025. A-mem: Agentic memory for llm agents. arXiv preprint arXiv:2502.12110.
- Peiwen Yuan, Xinglin Wang, Shaoxiong Feng, Boyuan Pan, Yiwei Li, Heda Wang, Xupeng Miao, and Kan Li. 2024. Generative dense retrieval: Memory can be a burden. In Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers), St. J… find
- Kai Zhang, Yangyang Kang, Fubang Zhao, and Xiaozhong Liu. 2024a. LLM-based medical assistant personalization with short- and long-term memory coordination. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologie… find
- Kai Zhang, Yejin Kim, and Xiaozhong Liu. 2024b. Personalized llm response generation with parameterized memory injection. arXiv preprint arXiv:2404.03565. — [arXiv:2404.03565](https://arxiv.org/abs/2404.03565) find
- Zeyu Zhang, Xiaohe Bo, Chen Ma, Rui Li, Xu Chen, Quanyu Dai, Jieming Zhu, Zhenhua Dong, and Ji-Rong Wen. 2024c. A survey on the memory mechanism of large language model-based agents. arXiv preprint arXiv:2404.13501. find
- Yan Zheng, Tong Zou, and Xingyan Wang. 2020. Segment-page-combined memory management technology based on a homegrown many-core processor. CCF Transactions on High Performance Computing, 2(4):376–381. find
- Wanjun Zhong, Lianghong Guo, Qiqi Gao, He Ye, and Yanlin Wang. 2024. Memorybank: Enhancing large language models with long-term memory. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 19724–19731. find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/kang-2025-memory-os-ai-agent/