Overview
Letta (formerly MemGPT) pioneered the concept of agents that can manage their own memory. Instead of developers manually handling memory, Letta agents autonomously decide what to remember, forget, and retrieve, enabling truly long-term persistent conversations.
Key Features
**Self-editing Memory**: Agents autonomously manage their memory through function calls**Hierarchical Memory**: Core memory (always visible) + archival memory (searchable)**Context Management**: Automatically pages information in/out of context window**Persistent Agents**: Agents maintain state across sessions and restarts**Tool Use**: Agents can call external tools and APIsWhen to Use Letta
Letta is ideal for:
Building truly autonomous agentsApplications requiring very long-term memoryComplex agents that need to manage large knowledge basesResearch into agent memory architecturesPros
Innovative self-editing memory approachTrue context window managementOpen-source and actively developedBased on influential MemGPT research paperSupports various LLM backendsCons
More complex to set up than simpler memory solutionsRequires understanding the memory architectureAgent autonomy can be unpredictableHigher token usage due to memory managementGetting Started
from letta import create_client
client = create_client()
# Create an agent with memory
agent = client.create_agent(
name="my_agent",
memory_human="User is a software developer",
memory_persona="I am a helpful AI assistant"
)
# Chat with the agent
response = client.send_message(
agent_id=agent.id,
message="Remember that I prefer TypeScript"
)
Architecture
Letta implements a hierarchical memory system:
**Core Memory**: Always in context, editable by the agent**Recall Memory**: Searchable conversation history**Archival Memory**: Long-term storage for important informationPricing
**Open Source**: Free, self-hosted**Letta Cloud**: Coming soon