Exporting Archival Memories
Export all passages from an agent's archival memory
Overview
You can export all archival memories (passages) from an agent programmatically using the Letta SDK. This is useful for:
- Backing up agent knowledge
- Analyzing what an agent has learned
- Migrating memories between agents
- Auditing archival content
Export script
Below is a Python script that paginates through all of an agent’s archival memories and exports them to a JSON file:
export_agent_memories.py
Usage
Prerequisites
Install the Letta Python SDK:
Set your API key:
Running the script
Export all memories from an agent:
Specify a custom output file:
Adjust pagination size:
Output format
The script exports passages as a JSON array. Each passage contains all fields except embedding and embedding_config: