diff --git a/apps/docs/migration/api-v5.mdx b/apps/docs/migration/api-v5.mdx index 283cc500..4c19cdd5 100644 --- a/apps/docs/migration/api-v5.mdx +++ b/apps/docs/migration/api-v5.mdx @@ -17,12 +17,17 @@ import Namespaces from "/snippets/api-v5-namespaces.mdx"; import Organization from "/snippets/api-v5-organization.mdx"; import Filters from "/snippets/api-v5-filters.mdx"; import Rollout from "/snippets/api-v5-rollout.mdx"; +import Sdks from "/snippets/api-v5-sdks.mdx"; import Completion from "/snippets/api-v5-completion.mdx"; +## SDKs, tools and the CLI + + + ## Document ingestion diff --git a/apps/docs/snippets/api-v5-completion.mdx b/apps/docs/snippets/api-v5-completion.mdx index 87a37330..1e8895e8 100644 --- a/apps/docs/snippets/api-v5-completion.mdx +++ b/apps/docs/snippets/api-v5-completion.mdx @@ -3,5 +3,7 @@ - Direct memory creation and version updates: ingest or replace a source document instead. - Organization bucket suggestion and organization reset: not part of the v5 public surface. - Connector routes that still use `/v3`: unchanged; do not rewrite them. +- Conversation ingestion (`/v4/conversations`): not part of the v5 public surface. Send the transcript as a document instead. +- Container-tag merges: not part of the v5 public surface. -Use `/v5/reference` for the stable v5 reference. `/reference` always points to the latest public version. +Use the [v5 reference](https://api.supermemory.ai/v5/reference) for the stable v5 API. [`/reference`](https://api.supermemory.ai/reference) always points to the latest public version. diff --git a/apps/docs/snippets/api-v5-overview.mdx b/apps/docs/snippets/api-v5-overview.mdx index 6bc741e6..7d8b6743 100644 --- a/apps/docs/snippets/api-v5-overview.mdx +++ b/apps/docs/snippets/api-v5-overview.mdx @@ -4,7 +4,7 @@ This is a breaking API migration. Do not change only the URL: fields moved, search defaults changed, response envelopes changed, and some legacy operations have no v5 replacement. -The API base URL and bearer keys do not change. v5 application routes are unversioned; `/v5/reference` identifies the documentation version, not an API path prefix. +The API base URL and bearer keys do not change. v5 application routes are unversioned; [`/v5/reference`](https://api.supermemory.ai/v5/reference) is the interactive v5 reference, not an API path prefix. ## Recommended migration process diff --git a/apps/docs/snippets/api-v5-sdks.mdx b/apps/docs/snippets/api-v5-sdks.mdx new file mode 100644 index 00000000..c8dc8a85 --- /dev/null +++ b/apps/docs/snippets/api-v5-sdks.mdx @@ -0,0 +1,42 @@ +Check which client you call the API through before you translate requests. Not every client supports v5 yet. + +| Client | v5 support | What to do | +| --- | --- | --- | +| TypeScript SDK (`supermemory` on npm) | `5.0.0-rc.5` and later | Install `supermemory@rc` and follow the SDK changes below. Release candidates before `rc.5` still use the v3/v4 surface. | +| Python SDK (`supermemory` on PyPI) | Not yet | The 3.x SDK calls v3/v4. Call v5 over HTTP as shown in this guide, or keep the SDK on v3/v4 until a v5 release ships. | +| `@supermemory/tools` (AI SDK, OpenAI and agent integrations) | Not yet | These call v3/v4 (`/v4/profile`, `/v4/conversations`). No change needed today. | +| CLI (`npx supermemory`) and `supermemory local` | Unchanged | The CLI calls v3/v4 directly and keeps working. No change needed. | + +### TypeScript SDK changes + +The v5 SDK scopes every content call to one `namespace` and moves the payload under `body`: + +```ts +import Supermemory from "supermemory"; + +const client = new Supermemory(); // reads SUPERMEMORY_API_KEY, as before + +// v4 +await client.add({ content: "Alex prefers morning meetings.", containerTag: "user_alex" }); + +// v5 +await client.add({ + namespace: "user_alex", + body: { content: "Alex prefers morning meetings." }, +}); +``` + +| v4 | v5 | +| --- | --- | +| `client.search.memories({ q, containerTag })` | `client.search({ namespace, body: { query } })` | +| `client.profile({ containerTag, q })` | `client.profile({ namespace })`, plus `client.search` in parallel if you need results | +| `client.documents.list(...)`, `client.memories.list(...)` | `client.list({ namespace, type })` | +| `client.containerTags.*` | `client.namespaces.*` | +| `client.settings.{get, update}` | `client.organization.{get, update}` | +| Errors per status (`RateLimitError`, …) | One `SupermemoryError`; branch on `statusCode` | +| Retries on by default | Retries are opt-in through `retryConfig` | +| `timeout` | `timeoutMs` | + +The v5 SDK drops methods that have no v5 endpoint: `connections`, `conversations.add`, `settings.{reset, suggestBuckets}`, `containerTags.{merge, mergeStatus}`, `memories.{add, updateMemory}`, and `documents.{listProcessing, chunks, fileUrl, search}`. Stay on `supermemory@4` for those calls. + +The full method map is in the SDK's [migration guide](https://github.com/supermemoryai/sdk-ts/blob/main/MIGRATION.md). diff --git a/apps/docs/v5/api-reference/overview.mdx b/apps/docs/v5/api-reference/overview.mdx index 94b79278..7d3dfa1f 100644 --- a/apps/docs/v5/api-reference/overview.mdx +++ b/apps/docs/v5/api-reference/overview.mdx @@ -18,7 +18,7 @@ https://api.supermemory.ai /organization ``` -Use `/v5/reference` for the stable v5 reference. `/reference` always points to the latest public version. +Use the [v5 reference](https://api.supermemory.ai/v5/reference) for the stable v5 API. [`/reference`](https://api.supermemory.ai/reference) always points to the latest public version.