一键导入
letta-development-guide
// Comprehensive guide for developing Letta agents, including architecture selection, memory design, model selection, and tool configuration. Use when building or troubleshooting Letta agents.
// Comprehensive guide for developing Letta agents, including architecture selection, memory design, model selection, and tool configuration. Use when building or troubleshooting Letta agents.
Configures Letta agent compaction settings and custom summarization prompts. Use when a user asks to change an agent's compaction prompt, improve summaries after context eviction, tune sliding-window or all-message compaction, or design companion/coding-agent continuity summaries.
Navigates archived ChatGPT or Claude-style conversation exports and a MemFS reference archive on demand. Use when recalling what a past assistant knew, searching old conversations, rendering specific chats, seeding reference memory from export sidecars, or mining historical context without doing a full import.
Migrates deprecated Letta Filesystem folders/files to MemFS using markdown document corpora, chunking, local lexical search, and QMD semantic search via the memfs-search skill. Use when replacing folders.files.upload, working with PDFs or document QA, or emulating open_file, grep_file, and search_file behavior.
Semantic search over agent memory files. Use when you need to find conceptually related memory blocks, discover forgotten reference files, check what you already know before creating new memory, or search beyond exact keyword matching. Currently supports QMD (local, no API keys).
Builds and debugs Letta Code channels, including first-party channel adapters and dynamic user channel plugins under ~/.letta/channels. Use when adding Telegram, WhatsApp, Bluesky, Slack, Discord, or custom channel support; testing channel routing, pairing, MessageChannel, runtime dependencies, or channel plugin manifests.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
| name | letta-development-guide |
| description | Comprehensive guide for developing Letta agents, including architecture selection, memory design, model selection, and tool configuration. Use when building or troubleshooting Letta agents. |
| license | MIT |
Comprehensive guide for designing and building effective Letta agents with appropriate architectures, memory configurations, model selection, and tool setups.
Use this skill when:
from letta_client import Letta
client = Letta()
agent = client.agents.create(
name="my-assistant",
model="openai/gpt-4o",
embedding="openai/text-embedding-3-small",
memory_blocks=[
{"label": "persona", "value": "You are a helpful assistant."},
{"label": "human", "value": "The user's name and preferences."},
],
)
# Send a message
response = client.agents.messages.create(
agent_id=agent.id,
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.messages[-1].content)
Use letta_v1_agent when:
Use memgpt_v2_agent when:
For detailed comparison, see references/architectures.md.
Memory is the foundation of effective agents. Letta provides three memory types:
Core Memory (in-context):
Archival Memory (out-of-context):
Conversation History:
See references/memory-architecture.md for detailed guidance.
Core principle: One block per distinct functional unit.
Essential blocks:
persona: Agent identity, behavioral guidelines, capabilitieshuman: User information, preferences, contextAdd domain-specific blocks based on use case:
company_policies, product_knowledge, customerproject_context, coding_standards, current_taskschedule, preferences, contactsMemory block guidelines:
See references/memory-patterns.md for domain examples and references/description-patterns.md for writing effective descriptions.
Match model capabilities to agent requirements:
For production agents:
Avoid for production:
See references/model-recommendations.md for detailed guidance.
Start minimal: Attach only tools the agent will actively use.
Common starting points:
Tool Rules: Use to enforce sequencing when needed (e.g., "always call search before answer")
Consult references/tool-patterns.md for common configurations.
When approaching character limits:
customer_profile → customer_business, customer_preferencesinteraction_history → recent_interactions, archive older to archival memorySee references/size-management.md for strategies.
When multiple agents share memory blocks or an agent processes concurrent requests:
Safest operations:
memory_insert: Append-only, minimal race conditionsRisk of race conditions:
memory_replace: Target string may change before writememory_rethink: Last-writer-wins, no mergeBest practices:
Consult references/concurrency.md for detailed patterns.
Before finalizing your agent design:
Architecture:
Memory:
Tools:
Too few memory blocks:
# Bad: Everything in one block
agent_memory: "Agent is helpful. User is John..."
Split into focused blocks instead.
Too many memory blocks: Creating 10+ blocks when 3-4 would suffice. Start minimal, expand as needed.
Poor descriptions:
# Bad
data: "Contains data"
Provide actionable guidance instead. See references/description-patterns.md.
Ignoring size limits: Letting blocks grow indefinitely until they hit limits. Monitor and manage proactively.
Python:
from letta_client import Letta
client = Letta() # Uses LETTA_API_KEY env var
# Create agent with custom memory blocks
agent = client.agents.create(
name="my-agent",
model="openai/gpt-4o", # or "anthropic/claude-sonnet-4-20250514"
embedding="openai/text-embedding-3-small",
memory_blocks=[
{"label": "persona", "value": "You are a helpful assistant..."},
{"label": "human", "value": "User preferences and context..."},
{"label": "project", "value": "Current project details..."},
],
description="Agent for helping with X",
)
print(f"Created agent: {agent.id}")
TypeScript:
import Letta from "letta-client";
const client = new Letta();
const agent = await client.agents.create({
name: "my-agent",
model: "openai/gpt-4o",
embedding: "openai/text-embedding-3-small",
memoryBlocks: [
{ label: "persona", value: "You are a helpful assistant..." },
{ label: "human", value: "User preferences and context..." },
{ label: "project", value: "Current project details..." },
],
description: "Agent for helping with X",
});
console.log(`Created agent: ${agent.id}`);
Note: Letta Code CLI (letta command) creates agents interactively. Use letta --new-agent to start fresh, then /rename and /description to configure.
For detailed information on specific topics, consult the reference materials:
references/architectures.md - Architecture comparison and selectionreferences/memory-architecture.md - Memory types and when to use themreferences/memory-patterns.md - Domain-specific memory block examplesreferences/description-patterns.md - Writing effective block descriptionsreferences/size-management.md - Managing memory block size limitsreferences/concurrency.md - Multi-agent memory sharing patternsreferences/model-recommendations.md - Model selection guidancereferences/tool-patterns.md - Common tool configurations