Research Background
Looking for practical concepts? See Core Concepts for understanding how to build with Letta’s stateful agents.
Letta and MemGPT
Letta was created by the same team that created MemGPT.
MemGPT: The Research Paper
MemGPT is a research paper (arXiv:2310.08560) that introduced foundational concepts for building stateful LLM agents:
- Self-editing memory - LLMs using tools to edit their own context window and external storage
- LLM Operating System - Infrastructure layer managing agent state, memory, and execution
- Memory hierarchy - Distinguishing between in-context memory (core) and out-of-context memory (archival)
- Context window management - Intelligent paging and memory consolidation techniques
The paper demonstrated that LLMs could maintain coherent conversations far beyond their context window limits by actively managing their own memory through tool calling.
MemGPT: The Agent Architecture
MemGPT also refers to a specific agent architecture popularized by the research paper. A MemGPT agent has:
- Memory editing tools (
memory_replace
,memory_insert
,memory_rethink
) - Archival memory tools (
archival_memory_insert
,archival_memory_search
) - Conversation search tools (
conversation_search
,conversation_search_date
) - A structured context window with persona and human memory blocks
This architecture makes MemGPT agents particularly effective for long-range chat applications, document search, and personalized assistants.
Learn more about MemGPT agents →
Letta: The Framework
Letta is a production framework that allows you to build and deploy agents with MemGPT-style memory systems (and beyond) as services behind REST APIs.
While the MemGPT research focused on the agent architecture and memory system, Letta provides:
- Production infrastructure - Database backends, persistence, state management
- Agent runtime - Tool execution, reasoning loops, multi-agent orchestration
- Developer tools - Agent Development Environment (ADE), SDKs, monitoring
- Deployment options - Letta Cloud for managed hosting, or self-hosted with Docker
- Flexibility - Build MemGPT agents, or design custom agent architectures with different memory systems
In short:
- MemGPT (research) = Ideas about how agents should manage memory
- MemGPT (architecture) = Specific agent design with memory tools
- Letta (framework) = Production system for building and deploying stateful agents
Agents in Context
The concept of “agents” has a long history across multiple fields:
In reinforcement learning and AI, agents are entities that:
- Perceive their environment through sensors
- Make decisions based on internal state
- Take actions that affect their environment
- Learn from outcomes to improve future decisions
In economics and game theory, agents are autonomous decision-makers with their own objectives and strategies.
In LLMs, agents extend these concepts by using language models for reasoning and tool calling for actions. Letta’s approach emphasizes:
- Statefulness - Persistent memory and identity across sessions
- Autonomy - Self-directed memory management and multi-step reasoning
- Tool use - Modifying internal state and accessing external resources
LLM Operating System
The LLM OS is the infrastructure layer that manages agent execution and state. This concept, introduced in the MemGPT paper, draws an analogy to traditional operating systems:
Just as an OS manages memory, processes, and I/O for programs, the LLM OS manages:
- Memory layer - Context window management, paging, and persistence
- Agent runtime - Tool execution and the reasoning loop
- Stateful layer - Coordination across database, cache, and execution
Letta implements this LLM OS architecture, providing the infrastructure for stateful agent services.
Self-Editing Memory
A key innovation from the MemGPT research is self-editing memory - agents that actively manage their own memory using tools.
Traditional RAG systems passively retrieve documents. Letta agents actively:
- Edit in-context memory - Update memory blocks based on learned information
- Manage archival storage - Decide what facts to persist long-term
- Search strategically - Query their memory when relevant context is needed
This active memory management enables agents to learn and evolve through interactions rather than requiring retraining or prompt engineering.
Learn more about Letta’s memory system →