SkillsApr 1, 2026·1 min read

Letta — Stateful AI Agents with Memory

Letta builds stateful AI agents that learn and self-improve with advanced memory. 21.8K+ stars. CLI, Python/TS SDKs, skills, subagents. Apache 2.0.

TL;DR
Letta provides a platform for building stateful AI agents with persistent memory, self-editing capabilities, and multi-agent orchestration.
§01

What it is

Letta (formerly MemGPT) is a platform for building stateful AI agents with advanced memory management. Agents built with Letta maintain persistent memory across conversations, can self-edit their own context and instructions, and orchestrate subagents for complex tasks.

Letta targets developers building AI agents that need to remember user preferences, learn from interactions, and maintain context over long periods. It provides CLI tools, Python and TypeScript SDKs, and a skills system for extending agent capabilities. Apache 2.0 licensed.

§02

How it saves time or tokens

Standard LLM conversations lose context when the session ends. Letta agents maintain a structured memory system with core memory (always in context), archival memory (searchable long-term storage), and recall memory (conversation history). This means agents do not need to be re-prompted with background information each session.

The estimated token cost for this workflow is approximately 264 tokens. By managing memory tiers, Letta keeps the active context window small while retaining access to large knowledge bases.

§03

How to use

  1. Install Letta:
npm install -g @letta-ai/letta-code
# Or Python:
pip install letta-client
  1. Create and configure an agent:
from letta import create_client

client = create_client()
agent = client.create_agent(
    name='my-assistant',
    memory={
        'human': 'User is a Python developer working on ML projects',
        'persona': 'I am a helpful coding assistant'
    }
)
  1. Chat with the agent -- it remembers across sessions:
response = client.send_message(
    agent_id=agent.id,
    message='Remember that I prefer pytest over unittest'
)
# Next session, the agent still knows this preference
§04

Example

# Agent with archival memory search
from letta import create_client

client = create_client()
agent = client.create_agent(name='research-agent')

# Store knowledge in archival memory
client.insert_archival_memory(
    agent_id=agent.id,
    memory='The project uses FastAPI 0.115 with Pydantic v2'
)
client.insert_archival_memory(
    agent_id=agent.id,
    memory='Database is PostgreSQL 16 with pgvector extension'
)

# Agent searches archival memory when answering
response = client.send_message(
    agent_id=agent.id,
    message='What database does our project use?'
)
# Agent retrieves from archival: PostgreSQL 16 with pgvector
§05

Related on TokRepo

§06

Common pitfalls

  • Letta agents use LLM calls to manage memory (deciding what to store, what to retrieve). This adds token overhead per interaction compared to stateless agents.
  • Archival memory search quality depends on the embedding model. Use a high-quality embedding model for better retrieval accuracy.
  • Self-editing memory means the agent can modify its own instructions. Set guardrails if you need the agent to maintain specific behaviors.

Frequently Asked Questions

How is Letta different from MemGPT?+

Letta is the evolution of MemGPT. The project was renamed as it expanded beyond the original memory-focused research into a full agent platform with SDKs, skills, subagents, and production deployment features.

What memory tiers does Letta provide?+

Letta has three tiers: core memory (always in the LLM context window), archival memory (long-term searchable storage), and recall memory (conversation history). The agent decides when to move information between tiers.

Does Letta work with any LLM?+

Yes. Letta supports OpenAI, Anthropic Claude, and open-source models via compatible APIs. The memory management layer is LLM-agnostic.

Can Letta agents call tools?+

Yes. Letta has a skills system that lets you attach Python functions as tools to agents. Agents can call these tools during conversations. Skills can be shared and reused across agents.

Is Letta suitable for production use?+

Letta provides a server mode with REST APIs for production deployments. It supports multiple concurrent agents, persistent storage, and user authentication. The platform is designed for production AI agent workloads.

Citations (3)
🙏

Source & Thanks

letta-ai/letta — 21,800+ GitHub stars

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets