feat(tools,docs): add full export and list API helpers for memories (#1653) - #1657
Open
Adityakk9031 wants to merge 3 commits into
Open
Adityakk9031 wants to merge 3 commits into
Adityakk9031 wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #1653
This PR introduces comprehensive listing, exhaustive pagination, and export tools for distilled memories (memory entries) across both self-hosted and cloud Supermemory deployments:
@supermemory/tools):listMemoriesRequest: Direct caller for the/v4/memories/listendpoint with container tags, pagination, and sorting.fetchAllMemories: Auto-paginating helper that iterates through all pages to retrieve all memory entries for a container tag.exportMemoriesAsJson: Full JSON backup serializer with metadata (exportedAt,totalCount,containerTag,baseUrl).exportMemoriesAsMarkdown: Human-readable Markdown export format with revision histories and source document references.supermemory-export):supermemory-exportCLI in@supermemory/tools/binfor terminal-based backups (bunx @supermemory/tools supermemory-export --tag user_123 --out backup.json --url http://localhost:6767)./v3/documents) and extracted memory cards (/v4/memories/list)..supermemory/dataSMD1 format) is unsupported and how the HTTP API provides a clean, portable backup path.POST /v4/memories).apps/docs/docs.jsonunder Deployment > Supermemory local, andapps/docs/self-hosting/overview.mdx.packages/tools/src/export-memories.test.tsvalidating request formation, pagination, soft-forgotten memory filtering, and JSON/Markdown outputs.Testing
bun test src/export-memories.test.ts(6 passing).bun test src/tools-shared.test.ts src/export-memories.test.ts(19 passing).bun run ./bin/supermemory-export.ts --helpruns and outputs correct usage.