TypeScript SDK
An official TypeScript / JavaScript SDK is on the roadmap and not yet published. The four-endpoint surface is small enough to use directly with fetch today.
Want this sooner? Open an issue at github.com/mnemexa/python/issues describing your use case. Real demand signals move this up the queue.
Until the SDK ships, use fetch
The Mnemexa REST API is small and stable. A working TypeScript client is roughly thirty lines:
const BASE = "https://api.mnemexa.com";
const HEADERS = {
Authorization: `Bearer ${process.env.MNEMEXA_API_KEY}`,
"Content-Type": "application/json",
};
// memory.store
async function store(text: string, meta?: Record<string, unknown>) {
const r = await fetch(`${BASE}/v1/memory/store`, {
method: "POST",
headers: HEADERS,
body: JSON.stringify({ text, meta: meta ?? {} }),
});
if (!r.ok) throw new Error(`store ${r.status}`);
return r.json();
}
// memory.retrieve
async function retrieve(query: string, top_k = 5, min_score = 0.35) {
const r = await fetch(`${BASE}/v1/memory/retrieve`, {
method: "POST",
headers: HEADERS,
body: JSON.stringify({ query, top_k, min_score }),
});
if (!r.ok) throw new Error(`retrieve ${r.status}`);
return r.json();
}
// optimize.health
async function health() {
const r = await fetch(`${BASE}/v1/optimize/health`, { headers: HEADERS });
if (!r.ok) throw new Error(`health ${r.status}`);
return r.json();
}
// status
async function status() {
const r = await fetch(`${BASE}/v1/status`, { headers: HEADERS });
if (!r.ok) throw new Error(`status ${r.status}`);
return r.json();
}
What the SDK will add when it ships
When the official TypeScript SDK lands (target: post-Python-SDK feedback cycle), it’ll bring:
- Typed responses — full TypeScript types for all four response shapes, with forward-compatibility for new fields.
- Sync and Promise APIs — idiomatic patterns for both Node.js and browser/Deno.
- Automatic retries — same exponential-backoff retry policy as the Python SDK.
- Error taxonomy — typed
AuthenticationError,RateLimitError, etc. - Telemetry headers — request IDs, version reporting.
Reserved package name: @mnemexa/sdk (separate from the MCP adapter, which is @mnemexa/mcp).
Already integrated with TypeScript through MCP
If your use case is AI agents (Claude, Cursor, Windsurf, VS Code), you don’t need the TypeScript SDK — install @mnemexa/mcp and your agent gets brain.remember, brain.recall, brain.health, brain.status automatically. The MCP adapter is itself a TypeScript package.