Import / Export
Export agents to files and import them back.
export agent
Export an agent's configuration to a file. Supports Letta-native JSON or git-trackable YAML formats.
lettactl export agent <name> [options]Options
| Flag | Type | Description |
|---|---|---|
| --format, -f | json | yaml = json | Export format |
| --output, -o | string | Output file path |
| --legacy-format | boolean | Use legacy v1 export format |
| --skip-first-message | boolean | Omit first_message from YAML export |
| --max-steps | number | Limit exported processing steps |
Examples
Export as YAML
lettactl export agent my-agent -f yaml -o agent.yamlExport as JSON
lettactl export agent my-agent -o backup.jsonimport
Import an agent from a previously exported file.
lettactl import <file> [options]Options
| Flag | Type | Description |
|---|---|---|
| --name | string | Override the agent name |
| --append-copy | boolean | Add '_copy' suffix to avoid name conflicts |
| --embedding | string | Override embedding model |
| --override-tools | boolean | Overwrite existing tool source code |
| --strip-messages | boolean | Remove message history from import |
| --secrets | string | Inject secrets as JSON |
| --env-vars | string | Inject environment variables as JSON |
Examples
Basic import
lettactl import backup.jsonImport with new name
lettactl import backup.json --name 'my-agent-v2'Clean import
lettactl import backup.json --strip-messages --append-copy