An example desktop application for running Letta agents with a visual interface.
This repo contains an example desktop application for running Letta agents with a visual interface. The code is a fork of Claude-Cowork that replaces the Claude SDK with the @letta-ai/letta-agent-sdk. It provides a native desktop GUI for interacting with Letta agents.
Screen.Recording.2026-02-02.at.6.01.40.PM.mov
The Letta Agent SDK is the SDK interface to Letta Code. Build agents with persistent memory that learn over time.
import { createAgent, resumeSession } from '@letta-ai/letta-agent-sdk';
// First session - agent learns something
const agentId = await createAgent();
const session1 = resumeSession(agentId);
await session1.send('Remember: the secret word is "banana"');
for await (const msg of session1.stream()) { /* ... */ }
session1.close();
// Later... agent still remembers
await using session2 = resumeSession(agentId);
await session2.send('What is the secret word?');
for await (const msg of session2.stream()) {
if (msg.type === 'assistant') console.log(msg.content); // "banana"
}Key concepts:
- Agent (
agentId): Persistent entity with memory that survives across sessions - Conversation (
conversationId): A message thread within an agent - Session (
sessionId): A single execution/connection
Agents remember across conversations (via memory blocks), but each conversation has its own message history. This means you can run multiple concurrent conversations with the same agent - each conversation has its own message history while sharing the agent's persistent memory.
- Bun or Node.js 22+
- For cloud mode: a Letta API key from app.letta.com/settings
-
Copy
.env.exampleto.env:cp .env.example .env
-
Pick a backend in
.env(see.env.examplefor all options):Letta Cloud (agents stored in the cloud, tools run on your machine):
LETTA_BACKEND=cloud LETTA_API_KEY=your-api-key-here
Fully local runtime (agents stored on your machine, no API key):
LETTA_BACKEND=local
Self-hosted app server (see self-hosting docs):
# In another terminal: letta server --backend local --listen ws://127.0.0.1:4500 LETTA_BACKEND=remote LETTA_SERVER_URL=ws://127.0.0.1:4500If
LETTA_BACKENDis unset, the app uses cloud whenLETTA_API_KEYis set and local otherwise.
# Clone the repository
git clone https://github.com/letta-ai/letta-cowork.git
cd letta-cowork
# Install dependencies
bun install
# Run in development mode
bun run devThe OSS UI uses @letta-ai/letta-agent-sdk to run agents.
- The app talks to a Letta app server through the SDK:
local/cloudbackends: the SDK spawns and manages a bundled local app server (@letta-ai/letta-code)remotebackend: the SDK connects to your self-hosted app server over WebSocket
- Each task resumes the app's agent (created on first run) as a new SDK session
- Agent memory persists across conversations via memory blocks
# Start development server (hot reload)
bun run dev
# Type checking
bun run build