liveBook · Manning

MemGPT

As explained in The Art of AI Product Development

An operating-system-inspired architecture and system for managing language-model memory across context and external storage.

MemGPT is an operating-system-inspired architecture for managing language-model memory beyond a limited context window. It separates fast, in-context memory from larger, persistent out-of-context storage, allowing agents to retain information across tasks and interactions. section 9.2.3

Its main mechanisms include:

  • Self-editing memory lets the agent use tool calls to decide what remains in context. section 9.2.3
  • A memory hierarchy balances limited, high-speed context access with persistent external storage. section 9.2.3
  • Heartbeat cycles support multistep reasoning by allowing additional processing. section 9.2.3
  • Context compilation turns memory, tools, and messages into a prompt, while vector databases provide archival memory. section 9.2.3

Learning from research history

An agent can retain raw interactions, summaries of adopted solutions, evaluations of their quality, or higher-level reflections, then use those memories to prioritize more useful research sources later. section 9.2.3

Figure 9.14 Agents need short-term memory for the current session and long-term memory for learning and improvement over time.
A diagram of a computer process

AI-generated content may be incorrect.

Use the figure to compare short-term session memory with long-term memory used for learning and improvement. section 9.2.3

How The Art of AI Product Development covers it

How deep it goes
Defines a two-tier architecture and its mechanisms, but does not descend into implementation code or retrieval algorithms.
Examples
Illustrates raw interactions, task summaries, solution evaluations, reflection, and research-source prioritization.
What you can do after
Operate agents that retain information, manage context dynamically, perform complex tasks, and adapt over time.
How it connects
Connects short-term memory, long-term memory, tool calls, vector databases, context compilation, and multistep reasoning.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of AI Product Development. The section links point to the parts of the book it draws on.