Supermemory is a state-of-the-art memory and context infrastructure for AI agent
典型用途
许多 AI Agent 的问题不在于单次回答能力,而在于每次对话都像重新开始:用户偏好很快遗忘,历史结论难以复用,文档多了以后也很难准确找到所需信息。Supermemory 面向这些长期记忆与上下文管理需求,让 Agent 能保留跨会话信息,并从持续增长的知识中检索相关内容。
在典型开发任务中,Agent 可利用 Memory API 提取并更新从对话中学到的用户事实,通过 User Profiles 结合稳定资料与近期动态,为回答提供个性化上下文;也可使用 RAG 对文档、PDF、图片、视频和网页等内容进行语义检索。最终交付通常包括记忆写入与检索逻辑、用户画像设计,以及面向业务资料库的搜索与引用能力。
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.
Use Supermemory
🧑💻 I use AI tools
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.
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.
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" }));
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
});
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.5 by default (no API key); optionally OpenAI, Gemini, or Ollama. Same provider stack as cloud.
Offline text memories if you want — point it at Ollama (gpt-oss:20b works great), disable telemetry with SUPERMEMORY_DISABLE_TELEMETRY=1, and use local text or file inputs after the first embedding-model download. URL ingestion uses a hosted reader service.
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.
Run with Docker
Prebuilt images support Linux amd64 and arm64. You don’t need to build or clone the server source.
For a new installation, run these commands in an empty directory and set your own LLM provider key:
The API listens on http://localhost:6767. Data and credentials persist in the supermemory_supermemory-data volume. Get your local API key with docker compose exec supermemory cat /data/api-key; requests require it even on localhost.
Read the Docker setup and upgrade instructions for persistent provider configuration, backups and upgrades. Keep the existing volume and keys when upgrading; don’t run docker compose down -v.
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.