MemGPT: Towards LLMs as Operating Systems

Authors: Charles Packer, Vivian Fang, Shishir G. Patil, Kevin Lin, Sarah Wooders, Joseph E. Gonzalez

Submitted to arXiv on 12 Oct. 2023
License: CC BY 4.0
Abstract

Large language models (LLMs) have revolutionized AI, but are constrained by limited context windows, hindering their utility in tasks like extended conversations and document analysis. To enable using context beyond limited context windows, we propose virtual context management, a technique drawing inspiration from hierarchical memory systems in traditional operating systems that provide the appearance of large memory resources through data movement between fast and slow memory. Using this technique, we introduce MemGPT (Memory-GPT), a system that intelligently manages different memory tiers in order to effectively provide extended context within the LLM's limited context window, and utilizes interrupts to manage control flow between itself and the user. We evaluate our OS-inspired design in two domains where the limited context windows of modern LLMs severely handicaps their performance: document analysis, where MemGPT is able to analyze large documents that far exceed the underlying LLM's context window, and multi-session chat, where MemGPT can create conversational agents that remember, reflect, and evolve dynamically through long-term interactions with their users. We release MemGPT code and data for our experiments at https://memgpt.ai.

The papers around it, by date and closeness

Higher is closer to this paper; left is older. Lines join papers close to each other: groups of lines are sub-topics. Select a point to see why it is there. Back to the summary of this paper

How to read this map? Illustrated guide

Closest papers Prior work it builds on Papers that cite it

Papers around this one

Ranked by how close their title and abstract are to this paper’s. Select some to read them together.

Closest papers

  1. Very close Broader context
    MemOS: A Memory OS for AI System
    Zhiyu Li, Shichao Song, Chenyang Xi et al. · 2025 · Computation and Language · preprint, not peer reviewed · cited 155 times · AI summary available

    MemOS proposes a memory-management system for long-context reasoning and persistent knowledge, a broader AI memory-OS topic shared with MemGPT.

    Abstract

    Large Language Models (LLMs) have become an essential infrastructure for Artificial General Intelligence (AGI), yet their lack of well-defined memory management systems hinders the development of long-context reasoning, continual personalization, and knowledge consistency.Existing models mainly rely on static parameters and short-lived contextual states, limiting their ability to track user preferences or update knowledge over extended periods.While Retrieval-Augmented Generation (RAG) introduces external knowledge in plain text, it remains a stateless workaround without lifecycle control or integration with persistent representations.Recent work has modeled the training and inference cost o…

  2. Very close Another approach to the problem
    CALMem : Application-Layer Dual Memory for Conversational AI
    R. Jena, Rajan Padmanabhan, S. Arumugam · 2026 · arXiv.org · preprint, not peer reviewed · Not summarized yet

    CALMem adds application-layer dual memory to preserve conversational continuity across context compaction and sessions, addressing limits MemGPT handles with virtual context management.

    Abstract

    Large language models (LLMs) operate within fixed context windows that fundamentally limit conversational continuity. When context fills, compaction discards history irreversibly; when sessions end, all memory resets to zero. Existing solutions-larger context windows, retrieval-augmented generation for knowledge bases, and memory-augmented architectures such as MemGPT-either require model modification, impose provider lock-in, or do not address the compaction continuity problem. We present CALMem (Conversational Application-Layer Memory), an application-layer dual memory architecture that gives LLM-based conversational assistants virtually unbounded effective context without any modification…

  3. Very close Another approach to the problem
    A Model Context Protocol Application for Long-Term Memory Management
    Arda Altınörs, B. Akgün · 2025 · 2025 3rd International Conference on Foundation and Large Language Models (FLLM) · Not summarized yet

    MemCP provides persistent cross-session memory through a standardized protocol, while MemGPT manages memory tiers within an LLM system.

    Abstract

    Large Language Models (LLMs) suffer from a critical limitation: the inability to maintain memory across conversations and sessions. This "amnesia problem" forces users to repeatedly provide context and prevents AI systems from building long-term relationships. This paper introduces MemCP, a publicly deployed and production-ready Model Context Protocol (MCP) server designed to provide persistent memory capabilities to any MCP-compatible AI assistant. Drawing inspiration from established memory architecture principles, MemCP demonstrates that sophisticated memory systems can be delivered through standardized protocols rather than platform-specific solutions. The system features a dual-server a…

  4. Very close Another approach to the problem
    Human-like Episodic Memory for Infinite Context LLMs
    Zafeirios Fountas, Martin A Benfeghoul, Adnan Oomerjee et al. · 2024 · Artificial Intelligence · cited 74 times · AI summary available

    EM-LLM uses episodic event organization to extend context, whereas MemGPT uses OS-inspired movement between memory tiers.

    Abstract

    Large language models (LLMs) have shown remarkable capabilities, but still struggle with processing extensive contexts, limiting their ability to maintain coherence and accuracy over long sequences. In contrast, the human brain excels at organising and retrieving episodic experiences across vast temporal scales, spanning a lifetime. In this work, we introduce EM-LLM, a novel approach that integrates key aspects of human episodic memory and event cognition into LLMs, enabling them to effectively handle practically infinite context lengths while maintaining computational efficiency. EM-LLM organises sequences of tokens into coherent episodic events using a combination of Bayesian surprise and …

  5. Very close Another approach to the problem
    Memori: A Persistent Memory Layer for Efficient, Context-Aware LLM Agents
    L. Borro, L. A. Macarini, Gordon Tindall et al. · 2026 · arXiv.org · preprint, not peer reviewed · cited 14 times · Not summarized yet

    Memori structures dialogue as semantic triples and summaries for persistent retrieval, while MemGPT manages long context through virtual memory tiers.

    Abstract

    As large language models (LLMs) evolve into autonomous agents, persistent memory at the API layer is essential for enabling context-aware behavior across LLMs and multi-session interactions. Existing approaches force vendor lock-in and rely on injecting large volumes of raw conversation into prompts, leading to high token costs and degraded performance. We introduce Memori, an LLM-agnostic persistent memory layer that treats memory as a data structuring problem. Its Advanced Augmentation pipeline converts unstructured dialogue into compact semantic triples and conversation summaries, enabling precise retrieval and coherent reasoning. Evaluated on the LoCoMo benchmark, Memori achieves 81.95% …

  6. Very close Another approach to the problem
    EverMemOS: A Self-Organizing Memory Operating System for Structured Long-Horizon Reasoning
    Chuan-Rui Hu, Xingze Gao, Zuyi Zhou et al. · 2026 · Annual Meeting of the Association for Computational Linguistics · cited 62 times · Not summarized yet

    EverMemOS organizes dialogue into episodic and semantic memory for long-horizon reasoning, while MemGPT uses hierarchical memory management and interrupts.

    Abstract

    Large Language Models (LLMs) are increasingly deployed as long-term interactive agents, yet their limited context windows make it difficult to sustain coherent behavior over extended interactions. Existing memory systems often store isolated records and retrieve fragments, limiting their ability to consolidate evolving user states and resolve conflicts. We introduce EverMemOS, a self-organizing memory operating system that implements an engram-inspired lifecycle for computational memory. Episodic Trace Formation converts dialogue streams into MemCells that capture episodic traces, atomic facts, and time-bounded Foresight signals. Semantic Consolidation organizes MemCells into thematic MemSce…

  7. Very close Another approach to the problem
    Contextual Memory Virtualisation: DAG-Based State Management and Structurally Lossless Trimming for LLM Agents
    C. Santoni · 2026 · arXiv.org · preprint, not peer reviewed · cited 1 time · Not summarized yet

    CMV models session history as a DAG with snapshots and lossless trimming, addressing context limits through state versioning rather than MemGPT's memory tiers.

    Abstract

    As large language models engage in extended reasoning tasks, they accumulate significant state -- architectural mappings, trade-off decisions, codebase conventions -- within the context window. This understanding is lost when sessions reach context limits and undergo lossy compaction. We propose Contextual Memory Virtualisation (CMV), a system that treats accumulated LLM understanding as version-controlled state. Borrowing from operating system virtual memory, CMV models session history as a Directed Acyclic Graph (DAG) with formally defined snapshot, branch, and trim primitives that enable context reuse across independent parallel sessions. We introduce a three-pass structurally lossless tr…

  8. Close Review
    Beyond Storage: Toward Living Memory Systems for LLMs on the Edge
    Myles Foley, Valentin Radu, Massimo Pegoraro et al. · 2026 · MobiSys Workshops · Not summarized yet

    This paper analyzes 30 memory-system papers and proposes a broader framework for LLM memory, rather than introducing a system like MemGPT.

    Abstract

    Large Language Models (LLMs) display high powered reasoning to solve complex tasks. Yet, their smaller counterparts, designed to run efficiently on mobile devices (laptops, phones), often have reduced task specific performance. Providing large prompts (or contexts) can improve performance but puts strain on host system resources. Memory systems for LLMs can lower context size and retrieve the most relevant information for the current task. We analyse 30 papers to categorise the problem domain within memory they target and how they solve this problem. We advocate for a holistic approach to memory that broadens the scope to multi-modal data sources, and crosses the problem domains we identify.…

