Skip to content
Discord
Get started

Letta Agent SDK overview

The SDK for stateful agents — create an agent once, then resume it from anywhere

The Letta Agent SDK is the SDK for stateful agents: create an agent once, then resume it from anywhere. Each agent has its own identity and long-term memory, and keeps both across conversations, models, and the computers it runs on.

That makes the agent — not the process, the session, or the machine — the durable object in your application. Most of the time you are reconnecting to an agent that already exists and already knows something, rather than creating a disposable one. Use the SDK to build multi-agent and multi-user applications, orchestrate agents dynamically, or put a custom interface on top of a Letta agent.

import { LettaAgentClient } from "@letta-ai/letta-agent-sdk";
const client = new LettaAgentClient({ backend: "cloud" });
// Create the agent once...
const agentId = await client.createAgent({
persona: "You are Nora, a research analyst who tracks our competitors.",
});
// ...then resume it, from anywhere, for as long as it lives.
await using session = client.resumeSession(agentId);
await session.send("What changed since last week?");
for await (const message of session.stream()) {
if (message.type === "assistant") process.stdout.write(message.content);
}
  1. Quickstart: install the SDK, create an agent, and stream its first response
  2. Sessions, turns, and durability: the agent, conversation, and session model that the rest of these docs assume
  3. Creating agents and Sending messages: configure memory and handle the event stream
  • A JavaScript or TypeScript project
  • A Letta API key for the cloud backend; the local backend needs no account
  • Node.js 22.19+ only if you run the agent runtime yourself — the local backend, or a self-hosted App Server

Start with the Quickstart when you are new to the SDK. Read Deployment when you need to decide where agent state lives and where tools execute — the SDK is model agnostic and reaches managed, local, and self-hosted deployments through one interface. Explore the demo apps for a React chat frontend, a mobile client, or an integration inside an existing desktop application. Browse Examples for smaller applications focused on individual SDK features. The source is on GitHub.