mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-10 03:28:14 +00:00
docs(api): SDK, tools and CLI status in the v5 migration guide
- New "SDKs, tools and the CLI" section: TypeScript SDK is v5 from 5.0.0-rc.5 (earlier RCs still v3/v4), Python SDK and @supermemory/tools still on v3/v4, CLI and `supermemory local` unaffected; v4 -> v5 SDK call map and dropped methods, linking the SDK's MIGRATION.md - Link /v5/reference and /reference to api.supermemory.ai - List conversation ingestion and container-tag merges as having no v5 replacement Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0a9b796f85
commit
60fd86132d
5 changed files with 52 additions and 3 deletions
|
|
@ -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";
|
||||
|
||||
<AgentPrompt />
|
||||
|
||||
<Overview />
|
||||
|
||||
## SDKs, tools and the CLI
|
||||
|
||||
<Sdks />
|
||||
|
||||
## Document ingestion
|
||||
|
||||
<DocumentIngestion />
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
</Warning>
|
||||
|
||||
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
|
||||
|
||||
|
|
|
|||
42
apps/docs/snippets/api-v5-sdks.mdx
Normal file
42
apps/docs/snippets/api-v5-sdks.mdx
Normal file
|
|
@ -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).
|
||||
|
|
@ -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.
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Migrate to v5" icon="arrow-up-right" href="/migration/api-v5">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue