Start here
Memory and context for AI products. SDK/API to ship. MCP to build. Prove it with a SaaS copilot in 5 minutes.
Make users feel remembered — add MemoryNode around your existing AI stack: save what matters, recall the right context, inject into your prompt. Your model stack stays the same.
Recommended path
Follow this order:
- Playground — prove save → recall → context (~5 min, no API key)
- Create API key — App connection after Playground proof
- Two-call integration — wire REST/SDK in production
- SDK quickstart — fastest code path
- SaaS copilot starter — full in-app UX with Memory used badge
- MCP setup — only if building inside Cursor or Claude (not your production backend)
1. Prove recall in Playground
- Sign in to the console. Setup creates your workspace automatically.
- Open Playground (no API key needed — the console uses your signed-in session).
- Save a preference, e.g.
User prefers weekly email digests and dark mode on the dashboard. - Ask a different question, e.g.
How should the dashboard feel for this user? - Click Build context and confirm Context ready shows prompt-ready text (or use Search recall for ranked hits).
- Copy
context_text— that is what you inject into your LLM system prompt.
Playground uses default-user by default. That is fine for proof. Create an API key on App connection when you run code below.
Playground proves memory and context — it does not chat with an LLM on your behalf.
2. Ship with SDK/API
After Playground works, run the SDK quickstart:
export MEMORYNODE_API_KEY="mn_live_..."
export MEMORYNODE_USER_ID="user_42"
node examples/sdk-quickstart/index.mjs
TypeScript:
import { MemoryNode } from "@memorynodeai/sdk";
const memory = new MemoryNode(process.env.MEMORYNODE_API_KEY!);
const ownerId = process.env.MEMORYNODE_USER_ID ?? "user_42";
await memory.remember("User prefers weekly email digests and dark mode.", { ownerId });
const { context_text: contextText } = await memory.contextFor(
"How should the dashboard feel for this user?",
{ ownerId, topK: 8 },
);
// Inject contextText into your existing LLM messages
3. SaaS copilot starter (optional UI)
Open the Next.js SaaS copilot starter: save a preference, ask a different question, watch Memory used on the reply. The starter uses OpenAI for the reply step — Playground does not.
4. MCP for builders (optional)
Use MCP only when prototyping in Cursor or Claude Desktop. MCP is for building, not your production SaaS backend. Same API key, same memories.
The four-step ship flow
| Step | What you do | API / SDK |
|---|---|---|
| 1. Save | Store what your app learned | POST /v1/memories · memory.remember() |
| 2. Recall | Ranked hits (optional if you use context) | POST /v1/search · memory.recall() |
| 3. Build context | Prompt-ready pack + citations | POST /v1/context · memory.contextFor() |
| 4. Inject | Merge into your system/user message | Your OpenAI / Anthropic code — unchanged |
Minimum proof: save + search (two API calls). Production prompts: prefer save + context.
Owner id matters
Memories are scoped by owner_id (SDK alias: userId). Pass your SaaS app's logged-in user ID on every write and read. Session 1 and session 2 must use the same value.
What to skip at first
- Custom ranking tuning or large eval harnesses
Get save + recall (or context) working first. Ship with SDK/API before MCP.