Letta (MemGPT)

Agents with self-editing memory

open-sourceproductionpythonopen-sourceself-editingagent-framework

Memory Types

episodic, semantic, working-memory, archival

Integrations

openai, anthropic, local-llms


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 APIs

  • When to Use Letta


    Letta is ideal for:

  • Building truly autonomous agents
  • Applications requiring very long-term memory
  • Complex agents that need to manage large knowledge bases
  • Research into agent memory architectures

  • Pros


  • Innovative self-editing memory approach
  • True context window management
  • Open-source and actively developed
  • Based on influential MemGPT research paper
  • Supports various LLM backends

  • Cons


  • More complex to set up than simpler memory solutions
  • Requires understanding the memory architecture
  • Agent autonomy can be unpredictable
  • Higher token usage due to memory management

  • Getting 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 information

  • Pricing


  • **Open Source**: Free, self-hosted
  • **Letta Cloud**: Coming soon