# MemGPT: Towards LLMs as Operating Systems

**Authors:** Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G. Patil, Ion Stoica, Joseph E. Gonzalez  
**arXiv:** [2310.08560](https://arxiv.org/abs/2310.08560)  
**Date:** 2023-10-12  
**Summary page:** https://www.summarizepaper.com/en/paper/2310.08560v2/

## Key points

- Large language models (LLMs) have significantly advanced AI applications
- Challenges arise in tasks like extended conversations and document analysis due to limited context windows
- Introducing virtual context management inspired by hierarchical memory systems in traditional operating systems
- MemGPT (Memory-GPT) intelligently manages different memory tiers to provide extended context within LLM's limited window
- MemGPT enhances performance in document analysis and multi-session chat applications
- In document analysis, MemGPT can analyze large documents beyond the LLM's context window
- In multi-session chat scenarios, MemGPT creates conversational agents that evolve dynamically through long-term interactions with users
- Utilizes interrupts to manage control flow between itself and users, enhancing capabilities of modern LLMs
- Leveraging virtual memory paging to create illusion of infinite context while using fixed-context models efficiently
- Release of MemGPT code and data for experimentation at https://research.memgpt.ai

## Summary

Large language models (LLMs) have significantly advanced AI applications, but their limited context windows pose challenges in tasks like extended conversations and document analysis. To address this limitation, we introduce virtual context management inspired by hierarchical memory systems in traditional operating systems. This technique allows for the effective utilization of extended context within the LLM's limited window. Our system, MemGPT (Memory-GPT), intelligently manages different memory tiers to provide extended context, enhancing performance in document analysis and multi-session chat applications. In document analysis, MemGPT can analyze large documents beyond the LLM's context window. In multi-session chat scenarios, MemGPT creates conversational agents that evolve dynamically through long-term interactions with users. By utilizing interrupts to manage control flow between itself and users, MemGPT enhances the capabilities of modern LLMs. The need for alternative techniques to support long contexts is critical due to the computational challenges of directly extending transformer models. Our approach leverages virtual memory paging to create the illusion of infinite context while using fixed-context models efficiently. We release MemGPT code and data for experimentation at https://research.memgpt.ai. In conclusion, our OS-inspired design demonstrates significant improvements in handling extended contexts within LLMs, showcasing enhanced performance in tasks where limited context windows hinder existing models' effectiveness.
