supermemoryai/supermemory

GitHub: supermemoryai/supermemory

Supermemory是一个高性能AI记忆与上下文引擎,为AI应用和Agent提供跨对话的持久化记忆、用户画像、混合搜索和知识库连接能力。

Stars: 20219 | Forks: 1869

Supermemory

最先进的 AI 记忆与上下文引擎。

文档 · 快速开始 · 控制台 · Discord

npm pypi docs

Supermemory 是 AI 的记忆与上下文层。**在 [LongMemEval](https://github.com/xiaowu0162/LongMemEval)、[LoCoMo](https://github.com/snap-research/locomo) 和 [ConvoMem](https://github.com/Salesforce/ConvoMem) 上排名第一** —— 这是 AI 记忆领域的三个主要基准测试。 我们是一个研究实验室,致力于构建引擎、插件及相关工具。 你的 AI 会在对话之间遗忘所有内容。Supermemory 解决了这个问题。 它会自动从对话中学习,提取事实,构建用户画像,处理知识更新和矛盾,遗忘过期信息,并在正确的时机提供正确的上下文。完整的 RAG、连接器、文件处理 —— 整个上下文技术栈,一个系统搞定。 | | | |---|---| | 🧠 **记忆** | 从对话中提取事实。处理时间变化、矛盾和自动遗忘。 | | 👤 **用户画像** | 自动维护的用户上下文 —— 稳定事实 + 近期活动。一次调用,约 50ms。 | | 🔍 **混合搜索** | 单次查询中实现 RAG + 记忆。知识库文档与个性化上下文结合。 | | 🔌 **连接器** | Google Drive · Gmail · Notion · OneDrive · GitHub —— 通过实时 webhooks 自动同步。 | | 📄 **多模态提取器** | PDF、图像(OCR)、视频(转录)、代码(AST 感知分块)。上传即可使用。 | 所有这些都整合在我们单一的记忆结构和本体论中。 image ## 使用 Supermemory

🧑‍💻 我使用 AI 工具

使用我们的应用程序构建你个人的超级记忆。构建跨**每次对话的持久记忆图谱**。 你的 AI 会记住你的偏好、项目和过去的讨论 —— 并且随着时间推移变得更聪明。 **[→ 跳转至用户设置](#give-your-ai-memory)**

🔧 我正在构建 AI 产品

通过**单一 API** 为你的 Agent 和应用添加记忆、RAG、用户画像和连接器。 无需配置向量数据库。无需 Embedding 管道。无需分块策略。 **[→ 跳转至开发者快速开始](#build-with-supermemory-api)**
## 赋予你的 AI 记忆能力 Supermemory 应用程序、浏览器扩展、插件和 MCP 服务器为任何兼容的 AI 助手提供持久记忆。一次安装,你的 AI 就能记住你。 ### 应用程序 你可以免费使用我们的面向消费者的应用程序,无需编写任何代码即可使用 supermemory。 从 https://app.supermemory.ai 开始 image 它还内置了一个 Agent,我们称之为 Nova。 ### Supermemory 插件 Supermemory 为 Claude Code、OpenCode 和 OpenClaw 构建了插件。 image 这些插件是 supermemory API 的实现,并且是开源的! 你可以在这里找到它们: - Openclaw 插件: https://github.com/supermemoryai/openclaw-supermemory - Claude code 插件: https://github.com/supermemoryai/claude-supermemory - OpenCode 插件: https://github.com/supermemoryai/opencode-supermemory ### MCP - 快速安装 ``` npx -y install-mcp@latest https://mcp.supermemory.ai/mcp --client claude --oauth=yes ``` 将 `claude` 替换为你的客户端:`cursor`、`windsurf`、`vscode` 等。 在此处阅读更多关于我们 MCP 的信息 - https://supermemory.ai/docs/supermemory-mcp/mcp ### 你的 AI 获得了什么 | 工具 | 功能 | |---|---| | `memory` | 保存或遗忘信息。当你分享值得记住的内容时,你的 AI 会自动调用此工具。 | | `recall` | 通过查询搜索记忆。返回相关记忆 + 你的用户画像摘要。 | | `context` | 在对话开始时注入你的完整画像(偏好、近期活动)。在 Cursor 和 Claude Code 中,只需输入 `/context`。 | ### 工作原理 安装后,Supermemory 会在后台运行: 1. **你正常与 AI 交谈。** 分享偏好,提及项目,讨论问题。 2. **Supermemory 提取并存储重要内容。** 事实、偏好、项目上下文 —— 而非噪音。 3. **下次对话时,你的 AI 已经认识你了。** 它会回忆起你正在做的事情、你的喜好以及之前的讨论内容。 记忆通过**项目**(容器标签)进行范围划分,因此你可以将工作和个人上下文分开,或者按客户、仓库或其他任何方式进行组织。 ### 支持的客户端 **Claude Desktop** · **Cursor** · **Windsurf** · **VS Code** · **Claude Code** · **OpenCode** · **OpenClaw** MCP 服务器是开源的 —— [查看源码](https://supermemory.ai/docs/supermemory-mcp/mcp)。 ### 手动配置 将此添加到你的 MCP 客户端配置中: ``` { "mcpServers": { "supermemory": { "url": "https://mcp.supermemory.ai/mcp" } } } ``` 或者使用 API 密钥代替 OAuth: ``` { "mcpServers": { "supermemory": { "url": "https://mcp.supermemory.ai/mcp", "headers": { "Authorization": "Bearer sm_your_api_key_here" } } } } ``` ## 使用 Supermemory 构建 (API) 如果你正在构建 AI Agent 或应用程序,Supermemory 通过一个 API 为你提供完整的上下文技术栈 —— 记忆、RAG、用户画像、连接器和文件处理。 ### 安装 ``` 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 自动提取记忆,构建用户画像,并返回相关上下文。无需 Embedding 管道,无需向量数据库配置,无需分块策略。 ### 框架集成 适用于所有主要 AI 框架的即插即用封装: ``` // Vercel AI SDK import { withSupermemory } from "@supermemory/tools/ai-sdk"; const model = withSupermemory(openai("gpt-4o"), "user_123"); // 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.memories({ 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.memories({ q: "user preferences", containerTag: "user_123", searchMode: "memories", }); ``` ### 用户画像 传统的记忆依赖于搜索 —— 你需要知道要查找什么。Supermemory 为每个用户自动维护一个画像: ``` 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"] ``` 一次调用。约 50ms。注入到你的系统提示中,你的 Agent 就能立即知道它在与谁对话。 ### 连接器 将外部数据自动同步到你的知识库: **Google Drive** · **Gmail** · **Notion** · **OneDrive** · **GitHub** · **Web Crawler** 实时 webhooks。文档自动处理、分块并支持搜索。 ### API 速览 | 方法 | 用途 | |---|---| | `client.add()` | 存储内容 —— 文本、对话、URL、HTML | | `client.profile()` | 用户画像 + 一次性搜索 | | `client.search.memories()` | 跨记忆和文档的混合搜索 | | `client.search.documents()` | 带有元数据过滤器的文档搜索 | | `client.documents.uploadFile()` | 上传 PDF、图像、视频、代码 | | `client.documents.list()` | 列出和过滤文档 | | `client.settings.update()` | 配置记忆提取和分块 | 完整 API 参考 → [supermemory.ai/docs](https://supermemory.ai/docs) ## 基准测试 Supermemory 在所有主要的 AI 记忆基准测试中均达到最先进水平: | 基准测试 | 测量内容 | 结果 | |---|---|---| | **[LongMemEval](https://github.com/xiaowu0162/LongMemEval)** | 跨会话的长期记忆及知识更新 | **81.6% — #1** | | **[LoCoMo](https://github.com/snap-research/locomo)** | 跨扩展对话的事实回忆(单跳、多跳、时间、对抗性) | **#1** | | **[ConvoMem](https://github.com/Salesforce/ConvoMem)** | 个性化和偏好学习 | **#1** | 我们还构建了 **[MemoryBench](https://supermemory.ai/docs/memorybench/overview)** —— 一个开源框架,用于对记忆提供商进行标准化、可复现的基准测试。直接对比 Supermemory、Mem0、Zep 和其他方案: ``` bun run src/index.ts run -p supermemory -b longmemeval -j gpt-4o -r my-run ``` ### 对你自己的记忆方案进行基准测试 我们为公司提供了一个 Agent 技能,以便针对 supermemory 对其自己的上下文和记忆方案进行基准测试。 ``` npx skills add supermemoryai/memorybench ``` 只需运行此命令并执行 `/benchmark-context` - Supermemory 将自动为你完成工作! ## 记忆的底层工作原理 ``` 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 ``` **记忆不是 RAG。** RAG 检索文档块 —— 无状态,对每个人结果相同。记忆则随时间提取并追踪关于用户的*事实*。它理解“我刚搬到旧金山”会取代“我住在纽约”。Supermemory 默认同时运行这两者,因此你在每次查询中都能获得知识库检索*和*个性化上下文。在此处阅读更多相关信息 - https://supermemory.ai/docs/concepts/memory-vs-rag **自动遗忘。** Supermemory 知道记忆何时变得无关紧要。临时事实(“我明天有考试”)在日期过后即过期。矛盾会自动解决。噪音永远不会成为永久记忆。 ## 链接 - 📖 [文档](https://supermemory.ai/docs) - 🚀 [快速开始](https://supermemory.ai/docs/quickstart) - 🧪 [MemoryBench](https://supermemory.ai/docs/memorybench/overview) - 🔌 [集成](https://supermemory.ai/docs/integrations) - 💬 [Discord](https://supermemory.link/discord) - 𝕏 [Twitter](https://twitter.com/supermemory)

给你的 AI 一个记忆。是时候了。

标签:AI基础设施, AI记忆, Chatbot, DLL 劫持, GNU通用公共许可证, LLM, Node.js, Python, RAG, Ruby, Supermemory, Unmanaged PE, 上下文窗口, 上下文管理, 中间件, 人工智能, 信息提取, 分布式搜索, 向量数据库, 大语言模型, 威胁情报, 对话系统, 开发者工具, 开源, 数据连接器, 文件处理, 无后门, 检索增强生成, 用户模式Hook绕过, 用户画像, 知识库, 自动化攻击, 记忆引擎, 语义搜索, 逆向工具, 长期记忆