开源 AI 记忆与上下文引擎 Supermemory:三大基准登顶,支持全本地运行与统一 API
英文标题:🔥 supermemoryai/supermemory
Supermemory 是一款面向 AI 时代的顶级记忆与上下文引擎,在 LongMemEval、LoCoMo 和 ConvoMem 三大主流记忆基准测试中均登顶榜首。该系统实现了 99.4% 的上下文缩减与 95% 的 Recall@15 召回率,并可在约 50ms 内完成用户画像构建。Supermemory 提供覆盖 Claude Code、Cursor 等开发工具的 MCP 插件生态,同时为开发者提供免配置向量数据库与 Embedding 管线的统一 API,并支持借助 Ollama 实现 100% 本地脱网运行。
723.0 KB
273.3 KB
55.7 KB
中文
专为 AI 打造的顶尖记忆与上下文引擎。
文档 · 快速入门 · 自托管 · 控制台 · Discord
English · 简体中文
在所有主流 AI 记忆基准测试中均位列第一 —— LongMemEval、LoCoMo 以及 ConvoMem。
在实现 99.4% 上下文压缩的同时达到 95% Recall@15 · 用户画像生成仅需约 50ms。
阅读研究报告 →
Supermemory 是专为 AI 设计的记忆与上下文层。在 AI 记忆领域的三大权威基准 LongMemEval、LoCoMo 以及 ConvoMem 中均排名第一。
我们是一个专注于构建该引擎及其周边插件与工具的研究实验室。
你的 AI 会在不同对话之间遗忘一切。Supermemory 正是为了解决这个问题而生。
它能够自动从对话中学习、提取事实、构建用户画像、处理知识更新与逻辑冲突、遗忘过期信息,并在合适的时间交付精准的上下文。完整的 RAG、各类连接器、文件处理 —— 整个上下文技术栈,全在一套系统内搞定。
| 🧠 记忆 (Memory) | 从对话中提取事实。处理时效性变更、矛盾信息并支持自动遗忘。 |
| 👤 用户画像 (User Profiles) | 自动维护用户上下文 —— 稳定事实 + 近期活动。单次调用,耗时约 50ms。 |
| 🔍 混合检索 (Hybrid Search) | 单次查询实现 RAG + 记忆检索。同时获取知识库文档与个性化上下文。 |
| 🔌 连接器 (Connectors) | Google Drive · Gmail · Notion · OneDrive · GitHub —— 支持实时 Webhook 自动同步。 |
| 📄 多模态提取器 (Multi-modal Extractors) | 支持 PDF、图像(OCR)、视频(语音转录)、代码(AST 感知切分)。即传即用。 |
所有这一切,均基于统一的记忆结构与本体系统运作。
通过插件或 MCP 服务,为 Claude Code、Muse Code、Cursor、Codex 和 OpenCode 赋予跨会话的持久记忆能力。你的 AI 将记住你的偏好、项目背景和过往讨论 —— 并且随着使用越来越聪明。→ 跳转至用户配置 |
🔧 我正在构建 AI 产品
仅需一个 API,即可为你的 Agent 和应用程序接入记忆、RAG、用户画像及连接器功能。无需配置向量数据库,无需搭建 Embedding 流水线,也无需设计切分策略。→ 跳转至开发者快速入门
---|---
🖥️ 我希望自行运行
在你自己的机器上运行顶尖的记忆引擎。单二进制文件,零配置。 支持接入任意模型 —— 亦可配合 Ollama 实现完全离线运行。
curl -fsSL https://supermemory.ai/install | bash
→ 跳转至 Supermemory 本地部署
插件与 MCP 服务可为任意兼容的 AI 助手赋予持久记忆。一次安装,AI 便能长久记住你。
Supermemory 原生内置了适配 Claude Code、Muse Code、Cursor、Codex、OpenCode、OpenClaw 以及 Hermes 的插件。
这些插件均基于 Supermemory API 构建,并且完全开源!
你可以通过以下方式配置:
服务器 URL:
https://mcp.supermemory.ai/mcp
{
"mcpServers": {
"supermemory": {
"url": "https://mcp.supermemory.ai/mcp"
}
}
}
在此了解更多关于 MCP 的内容 —— https://supermemory.ai/docs/supermemory-mcp/mcp
| 工具 | 功能说明 |
|---|---|
memory |
保存或遗忘信息。当你在对话中分享值得记忆的内容时,AI 会自动调用。 |
recall |
根据 Query 搜索记忆。返回相关记忆及用户画像摘要。 |
context |
在会话开始时将完整用户画像(偏好、近期活动)注入对话中。在 Cursor 和 Claude Code 中,直接输入 /context 即可触发。 |
安装完成后,Supermemory 会在后台静默运行:
- 与 AI 正常交谈:表达个人偏好、提及项目进展、探讨各类问题。
- Supermemory 提取并沉淀关键要素:捕获事实、偏好与项目上下文,自动过滤无用噪音。
- 开启下次对话,AI 已熟知背景:准确回忆起你的工作内容、喜好习惯以及历史讨论要点。
记忆数据通过**项目(Projects / Container Tags 容器标签)**进行作用域隔离,方便你分离工作与个人上下文,或按客户、代码仓库等维度灵活组织。
Claude Desktop · Cursor · Windsurf · VS Code · Claude Code · OpenCode · OpenClaw · Hermes
该 MCP 服务器已完全开源 —— 查看源代码。
将以下配置添加至你的 MCP 客户端配置文件中:
{
"mcpServers": {
"supermemory": {
"url": "https://mcp.supermemory.ai/mcp"
}
}
}
使用 Supermemory 构建应用 (API)
对于正在构建 AI Agent 或应用的用户,Supermemory 通过统一 API 交付整套上下文技术栈 —— 囊括记忆、RAG、用户画像、数据连接器及文件处理。
npm install supermemory # 或: pip install supermemory
import Supermemory from "supermemory";
const client = new Supermemory();
// 存储对话内容
await client.add({
content: "User loves TypeScript and prefers functional patterns",
containerTag: "user_123",
});
// 一次调用同时获取用户画像与相关记忆
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 → 按相似度排序的相关记忆
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) # 长期事实
print(result.profile.dynamic) # 近期上下文
Supermemory 能够全自动提取记忆、构建用户画像并返回高度相关的上下文。无需维护复杂的 Embedding 管线,无需搭建向量数据库,也无需调优分块策略。
针对各大主流 AI 框架提供开箱即用的封装层:
// 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
// 混合检索(默认模式)—— 单次查询同时融合 RAG 与记忆
const results = await client.search({
q: "how do I deploy?",
containerTag: "user_123",
searchMode: "hybrid",
});
// 同时返回部署相关文档 (RAG) 以及用户的部署偏好设置 (Memory)
// 仅检索记忆
const results = await client.search({
q: "user preferences",
containerTag: "user_123",
searchMode: "memories",
});
传统记忆方案依赖搜索 —— 开发者必须预先清楚该查询什么。而 Supermemory 会自动为每位用户维护动态画像:
const { profile } = await client.profile({ containerTag: "user_123" });
// profile.static → ["Acme 资深工程师", "偏好深色模式", "使用 Vim"]
// profile.dynamic → ["正在处理认证系统迁移", "正在排查限流问题"]
单次调用,延迟仅约 50ms。将其直接注入系统提示词(System Prompt),你的 Agent 就能瞬间知晓交谈对象的全貌。
自动将外部数据同步至知识库:
Google Drive · Gmail · Notion · OneDrive · GitHub · 网络爬虫
基于实时 Webhook 驱动。文档将被自动解析、切片并索引以供检索。
| 方法 | 用途 |
|---|---|
client.add() |
存储内容 —— 文本、对话、URL、HTML |
client.profile() |
单次调用同时获取用户画像与可选搜索结果 |
client.search() |
跨记忆与文档的混合检索 (searchMode) |
client.search.documents() |
带元数据过滤条件的文档检索(传统 v3 响应结构) |
client.documents.uploadFile() |
上传 PDF、图像、视频、代码文件 |
client.documents.list() |
列出并过滤文档 |
client.settings.update() |
配置记忆提取与文档切片参数 |
完整 API 文档参考 → supermemory.ai/docs
Supermemory 本地版 —— 自主运行
在本地机器上体验顶尖记忆引擎。单一二进制文件,零配置要求。
curl -fsSL https://supermemory.ai/install | bash
# 或
npx supermemory local
初次启动会自动完成嵌入式 Supermemory 图引擎与本地 Embedding 模型的初始化,配置好凭证后输出 API Key。完整的 Memory API —— 包括文档、记忆、用户画像及混合检索 —— 均直接运行于 http://localhost:6767 之上。
const client = new Supermemory({
apiKey: "sm_...",
baseURL: "http://localhost:6767", // 仅需修改此基础 URL
});
- 支持任意模型接入 —— 兼容 OpenAI、Anthropic、Gemini、Groq 或任何 OpenAI 兼容格式的端点。初次启动提供交互式向导指引配置。
- Embeddings —— 默认使用本地
Xenova/bge-base-en-v1.5(无需 API Key);亦可选择接入 OpenAI、Gemini 或 Ollama。技术栈与云端版本保持一致。 - 按需完全离线 —— 连接至 Ollama(使用
gpt-oss:20b表现极佳),保证没有任何数据离开你的机器。 - 你的数据,统一目录归档 —— 数据永远由你全权掌控
English / 原文
State-of-the-art memory and context engine for AI.
Docs · Quickstart · Self-host · Dashboard · Discord
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 onLongMemEval, 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.
Give Claude Code, Muse 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
Plugins and the MCP server give any compatible AI assistant persistent memory. One install, and your AI remembers you.
Supermemory comes built with plugins for Claude Code, Muse Code, Cursor, Codex, OpenCode, OpenClaw, and Hermes.
These plugins are implementations of the supermemory API, and they are open source!
You can find them here:
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
| 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. |
Once installed, Supermemory runs in the background:
- You talk to your AI normally. Share preferences, mention projects, discuss problems.
- Supermemory extracts and stores the important stuff. Facts, preferences, project context — not noise.
- 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.
Claude Desktop · Cursor · Windsurf · VS Code · Claude Code · OpenCode · OpenClaw · Hermes
The MCP server is open source — view the source.
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.
npm install supermemory # or: pip install supermemory
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.
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
// 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",
});
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.
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.
| 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
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
});
- Bring any model — OpenAI, Anthropic, Gemini, Groq, or any OpenAI-compatible endpoint. An interactive wizard walks you through it on first boot.
- Embeddings — local
Xenova/bge-base-en-v1.5by default (no API key); optionally OpenAI, Gemini, or Ollama. Same provider stack as cloud. - Fully offline if you want — point it at Ollama (
gpt-oss:20bworks great) and nothing leaves your machine. - Your data, one directory — everything lives in
./.supermemory, easy to back up or move. - Same API as the platform — prototype locally, ship on the hosted platform by changing
baseURL.
Read the self-hosting docs — quickstart, configuration, embeddings, and local vs. Enterprise.
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..

