Skip to main content
MemSDK extracts Supermemory’s public API surface into a backend-agnostic TypeScript contract. Application code can target one memory interface, then swap adapters without rewriting its memory layer.
“Oh wow that is awesome.” Dhravya Shah, founder of Supermemory

The problem

Every AI memory backend ships a different SDK. Moving from Supermemory to Letta to another backend usually means rewriting document add, search, forget, and list workflows even when the product behavior is conceptually the same.

The approach

MemSDK freezes a proven interface instead of inventing a new one. It provides:
  • SupermemoryInterface as a type-level contract.
  • Zod schemas for runtime request validation.
  • Adapters that prove the contract can map to real backends.

Repositories

Installation

Both memsdk and its adapters are distributed directly from GitHub. They are not currently published to the npm registry. Install the core package with any npm-compatible package manager:
Install a backend adapter (e.g. Letta):
For reproducible installs, pin to a tag or commit:
Packages build from source during installation via prepare, then expose compiled ESM entrypoints and TypeScript declarations from dist.

Runtime support

memsdk is plain ESM compiled with tsc. Zod is the only runtime dependency, and the package declares no engines constraint. Runtime support therefore comes down to how the package is resolved, not runtime-specific code: Because memsdk is primarily a TypeScript contract plus Zod schemas, browser and edge use should go through a bundler today. Direct <script>/CDN usage is not a supported distribution path yet. Publishing to the npm registry would unblock Deno npm: specifiers, browser CDNs, and edge registries from a single artifact. Adapters such as memsdk-letta depend on backend SDKs and should run server-side unless browser bundling has been validated for your app.

Usage

Use the core contract to write backend-agnostic app code:
search is a callable top-level method on the contract. The legacy search.documents, search.execute, and search.memories variants are deprecated; use client.search() for v4 memory search.

Raw API to typed results

Before: a raw HTTP call against a memory backend, with an untyped response shape you must match by hand:
After: the same call through the MemSDK contract, with request validation and typed results:

Wire in an adapter

Status

MemSDK is useful when you want memory portability more than hosted-memory lock-in. The public surface focuses on memory-domain methods first: add, profile, documents, search, and memories.