Skip to content

feat: Clean JSONL export/import for memories #232

Description

@ajianaz

What

Wire /export and /import endpoints so users can export memories to JSONL and import them back (backup, migration, transfer between namespaces).

Why

No backup/export path = data lock-in. Users need a way to:

  • Backup memories before major lifecycle operations
  • Migrate between namespaces or instances
  • Share memory sets between agents

How

Endpoints

Endpoint Method Return
GET /export ?namespace=X&format=jsonl -> JSONL stream Existing
POST /import JSONL body -> {imported, skipped, errors} Existing

Implementation

Layer 0-2: Standard pattern. Export returns streaming text, import sends JSONL body.

Layer 3 — Settings or Tools menu:

  • Export:
    • Namespace selector (or "all")
    • [Export to JSONL] -> native file save dialog
    • Progress indicator for large exports
  • Import:
    • [Import JSONL] -> native file open dialog
    • Preview: show count, first 5 entries
    • Confirmation: "Import N memories? Duplicates will be skipped."
    • Result: "Imported N, skipped N duplicates, N errors"

Safety

  • Import always dedup (skip existing IDs)
  • Preview before commit
  • Export includes metadata (version, timestamp, namespace)

Testing

  • Export creates valid JSONL file
  • Import reads JSONL -> creates memories
  • Import skips duplicates
  • Import shows error count for malformed entries
  • Round-trip: export -> import -> same data

Related Issues

  • Part of: Phase 2B endpoint gap fill

Checklist

  • Layer 0-3 for /export and /import
  • File save dialog for export
  • File open dialog + preview for import
  • Result summary

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions