MemoryNode integration
Start here: Two-call integration — the canonical developer path for POST /v1/memories and POST /v1/search.
Stack recipes: Integration recipes — save → recall → inject into your existing LLM (REST/OpenAI/Anthropic for production app flows; MCP only for Cursor/Claude build path).
That doc covers authentication, owner_id, copy-paste examples (cURL, TypeScript, Python), the SaaS copilot session 1 → session 2 proof, and what you can skip for first recall.
This page covers what runs automatically once the two calls are already wired and working.
Context-pack-first workflow
After POST /v1/memories and POST /v1/search work, use POST /v1/context when you want a single payload for the model: ranked memories and citations assembled as context_text.
Recommended flow:
- Save what you learned (
POST /v1/memories). - Recall with search when you only need ranked hits (
POST /v1/search). - Build context when you are ready to answer (
POST /v1/context) — paste the returned pack into your chat prompt.
The console Playground follows this order: save → build context → copy context_text.
Archive vs forget
| Action | API / console | Effect |
|---|---|---|
| Archive | POST /v1/memories/:id/archive · Memories → Archive | Hides the memory from active recall; keeps the row for audit and optional review. |
| Forget (delete) | DELETE /v1/memories/:id · Memories → Forget | Hard delete with chunks and links removed. |
Use archive when a fact is outdated but you may want history; use forget when the user or policy requires removal.
What you get without extra code
These run on every write/search; you do not configure separate services for them.
| Capability | What it means for your app |
|---|---|
| Lifecycle intelligence | Confidence, volatility, expiry, and supersession are applied on ingest and reflected in ranking — not a separate “lifecycle API”. |
| Semantic dedupe | Near-duplicate text or embeddings can return { deduped: true, memory_id, dedupe_kind } instead of a second row. |
| Contradiction handling | Conflicting facts are resolved on write; check intelligence.conflict_state on new memories. |
| SQL recall + Worker ranking | Postgres returns candidates; business ranking (lifecycle, learning, freshness) runs in the Worker after fusion. |
| Retrieval ranking | Postgres returns candidates; ranking (lifecycle, freshness) runs in the Worker after fusion. |
| Worker-side LLM (operator) | Extraction and evolution on ingest use CHAT_PROVIDER on the MemoryNode Worker (OpenAI, Anthropic, or Gemini). This is not “use Claude in your app” — your product still calls your own model; MemoryNode only uses these keys for optional extract/evolve on write. Embeddings stay OpenAI/stub with per-chunk version metadata. |
Details: API_USAGE.md §4 (lifecycle, providers, retrieval architecture).
TypeScript SDK
@memorynodeai/sdk wraps the same routes with retries, typed errors, and explain for ranking debug. See DEBUGGING.md.
Deeper reference
- docs/INTEGRATION_RECIPES.md — copy-paste per stack
- docs/TWO_CALL_INTEGRATION.md — start here for first recall
- docs/external/openapi.yaml — product OpenAPI (generated; excludes operator routes)
- docs/external/API_USAGE.md — full HTTP reference
- docs/MCP_SERVER.md — MCP to build in Cursor/Claude (not for production backends)