SDK v1.0 Migration Guide
This guide covers migrating from Letta SDK v0.x (e.g., 1.0.0-alpha.2) to v1.0 (e.g., 1.0.0-alpha.10+). For agent architecture migrations, see the Architecture Migration Guide.
Overview
SDK v1.0 introduces breaking changes to improve consistency and align with modern API design patterns:
- Naming convention: All properties now use
snake_caseinstead ofcamelCase - Client initialization: Simplified client constructor with renamed parameters
- Method names: Several methods renamed for clarity
- Type imports: Types moved to subpath exports for better organization
- Enums: Replaced with string literal types
- Tool calls: Changed from single object to array structure
- Pagination: List methods now return page objects
Quick Reference
Package Update
Update your package dependency:
Import Changes
Client Instantiation
Breaking Changes by Category
1. Pagination
All list endpoints now use cursor-based pagination with consistent parameters:
Affected endpoints:
agents.list()- renamedsort_by→order_by,ascending→orderagents.messages.list()agents.tools.list()agents.blocks.list()agents.files.list()agents.folders.list()agents.groups.list()blocks.list()folders.list()folders.files.list()folders.passages.list()folders.agents.list()groups.list()groups.messages.list()identities.list()providers.list()runs.list()runs.messages.list()runs.steps.list()jobs.list()steps.list()tags.list()tools.list()batches.list()batches.messages.list()
2. Method Renames and Endpoint Restructuring
Many methods were reorganized for better SDK structure:
3. Deprecations
Several endpoints and fields are now deprecated:
Deprecated endpoints:
client.agents.search()- useclient.agents.list()with filtersclient.messages.search()- useclient.agents.messages.list()with filtersclient.runs.list_active()- useclient.runs.list(active=True)client.jobs.list_active()- useclient.jobs.list(active=True)client.folders.get_by_name()- useclient.folders.list(name="...")- MCP routes under
/tools/mcp/servers- replaced with new/mcp-serversendpoints- All old MCP methods moved from
client.tools.mcp.serverstoclient.mcp_servers - Now use server IDs and tool IDs instead of names
- All old MCP methods moved from
- Sources-related routes - replaced with folders
- Passages routes - replaced with archives
- Legacy agent architecture routes
- All
/countendpoints
Deprecated fields:
agent.memory- useagent.blocksstep.messages- useclient.steps.messages.list(step_id)agent.identity_ids- replaced withagent.identities(full objects)agent.multi_agent_group- renamed toagent.managed_groupuse_assistant_messageparameter - no longer neededtool_exec_environment_variables- renamed tosecrets
Deprecated on agent/block objects:
- Template-related fields:
is_template,base_template_id,deployment_id entity_id,preserve_on_migration,hiddennameon blocks (uselabel)
4. Property Names (camelCase → snake_case)
All API properties now use snake_case:
2. Agent Type Specification
3. Method Renames
4. Message Roles and Stop Reasons
Enums replaced with string literals:
5. Tool Calls Structure
Tool calls changed from single object to array:
6. Pagination
List methods now return page objects:
7. Date Handling
8. Archive Management (New APIs)
New endpoints for managing archival memory:
9. Identity and Block Management
New attach/detach patterns for identities and blocks:
10. Agent Configuration Updates
New parameters available for agent creation and updates:
11. Message Input Shorthand
Simplified syntax for sending simple user messages:
12. Attach/Detach Return Values
All attach/detach endpoints now return None instead of agent/object state:
Affected methods:
agents.tools.attach/detachagents.blocks.attach/detachagents.folders.attach/detachagents.archives.attach/detachagents.identities.attach/detachblocks.identities.attach/detach
13. Agent Import/Export Changes
Import endpoint now supports name overriding:
14. Query Parameter to Request Body Changes
Several endpoints moved from query parameters to request body:
15. Tags Endpoint
Tags list endpoint now uses name parameter instead of query_text:
16. Project ID Handling
Project ID is now passed in the client constructor or headers:
17. MCP (Model Context Protocol) Server Management
MCP routes have been completely restructured with new endpoints under /mcp-servers:
Key Changes:
- Namespace: Moved from
client.tools.mcp.serverstoclient.mcp_servers - Identification: Use server IDs and tool IDs instead of names
- Old:
serverName(string) → New:serverId(ID string like"mcp_server_123") - Old:
toolName(string) → New:toolId(ID string like"tool_456")
- Old:
- Tool Management: Tools are now automatically synced when creating a server
- No longer need to manually “add” individual tools
- Use
refresh()to resync tools (replacesresync())
- Tool Execution: Method renamed from
execute()torun() - Server Retrieval: New
retrieve()method to get individual server by ID - Tool Retrieval: New
retrieve()method to get individual tool by ID
Migration Example:
Notes:
- MCP servers and tools now have persistent IDs in the database
- Server names are no longer unique identifiers - use IDs instead
- Tool schemas are automatically kept in sync via the
refresh()endpoint - The old routes under
/tools/mcp/serversare deprecated and will be removed
Migration Examples
Complete Agent Creation
Streaming Messages
Handling Approvals
Updating Agent Configuration
Migration Checklist
Use this checklist to ensure a complete migration:
Core SDK Changes:
- Update package version to
1.0.0-alpha.10or later - Update all imports (client and types)
- Replace
LettaClientwithLetta - Update client constructor params:
token→apiKey,baseUrl→baseURL - Add
projectIdto client constructor if using multi-project setup - Convert all property names from
camelCasetosnake_case - Replace enum references with string literals
- Convert
Dateobjects to ISO strings where required - Update type annotations to use new import paths
Method Renames:
- Update
modify()calls toupdate() - Update
createStream()calls tostream() - Rename
summarize_agent_conversation()→messages.summarize() - Rename
cancel_agent_run()→messages.cancel() - Rename
preview_raw_payload()→messages.preview() - Rename
list_agent_files()→files.list() - Rename
export_agent_serialized()→export() - Rename
import_agent_serialized()→import() - Rename folder/provider method names (see section 2)
- Update telemetry routes to use
steps.trace()
Pagination:
- Update all list methods to access
.itemsproperty - Replace
sort_bywithorder_byinagents.list() - Replace
ascendingwithorderparameter - Update pagination parameters:
before,after,limit,order - Handle cursor-based pagination for all list endpoints
Message Handling:
- Handle
tool_callsas an array instead of single object - Update
identity_idsreferences to useidentities(full objects) - Replace
agent.memorywithagent.blocks - Update
step.messagesto usesteps.messages.list() - Consider using new
inputshorthand for simple messages
Deprecations:
- Remove usage of deprecated search endpoints
- Replace
list_active()withlist(active=True) - Remove
use_assistant_messageparameter - Replace
tool_exec_environment_variableswithsecrets - Remove template-related fields from agent/block objects
- Replace sources endpoints with folders
- Replace passages endpoints with archives
New Features:
- Update attach/detach methods (now return
None) - Use new archive management APIs if needed
- Update agent import to use
override_nameinstead ofappend_copy_suffix - Move query parameters to request body for affected endpoints
- Use new agent configuration parameters (
temperature,top_p, etc.)
MCP (Model Context Protocol) Changes:
- Migrate from
client.tools.mcp.serverstoclient.mcp_servers - Update MCP server references to use IDs instead of names
- Update MCP tool references to use IDs instead of names
- Remove manual tool “add” operations (tools auto-sync on server create)
- Replace
resync()calls withrefresh() - Replace
execute()calls withrun() - Add server/tool ID lookup logic if using names
- Update OAuth connection flow to use server IDs
Testing:
- Test all agent operations (create, update, message)
- Test streaming and approval flows
- Verify memory block operations still work
- Test pagination on list endpoints
- Test archive management if used
- Verify identity/block attach/detach operations
- Test agent import/export
Automated Migration Tools
Find and Replace Script
Use this script to help automate common replacements:
Always review automated changes! These scripts help with common patterns but cannot handle all edge cases. Test thoroughly after migration.
Troubleshooting
”Property ‘llmConfig’ does not exist” (TypeScript)
Cause: Property renamed to llm_config
Fix: Update all references to use snake_case
”Cannot read property ‘toolCallId’ of undefined”
Cause: tool_call changed to tool_calls (array)
Fix: Access the first element of the array
”items is not iterable”
Cause: Trying to iterate over page object instead of items array
Fix: Access the .items property first
”Cannot find module ‘@letta-ai/letta-client/resources/…’”
Cause: Types moved to subpath exports
Fix: Update imports to use new subpaths
”Method ‘modify’ does not exist”
Cause: Method renamed to update
Fix: Update all modify calls
”Cannot access property ‘identity_ids’”
Cause: Field renamed to identities and now returns full objects
Fix: Access the identities array and extract IDs if needed
”Pagination parameters ‘sort_by’ or ‘ascending’ not recognized”
Cause: Pagination parameters standardized to order_by and order
Fix: Update parameter names
”Attach/detach methods return undefined”
Cause: These methods now return None/void instead of updated state
Fix: Fetch the object separately if you need the updated state
”Cannot find method ‘summarize_agent_conversation’”
Cause: Method moved to messages subresource
Fix: Use the new path
”Query parameter ‘add_default_initial_messages’ not working”
Cause: Parameter moved from query to request body
Fix: Pass as request body parameter
”Cannot find ‘client.tools.mcp.servers’”
Cause: MCP routes moved to new namespace
Fix: Use new MCP server methods
”MCP server not found by name”
Cause: MCP methods now use server IDs instead of names
Fix: Lookup server ID from name first
”MCP tool ‘toolName’ not found”
Cause: MCP tool execution now uses tool IDs instead of names
Fix: Lookup tool ID from name first
”Method ‘execute’ not found on mcp_servers.tools”
Cause: Method renamed from execute() to run()
Fix: Use the new method name
Additional Resources
- Architecture Migration Guide - For migrating agent architectures
- API Reference - Complete SDK documentation
- Changelog - All SDK changes
- GitHub - Source code and issues
- Discord - Get help from the community
Getting Help
If you encounter issues during migration:
- Check the Changelog for detailed release notes
- Search GitHub Issues for known problems
- Ask in Discord #dev-help for community support
- Contact support@letta.com for enterprise support