Reproduce “MemGPT: Towards LLMs as Operating Systems” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

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

MemGPT gives fixed-context models access to external storage through function calls, moving selected information into and out of a limited prompt. It uses a working context, queues, and retrieval to support conversations and lookups. On deep memory retrieval, GPT-4 reaches 92.5% accuracy versus 32.1% for GPT-4 alone, with different history access; each inference still has a fixed context window.

Key insights

  • Drawing inspiration from operating system virtual memory, LLMs can be augmented to manage information beyond their immediate context window by 'paging' data between prompt tokens and external storage.
  • Empowering the LLM itself with function calls to act as an 'operating system' enables autonomous memory management, allowing it to decide when and what to store or retrieve.
  • A multi-level memory hierarchy and event-driven control flow provide the illusion of an infinite context, facilitating long-term memory and complex document analysis for finite-context LLMs.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.