Letta Conversations API
Enables managing multiple isolated message threads on a single Letta agent through the Conversations API.
Identity proven by GitHub's verified organisation badge (letta-ai)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
- License
- MIT (permissive)
- Pin
- 6785511pinned Oct 9, 2026
- Context cost
- about 1,600 tokenswhen the skill loads
- GitHub stars
- 148on letta-ai/skills
- Scripts
- 2 scripts
What it does
“Guide for using the Letta Conversations API to manage isolated message threads on agents. Use when building multi-user chat applications, session management, or any scenario requiring separate conversation contexts on a single agent.”
Generated summary from the skill's own text
Enables managing multiple isolated message threads on a single Letta agent through the Conversations API. Each conversation maintains separate message history while sharing the agent's memory and tools, useful for building multi-user chat applications and session management. Provides both Python SDK and REST API access.
When to use it
- Building chat applications where each user needs their own conversation thread
- Implementing session management with isolated contexts on one agent
- A/B testing agent responses across multiple independent conversations
- Managing separate conversation histories while sharing agent memory and tools
When not to
- When you need a single conversation thread per agent
- If conversations should share message history across users
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add letta-ai/skills --skill 'Letta Conversations API'Installs from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install letta-ai/skills 'Letta Conversations API@6785511e7d3913d9ec598435a77ae637cd45fc89'Installs the commit we checked (6785511).
Copy by hand
Download the folder at 6785511 and put it in .claude/skills/conversations for Claude Code and in .agents/skills/conversations for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "Letta Conversations API" by Letta. Source, pinned to commit 6785511e7d3913d9ec598435a77ae637cd45fc89: https://github.com/letta-ai/skills/tree/6785511e7d3913d9ec598435a77ae637cd45fc89/letta/conversations 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/conversations/ for Claude Code and .agents/skills/conversations/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/letta/letta-conversations-api
SKILL.md at the pin
---
name: Letta Conversations API
description: Guide for using the Letta Conversations API to manage isolated message threads on agents. Use when building multi-user chat applications, session management, or any scenario requiring separate conversation contexts on a single agent.
---
# Letta Conversations API
The Conversations API allows multiple isolated message threads on a single agent. Each conversation maintains its own message history while sharing the agent's memory blocks and tools.
## When to Use This Skill
- Building multi-user chat applications (each user gets their own conversation)
- Implementing session management with separate contexts
- A/B testing agent responses across isolated conversations
- Any scenario where you need multiple independent chat threads with one agent
## Key Concepts
| Concept | Description |
|---------|-------------|
| **Conversation** | An isolated message thread on an agent (`conv-xxx` ID) |
| **Isolation** | Each conversation has separate message history |
| **Shared State** | Memory blocks and tools are shared across conversations |
| **In-Context Messages** | Messages currently in the conversation's context window |
## Python SDK Usage
### Setup
```python
from letta_client import Letta
client = Letta(base_url="https://api.letta.com", api_key="your-key")
```
### Create a Conversation
```python
conversation = client.conversations.create(agent_id="agent-xxx")
# conversation.id -> "conv-xxx"
```
### Send Messages (Streaming)
```python
stream = client.conversations.messages.create(
conversation_id=conversation.id,
messages=[{"role": "user", "content": "Hello!"}],
)
for msg in stream:
if hasattr(msg, "message_type") and msg.message_type == "assistant_message":
print(msg.content)
```
### List Messages in a Conversation
```python
messages = client.conversations.messages.list(
conversation_id=conversation.id,
limit=50, # Optional: default 100
after="message-xxx", # Optional: cursor for pagination
before="message-yyy", # Optional: cursor for pagination
)
```
### List All Conversations for an Agent
```python
conversations = client.conversations.list(
agent_id="agent-xxx",
limit=50, # Optional
after="conv-xxx", # Optional: cursor for pagination
)
```
### Retrieve a Specific Conversation
```python
conv = client.conversations.retrieve(conversation_id="conv-xxx")
# conv.in_context_message_ids -> list of message IDs in context window
```
## REST API Endpoints
| Method | Endpoint | Description |
|--------|----------|-------------|
| `POST` | `/v1/conversations?agent_id=xxx` | Create a conversation |
| `GET` | `/v1/conversations?agent_id=xxx` | List conversations |
| `GET` | `/v1/conversations/{conversation_id}` | Get a conversation |
| `GET` | `/v1/conversations/{conversation_id}/messages` | List messages |
| `POST` | `/v1/conversations/{conversation_id}/messages` | Send message (streams response) |
| `POST` | `/v1/conversations/{conversation_id}/stream` | Resume a background stream |
### REST Example: Create and Send Message
```bash
# Create conversation
curl -X POST "https://api.letta.com/v1/conversations?agent_id=agent-xxx" \
-H "Authorization: Bearer $LETTA_API_KEY" \
-H "Content-Type: application/json"
# Send message (streaming response)
curl -X POST "https://api.letta.com/v1/conversations/conv-xxx/messages" \
-H "Authorization: Bearer $LETTA_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{"messages": [{"role": "user", "content": "Hello!"}]}'
```
## Conversation Schema
```python
class Conversation:
id: str # "conv-xxx"
agent_id: str # Associated agent ID
created_at: datetime # Creation timestamp
summary: Optional[str] # Optional conversation summary
in_context_message_ids: List[str] # Message IDs in context window
```
## Common Patterns
### Multi-User Chat Application
```python
# Each user gets their own conversation
user_conversations = {}
def get_or_create_conversation(user_id: str, agent_id: str) -> str:
if user_id not in user_conversations:
conv = client.conversations.create(agent_id=agent_id)
user_conversations[user_id] = conv.id
return user_conversations[user_id]
def send_user_message(user_id: str, agent_id: str, message: str):
conv_id = get_or_create_conversation(user_id, agent_id)
return client.conversations.messages.create(
conversation_id=conv_id,
messages=[{"role": "user", "content": message}],
)
```
### Paginating Through Message History
```python
def get_all_messages(conversation_id: str):
all_messages = []
after = None
while True:
batch = client.conversations.messages.list(
conversation_id=conversation_id,
limit=100,
after=after,
)
if not batch:
break
all_messages.extend(batch)
after = batch[-1].id
return all_messages
```
## Important Notes
1. **Streaming by default**: The `messages.create` endpoint always streams responses
2. **Shared memory**: Memory block updates in one conversation are visible in all conversations for that agent
3. **Message isolation**: Conversation message history is completely isolated between conversations
4. **Pagination**: Use `after`/`before` cursors for efficient pagination, not offsets
## Example Scripts
This skill includes two example scripts in the `scripts/` directory:
1. **`conversations_demo.py`** - Comprehensive demo showing all API features
- Basic conversation flow
- Conversation isolation testing
- Listing and retrieving conversations
- Pagination examples
- Shared memory demonstration
2. **`conversations_cli.py`** - Interactive TUI for managing conversations
- Create/switch between conversations
- Send messages with streaming responses
- View message history
- Switch between agents
### Running the Examples
```bash
# Run the demo script
LETTA_API_KEY=your-key uv run letta/conversations/scripts/conversations_demo.py
# Run the interactive CLI
LETTA_API_KEY=your-key uv run letta/conversations/scripts/conversations_cli.py
# CLI with specific agent
LETTA_API_KEY=your-key uv run letta/conversations/scripts/conversations_cli.py --agent agent-xxx
```
## SDK Gotchas
- Paginated responses use `.items` to access the list: `client.agents.list().items`
- Auth parameter is `api_key`, not `token`: `Letta(base_url=..., api_key=...)`
- Message streams must be consumed (iterate or `list()`) to complete the request
From letta-ai/skills at 6785511, shown as plain text under its license: MIT (permissive). The license text is in letta/conversations/LICENSE.
View SKILL.md on GitHub at 6785511Files
- SKILL.md6.6 KB · 1f47b38591f7
- LICENSE1.1 KB · cffc4dad09f3
- scripts/
- conversations_cli.py15 KB · 5d43e435fdcb
- conversations_demo.py14 KB · bfe87ba4d509
4 files, 37 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 6785511More from Letta
acquiring-skills
Enables the agent to discover and install skills from multiple registries including Hermes Skills Hub, ClawHub, GitHub, and community repositories.
Agents not labelled yet · about 3.1K tokens · pinned 6 days ago
browser-use
Control a real browser using Chrome DevTools Protocol over WebSocket to navigate pages, interact with UI, fill forms, scrape sites, and capture screenshots or…
Claude Code, Codex, Cursor +4 · about 3.2K tokens · pinned 6 days ago
Context Doctor
Context Doctor investigates and repairs an agent's context including memory, system prompt, and skills by analyzing observed behavior as evidence.
Claude Code, Codex, Cursor +3 · about 1K tokens · pinned 6 days ago
creating-mods
This skill creates and edits mod files that extend local Letta instances with tools, slash commands, event handlers, custom model providers, permissions, and…
Claude Code, Codex, Cursor +4 · about 2.4K tokens · pinned 6 days ago
creating-skills
This skill guides developers in creating modular packages that extend Letta Code agent capabilities with specialized knowledge, workflows, tool integrations…
Contains scripts
Claude Code, Codex, Cursor +3 · about 4.5K tokens · pinned 6 days ago
curating-memory-palace
This skill lets the agent maintain a Memory Palace, a structured dashboard view that shows the user what the agent is working on, what it could do next, and…
Agents not labelled yet · about 3.1K tokens · pinned 6 days ago
Related in AI and agents
trl-training
This skill enables agents to post-train large language models using TRL (Transformers Reinforcement Learning) library, supporting supervised fine-tuning…
by Hugging FaceOfficial publisher
Claude Code, Codex, Cursor +4 · about 990 tokens · pinned 6 days ago
mcp-builder
This skill guides agents through building Model Context Protocol (MCP) servers that connect LLMs to external services via well-designed tools.
by SnykOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 2.2K tokens · pinned 6 days ago
claude-settings-audit
This skill analyzes a repository to detect its tech stack, build tools, and service integrations, then generates recommended Claude Code settings.json…
by SentryOfficial publisher
Claude Code · about 2.9K tokens · pinned 6 days ago
agents
Build voice AI agents with natural conversation capabilities using ElevenLabs platform.
by ElevenLabsOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 6.4K tokens · pinned 6 days ago
agent-observability-eval-bootstrap
Generates evaluators from production LLM traces by analyzing patterns and quality dimensions.
by DatadogOfficial publisher
Claude Code · about 24.5K tokens · pinned 6 days ago
iris-development
This skill integrates with Redis Agent Memory, a managed service on Redis Cloud that provides persistent memory for AI agents.
by RedisOfficial publisher
Claude Code, Codex, Cursor +4 · about 970 tokens · pinned 6 days ago
Open roles at Letta
4 open roles on the jobs board
- Research Engineer / Scientist, Post-Training
San Francisco, California, United States (On-site)
- Research Engineer / Scientist, Self-Improvement
San Francisco, California, United States (On-site)
- Software Engineer, Agent Harness
San Francisco, California, United States (On-site)
- Research Engineer / Scientist, Memory
San Francisco, California, United States (On-site)