Skip to content

[Feature]: Memory Export/Import Functionality #137

@Teingi

Description

@Teingi

Describe your use case

Users need to export their memories for backup, migration, or analysis purposes. They also need to import memories from external sources or restore from backups. Common scenarios include:

  • Creating backups before major updates
  • Migrating memories between different PowerMem instances
  • Analyzing memories in external tools (Excel, data analysis tools)
  • Sharing memory datasets between development and production
  • Compliance and audit requirements

Describe the solution you'd like

Implement export and import functionality that supports:

  1. Export formats:

    • JSON (structured, preserves all metadata)
    • CSV (human-readable, spreadsheet-friendly)
    • JSONL (line-delimited, for streaming large datasets)
  2. Export options:

    • Export all memories or filter by user_id, agent_id, date range, tags
    • Include/exclude metadata fields
    • Compress exports (gzip)
  3. Import functionality:

    • Validate import data format
    • Support batch import with progress tracking
    • Handle conflicts (skip, overwrite, or merge)
    • Rollback on errors
  4. API methods:

    memory.export(format="json", output_file="memories.json", user_id="user123")
    memory.import_from_file("memories.json", conflict_strategy="skip")

The solution should:

  • Preserve all memory metadata and relationships
  • Support large datasets efficiently (streaming for large exports)
  • Include data validation and error reporting
  • Be compatible with existing memory structure

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions