From Zep

Import memories from Zep into Mnemosyne. Zep is a cloud-hosted enterprise memory platform with a temporal knowledge graph. Because Zep has no bulk export API, extraction happens session by session.

One Command

hermes mnemosyne import --from zep --api-key sk-xxx

The importer automatically discovers all users, iterates their sessions, and pulls memory, facts, and summaries from each.

What Gets Imported

  • Session Messages → Working memory with source="zep_message" and author_id from the message sender
  • Entity Facts → Working memory with source="zep_fact"
  • Session Summaries → Working memory with source="zep_summary"
  • Temporal Graph Facts → Mnemosyne triples (via mnemosyne_triple_add)

Options

# Filter by specific user
hermes mnemosyne import --from zep --api-key sk-xxx --user-id alice

# Limit sessions (useful for large accounts)
hermes mnemosyne import --from zep --api-key sk-xxx --max-sessions 50

# Dry run
hermes mnemosyne import --from zep --api-key sk-xxx --dry-run

Important: No Bulk Export

Zep has no export_all() or bulk download endpoint. The importer works by:

  1. Listing all users via client.user.list_ordered()
  2. For each user, listing all sessions
  3. For each session, calling client.memory.get(session_id) to pull messages, facts, and summaries

This means extraction time scales with your session count. If you have thousands of sessions, use --max-sessions to limit the run, or process users in batches.

Agentic Fallback

If the Zep importer cannot extract everything (network limits, API constraints), use the agentic fallback:

# Generate a migration script for your Zep data
hermes mnemosyne import --from zep --generate-script

# Generate instructions for your AI agent to handle the migration
hermes mnemosyne import --from zep --agentic

SDK Dependencies

pip install zep-cloud

Identity Mapping

Zep SourceMnemosyne Field
Message contentcontent
role / role_typeuser/humanauthor_type = human
role / role_typeassistant/agentauthor_type = agent
Message user_idauthor_id
Session user_idchannel_id
created_attimestamp preserved in metadata
Facts (entity triples)Mnemosyne triples
Session summarycontent with source="zep_summary"

Programmatic Import

from mnemosyne import Mnemosyne
from mnemosyne.core.importers import ZepImporter

mnemosyne = Mnemosyne(session_id="migration")

importer = ZepImporter(
    api_key="sk-xxx",
    user_id="alice",          # optional filter
    max_sessions=50,          # limit to recent sessions
)

result = importer.run(mnemosyne, dry_run=True)

print(f"Imported {result.imported} of {result.total}")
print(f"Skipped: {result.skipped}, Failed: {result.failed}")