Overview
MemorySync ships two official client libraries — one for Python and one for Node.js / TypeScript — plus a fully documented HTTP API you can call from any language. Each client wraps the same JSON endpoints with typed methods, per-request timeouts, and structured error classes.
The two official clients
There are exactly two official packages. The package names below are what you install — anything else you may see is unofficial.
| Client | Package | Constructor | Install command |
|---|---|---|---|
| Python | memorysync | MemorySyncClient | pip install memorysync |
| Node.js / TypeScript | memorysync-sdk | MemorySyncClient | npm install memorysync-sdk |
memorysync-sdk. Both export a class called MemorySyncClient.What the clients cover
Every method on a client maps one-to-one to a public memory route. There are no helper endpoints invented by the SDKs — if a method exists, the route exists.
| Method | What it does |
|---|---|
| add | Submit a single piece of text for storage. |
| bulkAdd / bulk_add | Submit up to 50 items in one call with optional deduplication. |
| query | Run a semantic recall against the caller’s memories. |
| get | Fetch a single memory by its numeric id. |
| update | Patch tags, importance, metadata, source, or event type on an existing memory. |
| forget | Delete one or more memories by id. |
| summarize | Collapse a list of memories into one summary memory. |
| compose | Produce a prompt by recalling memories into a token budget. |
| exportAll / export_all | Download every memory the caller can read. |
| createRelation / create_relation | Link two memories with a typed relationship. |
The shape of every call
Whatever language you use, the lifecycle is the same: build a client once with your API key, call a typed method, get a typed result back or a typed error. The clients never throw bare strings.
from memorysync import MemorySyncClientclient = MemorySyncClient(api_key="ms_live_...",base_url="https://api.memorysync.io",end_user_id="user_123", # required for API-key auth)created = client.add(text="Picked the audit log schema we discussed.", tags=["decision"])hits = client.query("audit log schema", k=5)
import { MemorySyncClient } from "memorysync-sdk";const client = new MemorySyncClient({apiKey: process.env.MEMORYSYNC_API_KEY!,baseUrl: "https://api.memorysync.io",endUserId: "user_123", // required for API-key auth});const created = await client.add({ text: "Decided to ship behind a flag.", tags: ["decision"] });const hits = await client.query({ query: "decision behind a flag", k: 5 });
One REST surface, two clients
Both clients hit the exact same REST endpoints with the exact same JSON bodies. If you read the cURL guide and a TypeScript example side by side, you will see the same field names. That is intentional — switching from one client to the other is a syntactic change, not a behavioural one.
Errors are typed and uniform
Both clients ship the same six error classes, named identically. You can write retry logic once and apply it to either runtime.
AuthError— HTTP 401 / 403NotFoundError— HTTP 404ValidationError— HTTP 400 / 409 / 422 and client-side guardsRateLimitError— HTTP 429, exposes the retry intervalServerError— HTTP 5xxMemorySyncError— the base class; network failures and timeouts also surface as this
Picking a client
- If your service is in Python, install
memorysync. The sync client is the default; the async client is one extra import when you need it. - If your service is in Node.js, Deno, or any TypeScript runtime that has global
fetch, installmemorysync-sdk. - If your service is in any other language, hit the REST endpoints directly. The cURL and Postman guides show the full request and response shapes for every route the SDKs expose.
Where to go next
- Language-Agnostic Patterns — idempotency, retries, scoping headers.
- Python SDK — full method reference and async usage.
- Node SDK — constructor, methods, bulk operations.
- REST from cURL — the underlying HTTP surface.