Prior work it builds on

  1. Close Another approach to the problem A method it uses
    Extending Context Window of Large Language Models via Positional Interpolation
    Shouyuan Chen, Sherman Wong, Liangjian Chen et al. · 2023 · arXiv.org · preprint, not peer reviewed · cited 924 times · AI summary available

    Position Interpolation extends RoPE models' context windows through positional rescaling, while MemGPT manages context through memory transfer without changing the model.

    Abstract

    We present Position Interpolation (PI) that extends the context window sizes of RoPE-based pretrained LLMs such as LLaMA models to up to 32768 with minimal fine-tuning (within 1000 steps), while demonstrating strong empirical results on various tasks that require long context, including passkey retrieval, language modeling, and long document summarization from LLaMA 7B to 65B. Meanwhile, the extended model by Position Interpolation preserve quality relatively well on tasks within its original context window. To achieve this goal, Position Interpolation linearly down-scales the input position indices to match the original context window size, rather than extrapolating beyond the trained conte…

  2. Related Broader context Used in depth by this paper A method it uses
    AgentBench: Evaluating LLMs as Agents
    Xiao Liu, Hao Yu, Hanchen Zhang et al. · 2023 · International Conference on Learning Representations · cited 1,588 times · Not summarized yet

    AgentBench evaluates LLM reasoning and decisions across interactive environments, a neighboring agent-systems concern to MemGPT's multi-session conversational agents.

    Abstract

    The potential of Large Language Model (LLM) as agents has been widely acknowledged recently. Thus, there is an urgent need to quantitatively \textit{evaluate LLMs as agents} on challenging tasks in interactive environments. We present AgentBench, a multi-dimensional benchmark that consists of 8 distinct environments to assess LLM-as-Agent's reasoning and decision-making abilities. Our extensive test over \num API-based and open-sourced (OSS) LLMs shows that, while top commercial LLMs present a strong ability of acting as agents in complex environments, there is a significant disparity in performance between them and many OSS competitors that are no larger than 70B. We identify the typical re…

  3. Related Another approach to the problem A method it uses
    In-Context Retrieval-Augmented Language Models
    Ori Ram, Yoav Levine, Itay Dalmedigos et al. · 2023 · Transactions of the Association for Computational Linguistics · cited 1,192 times · AI summary available

    In-Context RALM prepends retrieved grounding documents to prompts, while MemGPT manages broader context by moving information between memory tiers.

    Abstract

    Abstract Retrieval-Augmented Language Modeling (RALM) methods, which condition a language model (LM) on relevant documents from a grounding corpus during generation, were shown to significantly improve language modeling performance. In addition, they can mitigate the problem of factually inaccurate text generation and provide natural source attribution mechanism. Existing RALM approaches focus on modifying the LM architecture in order to facilitate the incorporation of external information, significantly complicating deployment. This paper considers a simple alternative, which we dub In-Context RALM: leaving the LM architecture unchanged and prepending grounding documents to the input, witho…

  4. Related Another approach to the problem
    Active Retrieval Augmented Generation
    Zhengbao Jiang, Frank F. Xu, Luyu Gao et al. · 2023 · Conference on Empirical Methods in Natural Language Processing · cited 961 times · AI summary available

    Active RAG retrieves information during generation to ground long outputs, whereas MemGPT manages extended context through virtual memory.

    Abstract

    Despite the remarkable ability of large language models (LMs) to comprehend and generate language, they have a tendency to hallucinate and create factually inaccurate output. Augmenting LMs by retrieving information from external knowledge resources is one promising solution. Most existing retrieval augmented LMs employ a retrieve-and-generate setup that only retrieves information once based on the input. This is limiting, however, in more general scenarios involving generation of long texts, where continually gathering information throughout generation is essential. In this work, we provide a generalized view of active retrieval augmented generation, methods that actively decide when and wh…

  5. Related Another approach to the problem A method it uses
    Improving language models by retrieving from trillions of tokens
    Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann et al. · 2021 · International Conference on Machine Learning · cited 2,026 times · Not summarized yet

    RETRO conditions language generation on retrieved corpus chunks, whereas MemGPT uses tiered memory to support long documents and continuing conversations.

    Abstract

    We enhance auto-regressive language models by conditioning on document chunks retrieved from a large corpus, based on local similarity with preceding tokens. With a $2$ trillion token database, our Retrieval-Enhanced Transformer (RETRO) obtains comparable performance to GPT-3 and Jurassic-1 on the Pile, despite using 25$\times$ fewer parameters. After fine-tuning, RETRO performance translates to downstream knowledge-intensive tasks such as question answering. RETRO combines a frozen Bert retriever, a differentiable encoder and a chunked cross-attention mechanism to predict tokens based on an order of magnitude more data than what is typically consumed during training. We typically train RETR…

Papers that cite it

  1. Close Broader context
    IsolateGPT: An Execution Isolation Architecture for LLM-Based Systems
    Yuhao Wu, Franziska Roesner, Tadayoshi Kohno et al. · 2025 · Network and Distributed System Security Symposium · cited 39 times · Not summarized yet

    IsolateGPT studies security isolation for third-party LLM applications, a systems concern adjacent to MemGPT's operating-system-inspired LLM design.

    Abstract

    Large language models (LLMs) extended as systems, such as ChatGPT, have begun supporting third-party applications.These LLM apps leverage the de facto natural languagebased automated execution paradigm of LLMs: that is, apps and their interactions are defined in natural language, provided access to user data, and allowed to freely interact with each other and the system.These LLM app ecosystems resemble the settings of earlier computing platforms, where there was insufficient isolation between apps and the system.Because third-party apps may not be trustworthy, and exacerbated by the imprecision of natural language interfaces, the current designs pose security and privacy risks for users.In …

  2. Close Builds on this paper Uses this paper in depth
    MemFit: Efficient Long-Term Agentic Memory
    Mitchell Piehl, Mu-Chao Ye · 2026 · cited 1 time · Not summarized yet

    MemFit cites MemGPT and proposes cheaper long-term conversational memory using verbatim turn storage and indexing.

    Abstract

    Long-term memory systems for large language models (LLMs) have gained popularity for extending reasoning capabilities across applications. Current memory systems rely on LLM agents to organize and consolidate memory, resulting in costly, inefficient write operations. To address this limitation, we propose MemFit, a long-term memory system for conversational agents that reduces the cost and latency of memory operations. Unlike existing systems that rely on expensive LLM calls for memory construction or discard surface-level details through compression, MemFit stores each turn verbatim in an append-only store with near-instantaneous, LLM-free insertion, indexing turns with segment summaries ra…

  3. Close Builds on this paper
    Mem++: Non-Destructive Memory for Long-Term Organizational LLM Agents
    Ahmad Yehia, Aly O. Abdelkareem, Islam Ahmed et al. · 2026 · Not summarized yet

    Mem++ cites MemGPT and proposes retaining whole dated documents for read-time selection in organizational memory.

    Abstract

    Large Language Model (LLM) agents now take part in organizational work, where many authors record decisions across documents over months. Because a revised decision arrives as a new document rather than an edit, answering a question requires knowing which version held at a given time. However, most memory systems compress the record at write time. By distilling each document into facts, notes or graph edges, these methods fix what can be answered before any question is asked. To address this, we propose Mem++, a non-destructive memory framework shifting from write-time distillation to read-time selection. Mem++ stores every document whole with its date and author, and it calls no generative …

  4. Close Builds on this paper
    MemCo: Memory-Centric Collaboration for Generalizing LLM Agents to Unseen Environments
    Xin-Ting Liao, Si-Yan Liu, Rabab K. Ward et al. · 2026 · Not summarized yet

    MemCo cites MemGPT and develops shared memory for agents learning to act in unseen interactive environments.

    Abstract

    Large language model (LLM) agents increasingly operate in interactive environments, where they need to make sequential decisions through observation, action, and feedback. Although memory can help agents reuse experience, existing work designs memory in isolation, where collecting enough trajectories to populate it is expensive. Existing shared-memory approaches mitigate isolated experience by pooling episodic memories across tasks and environments. However, retrieving shared memory is challenged by the granularity, where retrieved memories can be either too specific to preserve current grounding or too coarse to support the next action. In this work, we propose MemCo, a memory-centric colla…

  5. Close Builds on this paper
    Memorilla: Latent Semantic Memory for LLMs
    Adibvafa Fallahpour, Parsa Idehpour, Vignesh Kothapalli et al. · 2026 · Not summarized yet

    Memorilla cites MemGPT and compresses document collections into query-dependent memory tokens for a frozen LLM.

    Abstract

    Memory enables large language models (LLMs) to use information beyond their parameters, such as past user conversations, long documents, or an agent's earlier actions. For a frozen LLM, access to this accumulated knowledge is limited to what a memory system places in its context window. However, gathering and combining relevant information needed for each query while keeping the model's context short remains challenging for existing systems. Here we introduce Memorilla, a memory system that gathers information from an entire document collection into a fixed number of query-dependent'memory tokens'for a frozen LLM. Memorilla encodes documents (such as user chats, book chapters) once into reus…

How are these papers found?

We compare the title and abstract of this paper with those of every paper summarized on this site, and with the papers Semantic Scholar recommends, those it cites and those citing it (for a much-cited paper, its most recent citations and, from OpenAlex, the most cited ones). Among the prior work and the follow-ups, the papers that use each other in depth, a method it uses and the much-cited follow-ups come a little higher. The levels (very close, close, related) come from the similarity of the texts, not from a judgment of quality; * marks a paper without an abstract, compared by its title. The sentence under a paper is written by an AI from the two abstracts: check it in the papers. A paper marked not relevant by three readers leaves the list.

Updated on 4 November 2026.

The illustrated guide to the papers around a paper