supermemory README

The project's README from github.com/supermemoryai/supermemory. As one markdown file: README.md.

Supermemory

State-of-the-art memory and context engine for AI.

Docs · Quickstart · Self-host · Dashboard · Discord

npm pypi docs

English · 简体中文

#1 on every major AI memory benchmark — LongMemEval, LoCoMo, and ConvoMem.
95% Recall@15 with a 99.4% context reduction · ~50ms user profiles.
Read the research →


Supermemory is the memory and context layer for AI. #1 on LongMemEval, LoCoMo, and ConvoMem — the three major benchmarks for AI memory.

We are a research lab building the engine, plugins and tools around it.

Your AI forgets everything between conversations. Supermemory fixes that.

It automatically learns from conversations, extracts facts, builds user profiles, handles knowledge updates and contradictions, forgets expired information, and delivers the right context at the right time. Full RAG, connectors, file processing — the entire context stack, one system.

🧠 Memory Extracts facts from conversations. Handles temporal changes, contradictions, and automatic forgetting.
👤 User Profiles Auto-maintained user context — stable facts + recent activity. One call, ~50ms.
🔍 Hybrid Search RAG + Memory in a single query. Knowledge base docs and personalized context together.
🔌 Connectors Google Drive · Gmail · Notion · OneDrive · GitHub — auto-sync with real-time webhooks.
📄 Multi-modal Extractors PDFs, images (OCR), videos (transcription), code (AST-aware chunking). Upload and it works.

All of this is in our single memory structure and ontology.

image

Use Supermemory

🧑‍💻 I use AI tools

Give Claude Code, Cursor, Codex and OpenCode persistent memory across every conversation with a plugin or the MCP server.

Your AI remembers your preferences, projects, past discussions — and gets smarter over time.

→ Jump to User setup

🔧 I'm building AI products

Add memory, RAG, user profiles, and connectors to your agents and apps with a single API.

No vector DB config. No embedding pipelines. No chunking strategies.

→ Jump to developer quickstart

🖥️ I want to run it myself

State-of-the-art memory, on your machine. One binary. Zero config. Bring any model — or run fully offline with Ollama.

curl -fsSL https://supermemory.ai/install | bash

→ Jump to Supermemory local


Give your AI memory

Plugins and the MCP server give any compatible AI assistant persistent memory. One install, and your AI remembers you.

Supermemory Plugins

Supermemory comes built with plugins for Claude Code, Cursor, Codex, OpenCode, OpenClaw, and Hermes.

image

These plugins are implementations of the supermemory API, and they are open source!

You can find them here:

MCP

Server URL:

https://mcp.supermemory.ai/mcp
{
  "mcpServers": {
    "supermemory": {
      "url": "https://mcp.supermemory.ai/mcp"
    }
  }
}

Read more about our MCP here - https://supermemory.ai/docs/supermemory-mcp/mcp

What your AI gets

Tool What it does
memory Save or forget information. Your AI calls this automatically when you share something worth remembering.
recall Search memories by query. Returns relevant memories + your user profile summary.
context Injects your full profile (preferences, recent activity) into the conversation at start. In Cursor and Claude Code, just type /context.

How it works

Once installed, Supermemory runs in the background:

  1. You talk to your AI normally. Share preferences, mention projects, discuss problems.
  2. Supermemory extracts and stores the important stuff. Facts, preferences, project context — not noise.
  3. Next conversation, your AI already knows you. It recalls what you're working on, how you like things, what you discussed before.

Memory is scoped with projects (container tags) so you can separate work and personal context, or organize by client, repo, or anything else.

Supported clients

Claude Desktop · Cursor · Windsurf · VS Code · Claude Code · OpenCode · OpenClaw · Hermes

The MCP server is open source — view the source.

Manual configuration

Add this to your MCP client config:

{
  "mcpServers": {
    "supermemory": {
      "url": "https://mcp.supermemory.ai/mcp"
    }
  }
}

Build with Supermemory (API)

If you're building AI agents or apps, Supermemory gives you the entire context stack through one API — memory, RAG, user profiles, connectors, and file processing.

Install

npm install supermemory    # or: pip install supermemory

Quickstart

import Supermemory from "supermemory";

const client = new Supermemory();

// Store a conversation
await client.add({
  content: "User loves TypeScript and prefers functional patterns",
  containerTag: "user_123",
});

// Get user profile + relevant memories in one call
const { profile, searchResults } = await client.profile({
  containerTag: "user_123",
  q: "What programming style does the user prefer?",
});

// profile.static  → ["Loves TypeScript", "Prefers functional patterns"]
// profile.dynamic → ["Working on API integration"]
// searchResults   → Relevant memories ranked by similarity
from supermemory import Supermemory

client = Supermemory()

client.add(
    content="User loves TypeScript and prefers functional patterns",
    container_tag="user_123"
)

result = client.profile(container_tag="user_123", q="programming style")

print(result.profile.static)   # Long-term facts
print(result.profile.dynamic)  # Recent context

Supermemory automatically extracts memories, builds user profiles, and returns relevant context. No embedding pipelines, no vector DB config, no chunking strategies.

Framework integrations

Drop-in wrappers for every major AI framework:

// Vercel AI SDK
import { withSupermemory } from "@supermemory/tools/ai-sdk";
const model = withSupermemory(openai("gpt-4o"), { containerTag: "user_123", customId: "conv-1" });

// Mastra
import { withSupermemory } from "@supermemory/tools/mastra";
const agent = new Agent(withSupermemory(config, "user-123", { mode: "full" }));

Vercel AI SDK · LangChain · LangGraph · OpenAI Agents SDK · Mastra · Agno · Claude Memory Tool · n8n

Search modes

// Hybrid (default) — RAG + Memory in one query
const results = await client.search({
  q: "how do I deploy?",
  containerTag: "user_123",
  searchMode: "hybrid",
});
// Returns deployment docs (RAG) + user's deploy preferences (Memory)

// Memories only
const results = await client.search({
  q: "user preferences",
  containerTag: "user_123",
  searchMode: "memories",
});

User profiles

Traditional memory relies on search — you need to know what to ask for. Supermemory automatically maintains a profile for every user:

const { profile } = await client.profile({ containerTag: "user_123" });

// profile.static  → ["Senior engineer at Acme", "Prefers dark mode", "Uses Vim"]
// profile.dynamic → ["Working on auth migration", "Debugging rate limits"]

One call. ~50ms. Inject into your system prompt and your agent instantly knows who it's talking to.

Connectors

Auto-sync external data into your knowledge base:

Google Drive · Gmail · Notion · OneDrive · GitHub · Web Crawler

Real-time webhooks. Documents automatically processed, chunked, and searchable.

API at a glance

Method Purpose
client.add() Store content — text, conversations, URLs, HTML
client.profile() User profile + optional search in one call
client.search() Hybrid search across memories and documents (searchMode)
client.search.documents() Document search with metadata filters (legacy v3 response shape)
client.documents.uploadFile() Upload PDFs, images, videos, code
client.documents.list() List and filter documents
client.settings.update() Configure memory extraction and chunking

Full API reference → supermemory.ai/docs


Supermemory local — run it yourself

State-of-the-art memory, on your machine. One binary. Zero config.

curl -fsSL https://supermemory.ai/install | bash
# or
npx supermemory local
supermemory-server

First boot sets up the embedded Supermemory graph engine, local embeddings, and your credentials, then prints an API key. The full Memory API — documents, memories, user profiles, hybrid search — runs against http://localhost:6767.

const client = new Supermemory({
  apiKey: "sm_...",
  baseURL: "http://localhost:6767", // that's the only change
});

Read the self-hosting docs — quickstart, configuration, embeddings, and local vs. Enterprise.


Benchmarks

Supermemory is state of the art across all major AI memory benchmarks:

Benchmark What it measures Result
LongMemEval Long-term memory across sessions with knowledge updates #1
LoCoMo Fact recall across extended conversations (single-hop, multi-hop, temporal, adversarial) #1
ConvoMem Personalization and preference learning #1

On LongMemEval, supermemory reaches 95% Recall@15 while adding only ~720 tokens of context — a 99.4% context reduction (99.6% at @10, 99.8% at @5). Recall by category: Knowledge Updates 99%, Assistant recall 100%, User recall 97%, Multi-session 93%, Temporal Reasoning 91%, Preference 90%.

We also built the Supermemory Filesystem (SMFS), which uses 3.0× fewer tokens on Claude (24M vs 72M) and 1.75× fewer on Codex across the 110-question xAFS benchmark. See the full write-ups on our research page.

We also built MemoryBench — an open-source framework for standardized, reproducible benchmarks of memory providers. Compare Supermemory, Mem0, Zep, and others head-to-head:

bun run src/index.ts run -p supermemory -b longmemeval -j gpt-4o -r my-run

Benchmarking your own memory solution

We provide an Agent skill for companies to benchmark their own context and memory solutions against supermemory.

npx skills add supermemoryai/memorybench

Simply run this and do /benchmark-context - Supermemory will automatically do the work for you!


How memory works under the hood

Your app / AI tool
        ↓
   Supermemory
        │
        ├── Memory Engine     Extracts facts, tracks updates, resolves contradictions,
        │                     auto-forgets expired info
        ├── User Profiles     Static facts + dynamic context built from engine, always fresh
        ├── Hybrid Search     RAG + Memory in one query
        ├── Connectors        Real-time sync from Google Drive, Gmail, Notion, GitHub...
        └── File Processing   PDFs, images, videos, code → searchable chunks

Memory is not RAG. RAG retrieves document chunks — stateless, same results for everyone. Memory extracts and tracks facts about users over time. It understands that "I just moved to SF" supersedes "I live in NYC." Supermemory runs both together by default, so you get knowledge base retrieval and personalized context in every query. Read more about this here - https://supermemory.ai/docs/concepts/memory-vs-rag

Automatic forgetting. Supermemory knows when memories become irrelevant. Temporary facts ("I have an exam tomorrow") expire after the date passes. Contradictions are resolved automatically. Noise never becomes permanent memory.



Give your AI a memory. It's about time..

supermemory (supermemoryai/supermemory)

Searching Database…

这是什么?Supermemory 是一个面向 AI 的记忆和上下文引擎:它会从你的对话中学习,提取事实并构建用户画像,让你的 AI 在多次会话之间记住你,而不是每次都从零开始。
它是一个托管服务、开发者 API,还是需要安装到我的 AI 工具里的东西?它以插件和 MCP 服务器的形式提供,为 Claude Code、Cursor 等 AI 工具赋予持久记忆;同时为开发智能体和应用的开发者提供统一的 Memory API;还有一个本地单文件版本,你可以自己运行。
我怎么让 Claude Code 或 Cursor 这样的 AI 助手拥有记忆?安装其中一个开源插件(Claude Code、Cursor、Codex、OpenCode、OpenClaw、Hermes),或者把 MCP 服务器地址添加到你的客户端配置里;在 Cursor 和 Claude Code 中,/context 会在对话开始时注入你的用户画像。
我需要先搭建向量数据库或嵌入(embedding)流程吗?不需要。Supermemory 会帮你处理提取、分块和嵌入;本地模式默认使用 Xenova/bge-base-en-v1.5 嵌入,无需 API 密钥,你也可以改用 OpenAI、Gemini 或 Ollama。
我能完全离线运行它吗?可以——Supermemory 本地版是单个可执行文件,零配置,只要接上 Ollama(gpt-oss:20b 效果很好),所有数据都不会离开你的电脑。
如果我在本地运行,我的数据存在哪里?本地模式下,所有数据都存放在一个 ./.supermemory 目录里,方便备份或迁移;托管平台使用相同的 API,只需修改 baseURL 就能迁移过去。
如果我在开发自己的 AI 产品,这个 API 能给我什么?一套 API 打包了完整的上下文技术栈:记忆、RAG、用户画像、连接器和文件处理。你可以用 client.add() 存储内容,用 client.profile() 获取约 50ms 返回的用户画像,用 client.search() 做混合搜索,还有针对 Vercel AI SDK、LangChain、LangGraph、OpenAI Agents SDK、Mastra、Agno、Claude Memory Tool 和 n8n 的即插即用封装。
除了聊天对话,它还能接入哪些数据源?连接器通过实时 webhook 自动同步 Google Drive、Gmail、Notion、OneDrive、GitHub 和网页抓取内容;多模态提取器则能处理 PDF、图片(OCR)、视频(转录)和代码,并采用感知 AST 的分块方式。
它和普通的 RAG 有什么区别?RAG 只是检索文档片段,对所有人都返回同样的结果;而记忆会长期跟踪关于某个用户的事实——它能理解“我刚搬到旧金山”会取代“我住在纽约”,并自动解决矛盾。Supermemory 默认同时运行两者。
客观来说,它的效果怎么样?它在三大主流 AI 记忆基准——LongMemEval、LoCoMo 和 ConvoMem——上都排名第一,在 LongMemEval 上达到 95% 的 Recall@15,同时只增加约 720 个 token 的上下文,用户画像的返回时间约为 50ms。
Size
209.9 MB
Stars
31.3K
Age
2y
Commits · 90 Days