Python SDK
pip install supermemory
JavaScript SDK
npm install supermemory
- TypeScript
- Python
Install the TypeScript SDK
Start a TypeScript client
namespace, then id where there is one), then a single object with everything else. A namespace scopes memories to one user, workspace, or tenant, and you pass it on every call.Add
dreaming defaults to "dynamic", which batches memory extraction. A fresh namespace can show zero memories and an empty profile for minutes. Pass dreaming: "instant" in quick-start flows and anywhere the next step is a memory search or a profile read.Search
searchMode is "hybrid" (default), "memories", or "chunks". Filter on metadata with a typed expression:threshold is now 0.3 (was 0.6) and searchMode is now hybrid (was memories). Set both explicitly if you compare results against old code.Profile
List
type is required: "documents", "chunks", or "memories". The response always has documents, chunks, memories, and pagination, and only the requested array is filled. Pass { filter } to narrow the list.Documents
uploadFile is multipart, so metadata is a JSON string there. delete can return partial failures, so check errors as well as count.Memories
dryRun is required on forgetMatching. Preview with dryRun: true, review matches, then forget by id. There is no direct memory create or update: ingest or update the source document instead.Namespaces
Organization
Connectors
notion, google-drive, onedrive, gmail, github) return an authorization link. Config providers start syncing right away and return authorization: null:sync returns { id, status: "queued" } and responds with 409 if a sync is already running.Error handling
Every HTTP error throws aSupermemoryError with statusCode, body, and rawResponse. Common statuses have their own subclasses, all exported from the package root: BadRequestError (400), UnauthorizedError (401), PaymentRequiredError (402), ForbiddenError (403), NotFoundError (404), ConflictError (409), InternalServerError (500), and ServiceUnavailableError (503). A timeout throws SupermemoryTimeoutError; a network failure is a SupermemoryError without a statusCode.