TypeScript SDK
Official TypeScript/JavaScript SDK for MemoryKit. Zero dependencies, full type safety.
Native fetch only — no axios, no node-fetch.
Every error is an instanceof check. No string matching.
Works in Node.js, Bun, Deno, Cloudflare Workers, Vercel Edge.
Installation
Requires Node.js 18+. TypeScript 5.0+ is optional — works with plain JavaScript too.
Quick start
Configuration options
Memories
Create and manage
Upload files
Supports PDF, DOCX, XLSX, PPTX, TXT, CSV, Markdown, HTML, and JSON.
Batch ingest
Up to 100 memories in a single request.
Reprocess
Triggers re-chunking and re-embedding for an existing memory.
Search
Hybrid search
Combines vector similarity, full-text search, and reranking.
RAG query
Coming Soon — memories.query() is not available in the current SDK release. Use memories.search() for retrieval. LLM-powered query with answer generation will be available in a future release.
Streaming
Coming Soon — memories.stream() is not available in the current SDK release. Use memories.search() for retrieval. Streaming responses will be available in a future release.
Chats
Coming Soon — Chat methods (chats.create(), chats.sendMessage(), chats.streamMessage(), chats.getHistory()) are not available in the current SDK release. Conversational RAG with chat sessions will be available in a future release.
Users
Webhooks
Error handling
All errors are typed — use instanceof to handle specific cases:
Retryable errors (429, 5xx) are automatically retried with exponential backoff up to maxRetries times. You don't need to implement retry logic yourself.
Runtime compatibility
| Runtime | Status | Notes |
|---|---|---|
| Node.js 18+ | ✅ | Full support |
| Bun | ✅ | Full support |
| Deno | ✅ | import { MemoryKit } from "npm:memorykit" |
| Cloudflare Workers | ✅ | Edge-compatible |
| Vercel Edge | ✅ | Edge-compatible |
| Browser | ⚠️ | Works, but exposes your API key — use a server proxy |