Skip to content

feat(memos-local): add data export endpoint and UI (closes #1474)#1475

Merged
syzsunshine219 merged 2 commits into
MemTensor:dev-v2.0.23from
owensun6:feat/export-memories
Jul 9, 2026
Merged

feat(memos-local): add data export endpoint and UI (closes #1474)#1475
syzsunshine219 merged 2 commits into
MemTensor:dev-v2.0.23from
owensun6:feat/export-memories

Conversation

@owensun6

Copy link
Copy Markdown
Contributor

Summary

Implements the data export feature requested in #1474.

  • GET /api/export?format=json — downloads a full backup of all memories, tasks, and skills as a single JSON file (memos-export-YYYY-MM-DDTHH-MM-SS.json)
  • GET /api/export?format=csv — downloads memories only as CSV with ISO 8601 timestamps (memos-memories-YYYY-MM-DDTHH-MM-SS.csv)
  • Settings → General tab — two export buttons added under a new "Export Data" section, with i18n support (English + Chinese)

Changes

File What changed
src/storage/sqlite.ts SqliteStore.exportAll() and exportMemoriesAsCsv() methods
src/viewer/server.ts GET /api/export route + handleExport() handler
src/viewer/html.ts Export UI section, exportData() JS helper, i18n keys

Test plan

  • Open Memory Viewer → Settings → General, scroll to "Export Data"
  • Click "Export JSON (full backup)" — verify file downloads with memories, tasks, skills arrays
  • Click "Export CSV (memories only)" — verify file opens in spreadsheet with correct columns
  • Verify filenames include timestamp
  • Verify existing tests still pass: npx vitest run

Context

I'm an OpenClaw user and ran into the lack of backup/export while working with the plugin daily. The pre-existing test failures (embedding fetch errors, update-install) are network-dependent and present on main before this PR.

- SqliteStore.exportAll(): dump all memories/tasks/skills as JSON
- SqliteStore.exportMemoriesAsCsv(): memories-only CSV with ISO timestamps
- GET /api/export?format=json|csv endpoint in ViewerServer
- Export buttons in Settings → General tab (i18n: en + zh)
- exportData() JS helper triggers file download via <a> click

Closes MemTensor#1474
@Memtensor-AI Memtensor-AI changed the base branch from main to dev-20260604-v2.0.19 June 10, 2026 15:38
@Memtensor-AI Memtensor-AI changed the base branch from dev-20260604-v2.0.19 to dev-v2.0.22 July 1, 2026 13:18
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Automated Test Results: PASSED

Cloud test-engine rerun against dev-v2.0.22 completed successfully after migrating this run from the old 10010 queue to the updated cloud test-engine.

  • Run: tr-52aed831-152 on cloud test-engine 10011
  • Scope: memos_local_openclaw/unit
  • Result: 2 passed, 0 failed, 0 skipped

Manual code review is still required before merge.

@CarltonXiang CarltonXiang deleted the branch MemTensor:dev-v2.0.23 July 3, 2026 07:25
@syzsunshine219 syzsunshine219 reopened this Jul 3, 2026
@syzsunshine219 syzsunshine219 changed the base branch from dev-v2.0.22 to main July 3, 2026 08:24
@Memtensor-AI Memtensor-AI added area:plugin OpenClaw & Hermes area:api 云服务 / FastAPI / OpenAPI / MCP labels Jul 8, 2026
@Memtensor-AI Memtensor-AI requested a review from bittergreen July 8, 2026 11:44
@Memtensor-AI Memtensor-AI removed the area:api 云服务 / FastAPI / OpenAPI / MCP label Jul 9, 2026
@syzsunshine219 syzsunshine219 changed the base branch from main to dev-v2.0.23 July 9, 2026 03:00
@syzsunshine219 syzsunshine219 merged commit 365bd8b into MemTensor:dev-v2.0.23 Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:plugin OpenClaw & Hermes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants