Documentation

Get started in 5 minutes.

Two endpoints: ingest and context. Everything else is optional.

Quick Start

bash
npm install @m3mory/sdk
# Set your API key
export M3MORY_API_KEY=m3m_sk_...

1. Ingest a conversation

typescript
1import { M3mory } from "@m3mory/sdk";
2
3const m3 = new M3mory({ apiKey: process.env.M3MORY_API_KEY });
4
5await m3.ingest({
6 agentId: "my-assistant",
7 userId: "user_123",
8 messages: [
9 { role: "user", content: "I just moved to Bristol" },
10 { role: "assistant", content: "Welcome to Bristol!" }
11 ]
12});

2. Recall context

typescript
1const context = await m3.context({
2 agentId: "my-assistant",
3 userId: "user_123",
4 messages: [
5 { role: "user", content: "Where do I live?" }
6 ],
7 tokenBudget: 2000
8});
9
10// Use context.text in your system prompt
11const systemPrompt = `You are a helpful assistant.
12
13${context.text}`;

API Reference

POST/v1/ingest
POST/v1/context
POST/v1/search
GET/v1/memories
GET/v1/memories/:id
DELETE/v1/memories/:id
GET/v1/status

SDKs & Integrations

@m3mory/sdk

TypeScript / JavaScript

Available
m3mory-python

Python

Coming soon
@m3mory/mcp-server

MCP Protocol

Available
@m3mory/openclaw-plugin

OpenClaw Plugin

Available