Letta Agents SDK: An SDK for stateful agents | LettaPRODUCT — AUG 12, 2026Letta Agents SDK: An SDK for stateful agents
Today, we are launching the Letta Agents SDK, a TypeScript library for building with stateful agents.<br>The Letta Agents SDK is designed for stateful, persistent agents. Each agent has its own sense of identity, long-term experience, and memory — and can work across computers without losing memory or state, just like a human.<br>You can use the Agents SDK to create multi-agent and multi-user applications, for dynamic orchestration of agents, or to build custom interfaces on top of Letta agents.<br>An SDK for stateful agents<br>The Letta Agents SDK is designed for working with long-running, stateful agents. Agents can be created on different state backends (in the cloud or locally), and can run across different machines while retaining the same memory and state.<br>The same SDK interface to interact with stateful agents works against Letta Cloud, a self-hosted App Server, or entirely on your machine:<br>CloudSelf-hosted App ServerLocal<br>import { LettaAgentClient } from "@letta-ai/letta-agent-sdk";
const client = new LettaAgentClient({<br>backend: "cloud",<br>apiKey: process.env.LETTA_API_KEY,<br>});
const agentId = await client.createAgent({<br>model: "letta/auto",<br>persona: "I am Nora, a research analyst who tracks our competitors.",<br>});Copy
import { LettaAgentClient } from "@letta-ai/letta-agent-sdk";
const client = new LettaAgentClient({<br>backend: "remote",<br>url: process.env.LETTA_APP_SERVER_URL!,<br>authToken: process.env.LETTA_APP_SERVER_TOKEN,<br>});
const agentId = await client.createAgent({<br>model: "letta/auto",<br>persona: "I am Nora, a research analyst who tracks our competitors.",<br>});Copy
import { LettaAgentClient } from "@letta-ai/letta-agent-sdk";
const client = new LettaAgentClient({ backend: "local" });
const agentId = await client.createAgent({<br>model: "letta/auto",<br>persona: "I am Nora, a research analyst who tracks our competitors.",<br>});Copy
Registering and working across computers<br>Agents are not tied to the machine they were created on. A Cloud agent can work in a managed sandbox or on any computer registered with Letta — a laptop, workstation, VM, or container. The computer supplies the files, shell, credentials, and installed software; the agent keeps the same identity, memory, and conversations.<br>// List the computers registered with your account<br>const { computers } = await client.computers.list();
// Select one for a session<br>await using session = client.resumeSession(agentId, {<br>computer: { name: "work-laptop" },<br>cwd: "/workspace/project",<br>});Copy<br>Creating custom interfaces for stateful agents<br>The Agents SDK is built on top of the same WebSockets interface that we build Letta Desktop with. You can create your own custom interfaces — a web app, a mobile app, a kanban board — that connect to either Letta Cloud or your own self-deployed App Server.<br>The Expo demo app shows how to browse agents, stream reasoning and tool activity, and handle approvals from a mobile client. Fork it to build your own interface with custom themes, branding, or features.<br>The Agents SDK mobile demo app, showing an agent list, a streamed coding turn, and tool approval.See examples of custom interfaces and applications built with the Agents SDK:<br>Web chat streams an agent's work into a browser interface.<br>Dungeon master uses a persistent persona and Git-backed memory to run campaigns over time.<br>Letta ACP makes the same stateful agent available in ACP-compatible editors like Zed, test harnesses, and command-line clients while preserving its memory across clients and adapter restarts.<br>Dynamic workflows across models and machines<br>The Agents SDK can power dynamic workflows executed by agents. An agent running locally can spawn new conversations with itself in the cloud to work on concurrent tasks — and because agents can write TypeScript, they can use the SDK to turn repeated work into programs: one-off helpers, reusable commands, scheduled automations, event handlers, or longer-running services that start a new conversation when work arrives. The program handles fixed control flow and external events, while the agent handles interpretation and tool use with its existing memory.<br>See examples of dynamic workflows with the Agents SDK:<br>Research team coordinates persistent agents in a collaborative research workflow.<br>Release notes learns formatting preferences as it writes from git history.<br>Dynamic workflows invokes agents programmatically to compare plans across models, cross-check research, and migrate files in isolated Cloud sandboxes.<br>Model-agnostic, managed agents<br>The Letta Agents SDK supports both running the agent execution loop fully locally (similar to other agent SDKs) and interfacing with stateful agents managed by remote servers that multiple clients connect to. Unlike other managed agent providers, the Agents SDK unifies the concept of a local SDK and a managed agent SDK.<br>LOCALCLOUD / SELF-HOSTED APP SERVERSDK CLIENT🔄 execution...