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.
Use the figure to compare short-term session memory with long-term memory used for learning and improvement. section 9.2.3
