@memo9/sdk
v0.1.0
Published
TypeScript client SDK for the memo9 memory API — multi-tenant memory store with subjects, memory blocks, connections, and hybrid keyword/vector search.
Maintainers
Readme
@memo9/sdk
TypeScript client SDK for the memo9 memory API — a multi-tenant memory store with subjects, memory blocks, connections, and hybrid keyword/vector search.
Install
pnpm add @memo9/sdk
# or
npm install @memo9/sdk
# or
yarn add @memo9/sdkRequires Node.js 18+ (uses native fetch) or any modern browser.
Quick start
import { Memo9Client } from '@memo9/sdk';
const client = new Memo9Client({
baseUrl: 'https://api.your-memo9.example.com',
tenantId: 'tenant-a',
token: process.env.MEMO9_TOKEN, // optional bearer token
});
// Create a memory
const { id } = await client.memories.create({
title: 'Project kickoff notes',
content: 'Discussed Q2 goals and team structure...',
contentType: 'text',
subjects: [{ type: 'project', externalId: 'proj-42' }],
});
// Hybrid search
const results = await client.memories.search({
query: 'Q2 goals',
limit: 10,
});
// List subjects
const { results: subjects } = await client.subjects.list({ type: 'project' });Namespaces
The client exposes these resource namespaces:
client.memories— create, read, update, delete, archive, list, search, batchclient.subjects— create, resolve, update, merge, list memories for a subjectclient.connections— relate two memoriesclient.holders— attach subjects to memoriesclient.auditLogs— query tenant audit trail
Error handling
All non-2xx responses throw a Memo9Error with status and details:
import { Memo9Client, Memo9Error } from '@memo9/sdk';
try {
await client.memories.get('missing-id');
} catch (err) {
if (err instanceof Memo9Error && err.status === 404) {
// handle not found
}
}License
Apache-2.0 © Weight Wave Inc.
