mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-27 06:15:15 +00:00
Fixes namespace, auth and SDK-shape docs.
- **Namespace move example deleted instead.** It sent `moveTo` in a JSON body on `DELETE /ns/{namespace}`. The route only reads `moveTo` from the query string and ignores the body, so following the docs permanently deleted the namespace. It now uses `?moveTo=`, and the overview warns about this.
- **SDK call shape.** URL values are positional (`namespace` first), followed by one options object; the docs described one object with `body`. Python 5.0.0 is the v5 client, so "no v5 Python SDK" is gone.
- **Scoped keys** (`authentication.mdx`):
- The allowed-endpoints list now includes the `/ns/*` routes; all legacy routes are kept.
- `containerTags` (several namespaces) is documented.
- Namespace names don't allow dots.
- **Key permissions.** Read/write applies to the whole key; only restricted members have per-namespace permissions.
- **Smaller fixes:**
- The move response has no `success` field.
- `namespaceCount` only matches the namespace list for an unrestricted key.
- `setup --json` does nothing.
- The agent prompt's ban on `memories.*` now covers only the calls v5 removed.
Checked against the current API and the published SDKs (TS 5.0.1, Python 5.0.0). Legacy v3/v4 docs are unchanged apart from factual fixes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
250 lines
8.4 KiB
Text
250 lines
8.4 KiB
Text
---
|
|
title: "Agents, skills and MCP"
|
|
description: "Set up coding agents to integrate Supermemory with the CLI, the skill and the docs MCP."
|
|
sidebarTitle: "Agents, skills and MCP"
|
|
icon: "/icons/hugeicons/robotic.svg"
|
|
---
|
|
|
|
This page is for **building with Supermemory** using coding agents: scaffolding a project, following the real API, and searching product docs.
|
|
|
|
This is not the consumer memory MCP that gives Claude or Cursor long-term memory about you. That is a separate product: [Supermemory MCP](/supermemory-mcp/mcp).
|
|
|
|
| Path | How | For |
|
|
|---|---|---|
|
|
| **CLI** | `npx supermemory` | Setup, smoke tests, agent-driven integration |
|
|
| **Skill** | `npx skills add … --skill supermemory` | Teach the agent the real API surface |
|
|
| **Docs MCP** | `https://supermemory.ai/docs/mcp` | Search these docs while the agent codes |
|
|
|
|
## CLI
|
|
|
|
Agents (and humans) can set things up from the terminal easily using our CLI
|
|
|
|
```bash
|
|
npx supermemory
|
|
```
|
|
|
|
Useful for coding agents:
|
|
|
|
```bash
|
|
npx supermemory setup # detect project, launch/print integration flow
|
|
npx supermemory setup --prompt # print integration prompt only
|
|
npx supermemory help --json # agent-readable command catalog
|
|
npx supermemory help --all
|
|
npx supermemory migrate # move a v3/v4 project to v5 with your agent
|
|
```
|
|
|
|
Also available for smoke tests against your key: `add`, `search`, `profile`, `docs`, `namespaces`, `config`, `whoami`. Auth via first-run credentials or `SUPERMEMORY_API_KEY`.
|
|
|
|
```bash
|
|
npx supermemory add "User prefers TypeScript" --namespace user_123
|
|
npx supermemory search "language preference" --namespace user_123
|
|
npx supermemory profile --namespace user_123
|
|
```
|
|
|
|
## Skill
|
|
|
|
Install the official skill so the agent uses the real endpoints, auth, and `namespace` rules instead of hallucinating APIs:
|
|
|
|
```bash
|
|
npx skills add https://github.com/supermemoryai/skills --skill supermemory
|
|
```
|
|
|
|
Source: [github.com/supermemoryai/skills](https://github.com/supermemoryai/skills).
|
|
|
|
<Tip>
|
|
For coding agents, use all three together: the skill, the docs MCP and `npx supermemory setup`.
|
|
</Tip>
|
|
|
|
## Docs MCP
|
|
|
|
Remote MCP that lets the agent **search Supermemory documentation** while it implements an integration.
|
|
|
|
Server URL:
|
|
|
|
```text
|
|
https://supermemory.ai/docs/mcp
|
|
```
|
|
|
|
### Setup by client
|
|
|
|
<Tabs>
|
|
<Tab title="Cursor">
|
|
Add to `~/.cursor/mcp.json`:
|
|
|
|
```json
|
|
{
|
|
"mcpServers": {
|
|
"supermemory-docs": {
|
|
"url": "https://supermemory.ai/docs/mcp"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
</Tab>
|
|
|
|
<Tab title="Claude Code">
|
|
```bash
|
|
claude mcp add --transport http supermemory-docs https://supermemory.ai/docs/mcp
|
|
```
|
|
|
|
Or project `.mcp.json`:
|
|
|
|
```json
|
|
{
|
|
"mcpServers": {
|
|
"supermemory-docs": {
|
|
"type": "http",
|
|
"url": "https://supermemory.ai/docs/mcp"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
</Tab>
|
|
|
|
<Tab title="Codex">
|
|
```bash
|
|
codex mcp add supermemory-docs --url https://supermemory.ai/docs/mcp
|
|
```
|
|
|
|
Or `~/.codex/config.toml`:
|
|
|
|
```toml
|
|
[mcp_servers.supermemory-docs]
|
|
url = "https://supermemory.ai/docs/mcp"
|
|
```
|
|
</Tab>
|
|
|
|
<Tab title="OpenCode">
|
|
```json
|
|
{
|
|
"mcp": {
|
|
"supermemory-docs": {
|
|
"type": "remote",
|
|
"url": "https://supermemory.ai/docs/mcp",
|
|
"enabled": true
|
|
}
|
|
}
|
|
}
|
|
```
|
|
</Tab>
|
|
|
|
<Tab title="VS Code">
|
|
Add to `.vscode/mcp.json`:
|
|
|
|
```json
|
|
{
|
|
"servers": {
|
|
"supermemory-docs": {
|
|
"type": "http",
|
|
"url": "https://supermemory.ai/docs/mcp"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
</Tab>
|
|
|
|
<Tab title="Other">
|
|
```json
|
|
{
|
|
"mcpServers": {
|
|
"supermemory-docs": {
|
|
"url": "https://supermemory.ai/docs/mcp"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
Stdio-only clients can proxy:
|
|
|
|
```json
|
|
{
|
|
"mcpServers": {
|
|
"supermemory-docs": {
|
|
"command": "npx",
|
|
"args": ["-y", "mcp-remote", "https://supermemory.ai/docs/mcp"]
|
|
}
|
|
}
|
|
}
|
|
```
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
### Starter prompt (docs + setup)
|
|
|
|
```text
|
|
You are integrating Supermemory into my app.
|
|
|
|
- Use the supermemory-docs MCP (or https://supermemory.ai/docs/llms.txt) before inventing endpoints.
|
|
- Prefer `npx supermemory setup` / the supermemory skill for correct auth, namespace, and SDK usage.
|
|
- Canonical writes: POST /ns/{namespace}/document · search: POST /ns/{namespace}/search · profile: POST /ns/{namespace}/profile
|
|
- Auth: Authorization: Bearer $SUPERMEMORY_API_KEY only
|
|
- Always scope with one namespace in the URL path on write and search; there is no namespace field in the body
|
|
- SDK: import { Supermemory } from "supermemory"; version 5 or later; the namespace is the first argument: client.add(namespace, { content }), client.search(namespace, { query })
|
|
- For demos use dreaming: "instant" when memories must be ready right after status done
|
|
- Already on Supermemory v3/v4? Run `npx supermemory@latest migrate` instead of rewriting calls by hand
|
|
```
|
|
|
|
### Integrate prompt (optional)
|
|
|
|
If the skill is not installed, paste a fuller prompt so the agent asks the right product questions:
|
|
|
|
<Accordion title="Copy full integration prompt" icon="/icons/hugeicons/copy-01.svg">
|
|
````
|
|
You are integrating Supermemory into my application. Supermemory provides user memory, semantic search, and automatic knowledge extraction for AI applications.
|
|
|
|
Note: You can always reference the documentation by using the **supermemory-docs MCP** or content on **supermemory.ai/docs**. Prefer `npx supermemory setup` / `npx supermemory help --json` when scaffolding.
|
|
|
|
CANONICAL API SURFACE (use these, nothing else):
|
|
|
|
- Auth header: `Authorization: Bearer $SUPERMEMORY_API_KEY` — the only supported auth header
|
|
- Write content: POST https://api.supermemory.ai/ns/{namespace}/document
|
|
- Search: POST https://api.supermemory.ai/ns/{namespace}/search
|
|
- Profile: POST https://api.supermemory.ai/ns/{namespace}/profile
|
|
- Org settings: PATCH https://api.supermemory.ai/organization
|
|
- Scoping: one `namespace` in the URL path — never in the body or a header
|
|
- SDK: `import { Supermemory } from "supermemory"`; `supermemory.add(namespace, { content, id?, metadata? })`, `supermemory.search(namespace, { query })`, `supermemory.profile(namespace)`
|
|
|
|
DO NOT USE — deprecated, undocumented, or fabricated:
|
|
|
|
- Endpoints: /v1/anything, /v3/documents, /v3/search, /v4/search, /v4/profile, /v4/memories (use /ns/{namespace}/...)
|
|
- Headers: x-supermemory-api-key, x-api-key, x-sm-user-id (for API auth)
|
|
- Body keys: containerTag, containerTags, customId (use `id`), entityContext (use `supportingContext`), filterByMetadata (use `group`), documentDate (use `date`), q (use `query`), filters (use `filter`), userId, spaces
|
|
- SDK: `client.add({ containerTag })`, `client.search.execute`, `client.memories.add` / `client.memories.updateMemory`, `client.profile({ q })`
|
|
|
|
SCOPING IS LOAD-BEARING. Every write and every search MUST name one namespace in the path.
|
|
|
|
Prefer for tutorials:
|
|
- Ingest conversations with a stable `id` + dreaming: "instant" when you need memories immediately
|
|
- Wait until document system.status is done before search
|
|
- search with searchMode: "chunks" for RAG, searchMode: "memories" (+ include.related) for the graph, profile for always-on context
|
|
|
|
STEP 1: Ask what I'm building, integration style (AI SDK / OpenAI / Direct SDK / API), data model (user/org/both), profiles yes/no.
|
|
STEP 2: Install supermemory (npm/pip), set SUPERMEMORY_API_KEY from https://console.supermemory.ai
|
|
STEP 3: Generate complete working code.
|
|
|
|
DOCS: https://supermemory.ai/docs
|
|
````
|
|
</Accordion>
|
|
|
|
## Memory MCP (different product)
|
|
|
|
Want your **assistant** to remember you across chats (save/recall/profile in Claude, Cursor, etc.)? That is the **Memory MCP**, not the docs MCP:
|
|
|
|
→ [Supermemory MCP](/supermemory-mcp/mcp)
|
|
|
|
## Next steps
|
|
|
|
<CardGroup cols={2}>
|
|
<Card title="Quickstart" icon="/icons/hugeicons/play.svg" href="/quickstart">
|
|
Conversation + document ingest, RAG, graph, profile, harness.
|
|
</Card>
|
|
<Card title="Memory MCP" icon="/icons/hugeicons/ai-brain-01.svg" href="/supermemory-mcp/mcp">
|
|
Persistent memory for assistants — separate from docs setup.
|
|
</Card>
|
|
<Card title="Plugins" icon="/icons/hugeicons/puzzle.svg" href="/integrations/openclaw">
|
|
Claude Code, OpenClaw, Codex, Hermes, and more.
|
|
</Card>
|
|
<Card title="AI SDK" icon="/icons/hugeicons/triangle.svg" href="/integrations/ai-sdk">
|
|
withSupermemory and memory tools in app code.
|
|
</Card>
|
|
</CardGroup>
|