Official TypeScript client for Momo. Published as @momomemory/sdk on npm.
npm install @momomemory/sdk
Requires Node.js 18+ or Bun. ESM-only.
import { MomoClient } from "@momomemory/sdk";
const momo = new MomoClient({
baseUrl: "http://localhost:3000",
defaultContainerTag: "my-app",
const doc = await momo.documents.create({
content: "TypeScript was released in 2012 by Microsoft.",
const results = await momo.search.search({
q: "When was TypeScript created?",
const { memories } = await momo.memories.list({ limit: 10 });
await momo.memories.forgetById("mem-id", { reason: "outdated" });
| Option | Type | Description |
|---|
baseUrl | string | Momo server URL |
apiKey | string | Static API key for Bearer auth |
getApiKey | () => string | Promise<string> | Dynamic key provider |
defaultContainerTag | string | Container tag applied to all scoped requests |
fetch | typeof fetch | Custom fetch implementation |
All API errors are thrown as MomoError:
import { MomoClient, MomoError } from "@momomemory/sdk";
const momo = new MomoClient({ baseUrl: "http://localhost:3000" });
await momo.documents.get("nonexistent");
if (e instanceof MomoError) {
console.error(e.code); // "not_found" | "unauthorized" | ...
console.error(e.status); // 404
console.error(e.message); // Human-readable message
console.error(e.path); // "/api/v1/documents/nonexistent"
console.error(e.method); // "GET"
Error codes: invalid_request, unauthorized, not_found, conflict, internal_error, not_implemented.
| Method | Description |
|---|
create(body) | Create a text document |
batchCreate(body) | Create multiple documents |
upload(file, options?) | Upload a file |
uploadFromPath(path, options?) | Upload from a file path (Node/Bun) |
get(documentId, options?) | Fetch a document |
update(documentId, body, options?) | Update document metadata |
delete(documentId, options?) | Delete a document |
list(params?, options?) | List documents |
getIngestionStatus(ingestionId, options?) | Poll ingestion status |
| Method | Description |
|---|
create(body, options?) | Create a memory |
get(memoryId, options?) | Fetch a memory |
update(memoryId, body, options?) | Update a memory |
list(params?, options?) | List memories |
forget(body, options?) | Content-based forget |
forgetById(memoryId, body?, options?) | Forget by ID |
| Method | Description |
|---|
search(body, options?) | Hybrid search across documents and memories |
| Method | Description |
|---|
ingest(body, options?) | Ingest a conversation thread |
| Method | Description |
|---|
getMemoryGraph(memoryId, params?, options?) | Graph for a memory |
getContainerGraph(tag, params?, options?) | Graph for a container |
| Method | Description |
|---|
compute(body, options?) | Compute a container profile |
| Method | Description |
|---|
runForgetting(options?) | Trigger a forgetting pass |
| Method | Description |
|---|
check(options?) | Check server health |
The underlying openapi-fetch client is exposed for direct API access:
const { data, error } = await momo.raw.GET("/api/v1/health");
The raw client shares the same auth and envelope-unwrapping middleware.