OpenAI SDK + Memanto
@moorcheh-ai/memanto TypeScript SDK.
Prerequisites
- Node.js 20+
- Moorcheh API key (or an on-prem Memanto backend — see On-Prem)
openaiandzodinstalled in your app (optional peer dependencies of@moorcheh-ai/memanto)
Install
openai and zod are optional peer dependencies of @moorcheh-ai/memanto — install them yourself in the host app; createMemantoOpenAITools fails fast with a clear error if they’re missing.
Quick Start
createMemantoOpenAITools returns an array of tools built with zodFunction, ready to hand to the OpenAI Node SDK’s runTools() helper — each tool auto-parses its JSON arguments against a Zod schema before invoking Memanto.
Available Tools
| Tool | Backed by | Description |
|---|---|---|
recallMemory | Recall | Semantic search over stored memories. query (required), limit, type (filter by memory type). |
rememberMemory | Remember | Persist a durable fact/preference/decision/instruction. content (required), type (optional — server auto-classifies if omitted), title, tags. |
answerMemory | Generate AI Answer | RAG-synthesized answer over stored memories. question (required), limit. |
Unlike the Vercel AI SDK and Mastra variants, this integration’s schemas use nullable fields (
.nullable()) instead of optional ones, matching the OpenAI function-calling convention where the model must explicitly pass null rather than omit a field.Options
Memory Types
type fields are constrained to Memanto’s 13 supported types via a shared MEMORY_TYPES export:
On-Prem
The integration talks to Memanto through theMemanto client, so it works identically against an on-prem backend — no code changes, just configure the backend once with the CLI. See On-Prem Overview and the TypeScript SDK Reference.
Next Steps
- TypeScript SDK Reference for the full
Memantoclient API - Vercel AI SDK Integration for the equivalent AI SDK tools
- Mastra Integration for the equivalent Mastra tools
- Memory Types Reference