From Letta (MemGPT)
Import agent memories from Letta (formerly MemGPT) into Mnemosyne. Supports AgentFile (.af) format, SDK export, and REST API.
One Command
Via AgentFile (recommended)
Export your agent's memory from Letta as an .af file, then import it offline:
# In Letta: export your agent
letta agent export --agent-id abc123 --output my-agent.af
# Then import into Mnemosyne
hermes mnemosyne import --from letta --agent-file-path ./my-agent.af
Via API
hermes mnemosyne import --from letta --api-key sk-xxx --agent-id abc123
What Gets Imported
Letta stores memories in a hierarchical model. The importer converts each layer:
- Memory Blocks (core/working memory) → Mnemosyne working memory
- Archival Memory (long-term vector storage) → episodic memory with
source="letta_archival" - Message History → episodic memory with
source="letta_message" - Agent Config & Tools → metadata entries
Options
# Offline AgentFile import (no API key needed)
hermes mnemosyne import --from letta --agent-file-path ./agent.af
# Specific agent via API
hermes mnemosyne import --from letta --api-key sk-xxx --agent-id agent-123
# Self-hosted Letta
hermes mnemosyne import --from letta --api-key sk-xxx --base-url http://localhost:8283
# Dry run
hermes mnemosyne import --from letta --agent-file-path ./agent.af --dry-run
Extraction Methods
The Letta importer tries three methods in order:
- Offline AgentFile — Parses a local
.affile. No API key or network needed. - Python SDK (
pip install letta-client) — Usesclient.agents.export_file(agent_id). - REST API — Fetches memory blocks and archival search via HTTP.
If you have the .af file locally, method 1 is the simplest.
SDK Dependencies
pip install letta-client
Or use offline .af file import with no dependencies.
Identity Mapping
| Letta Source | Mnemosyne Field |
|---|---|
Memory block label | content |
Memory block value | content (or metadata if label exists) |
agent.name | author_id |
| Archival memory text | content with source="letta_archival" |
Message role + content | content with source="letta_message" |
created_at | Preserved in metadata |
Memory block limit / settings | Preserved in metadata |
Programmatic Import
from mnemosyne import Mnemosyne
from mnemosyne.core.importers import LettaImporter
mnemosyne = Mnemosyne(session_id="migration")
# Offline .af file
importer = LettaImporter(agent_file_path="./my-agent.af")
result = importer.run(mnemosyne)
# Via API
importer = LettaImporter(api_key="sk-xxx", agent_id="agent-123")
result = importer.run(mnemosyne, dry_run=True)
print(f"Imported {result.imported} of {result.total}")
Mnemosyne