连接器指南阅读约 4 分钟16 个 MCP 工具7 种语言

Mem0 MCP 服务器:长期记忆与用户画像

借助 Mem0 Platform 为你的 AI 提供长期记忆:按用户、智能体、应用或会话保存对话中的事实,按语义搜索,列出、读取和修正记忆并追踪其变化,还能查看用户、智能体、画像、处理事件和用量。

HC作者:HelpCode 团队更新于 4 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

Mem0

Mem0

Give your AI a long-term memory with the Mem0 Platform: store facts from conversations per user, agent or session, search them by meaning, list, read, correct and trace the history of memories, and see users, agents, profiles, processing events and usage.

个工具

16

区域

INTL

类别

公共数据

身份验证

API Key

所需环境变量

MEM0_API_KEY
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

摘要

借助 Mem0 Platform 为你的 AI 提供长期记忆:按用户、智能体、应用或会话保存对话中的事实,按语义搜索,列出、读取和修正记忆并追踪其变化,还能查看用户、智能体、画像、处理事件和用量。

引导式设置

2 分钟将 Mem0 连接到 Claude、ChatGPT 或 Copilot

开始 AnythingMCP Cloud 免费试用,在引导式设置中连接 Mem0,再把你的 MCP URL 添加到你的 AI 助手。无需代码,也无需自行运行服务器。

无需信用卡 · 7 天试用 · 提供自托管方案

试试这样问

Mem0 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

Mem0 · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Mem0、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

Mem0

借助 Mem0 Platform 为你的 AI 提供长期记忆:按用户、智能体、应用或会话保存对话中的事实,按语义搜索,列出、读取和修正记忆并追踪其变化,还能查看用户、智能体、画像、处理事件和用量。

设置

设置大约需要 2 分钟。你需要一个 Mem0 Platform 账户;免费套餐对存储的记忆数量和搜索次数有每月上限。

  1. 登录 https://app.mem0.ai,打开 API Keys(https://app.mem0.ai/dashboard/api-keys)。
  2. 创建密钥并复制。密钥属于一个组织和一个项目,所有记忆都在那里读写。
  3. 把它粘贴到 MEM0_API_KEY,不要带 Token 字样。连接器以 Authorization: Token <key> 发送密钥。
  4. 安装连接器并运行 mem0_ping:它会显示密钥所用的组织、项目和账户邮箱。

费用:没有工具按次计费,但套餐会统计用量。mem0_add_memories 计入存储记忆的上限,mem0_search_memories 计为一次检索(搜索)调用。mem0_get_stats 显示总量和套餐的检索上限。

作用范围:每条记忆至少属于一个实体 ID:user_id、agent_id、app_id 或 run_id(一次会话)。请使用你自己系统中稳定的 ID,例如客户编号。搜索和列表需要一个至少包含其中之一的 filters 对象,例如 {"user_id": "alice"},或组合使用:{"AND": [{"user_id": "alice"}, {"agent_id": "support-bot"}]}。过滤器还支持 OR、NOT 以及运算符 in、gte、lte、gt、lt、ne、contains 和 icontains,例如 {"created_at": {"gte": "2026-01-01"}}。

记住:mem0_add_memories 接收 messages(用户和助手的对话轮次)和一个实体 ID。Mem0 会从中提取持久的事实,例如“偏好素食”。提取在后台进行:响应为带 event_id 的 status PENDING,用 mem0_get_event 可以看到何时变为 SUCCEEDED,以及新增或修改了哪些记忆。infer: false 会逐字保存每条消息并立即返回。metadata、expiration_date、includes、excludes 和 custom_instructions 用于控制保留哪些内容。保存个人信息之前,AI 会先告诉你它要保存什么。

回忆:mem0_search_memories 接收自然语言的 query 和 filters,返回 memory、score(相关度)、categories、metadata 和日期。top_k(默认 10,最多 100)返回更多结果,rerank: true 改善排序,threshold 设定最低分数。

浏览和修正:mem0_list_memories 列出与 filters 匹配的所有记忆,最新的在前,可选日期范围、类别和关键词;mem0_get_memory 读取一条;mem0_get_memory_history 显示它如何变化(新旧文本、ADD、UPDATE 或 DELETE 事件以及触发变化的输入)。mem0_update_memory 替换一条记忆的 text、metadata 或 expiration_date;AI 会先和你确认要修改的记忆和新文本。

实体、画像和活动:mem0_list_entities 列出拥有记忆的用户、智能体、应用和运行(run)及其记忆数量;mem0_get_entity 读取一个实体;mem0_create_user 在还没有任何记忆之前,用元数据注册一个用户 ID。mem0_get_user_profile 返回 Mem0 在后台为用户构建的画像;返回 200、带 status 但没有画像,表示画像尚未生成。mem0_list_events 和 mem0_get_event 显示添加和搜索操作的状态(PENDING、RUNNING、SUCCEEDED、FAILED)、延迟和错误。

安装时关闭的工具:mem0_delete_memory 和 mem0_delete_entity。两者都无法撤销,删除实体会同时删除其全部记忆,因此由工作区管理员在团队需要时开启。

数据格式:ID 为 UUID。日期为 UTC 的 ISO 8601 格式;添加和列表中的日期过滤使用 YYYY-MM-DD。categories 是 Mem0 自己的标签,例如 food、travel 或 professional_details。

分页:mem0_list_memories 接收 page(从 1 开始)和 page_size(默认 50,最多 100);mem0_list_entities 分页方式相同。列表响应包含 count、next 和 previous;next 为 null 表示已是最后一页。回答问题时,AI 会优先使用 mem0_search_memories,而不是翻遍所有页面。

限制:各套餐按月限制存储的记忆数量和搜索调用次数;mem0_get_stats 显示 total_retrieval_events_limit。

常见错误:400 表示缺少过滤器或过滤器无效(搜索和列表不接受顶层的 user_id,它应放在 filters 中)、添加时没有实体 ID,或日期格式错误;401 表示密钥错误或已撤销;404 表示记忆、实体或事件不存在;429 表示达到速率限制或套餐上限(AI 会等待,而不是循环重试)。

该连接器不批量删除记忆,也不使用 Mem0 的开源库;它只适用于托管的 Mem0 Platform。

前提条件: MEM0_API_KEY

本地安装连接器

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

打开 http://localhost:3000/connectors/store,选择 Mem0 并填入前提条件中列出的环境变量。

可用工具

ToolWhat it does
mem0_pingCheck the Mem0 API key and show the organization id, project id and account email it works on
mem0_add_memoriesStore memories from a conversation in Mem0: Mem0 extracts the lasting facts and saves them under the given user, agent, app or run (at…
mem0_search_memoriesSearch Mem0 memories by meaning with a natural-language query, within filters that name at least one user_id, agent_id, app_id or run_id
mem0_list_memoriesList all Mem0 memories that match filters (at least one user_id, agent_id, app_id or run_id), page by page, with optional date range…
mem0_get_memoryRead one Mem0 memory by id: its text, user, agent, app and session ids, metadata, categories, creation, update and expiration dates
mem0_update_memoryReplace the text, metadata or expiration date of one Mem0 memory, e.g. to correct a wrong fact
mem0_get_memory_historyShow how one Mem0 memory changed over time: each entry has the old and new text, the event (ADD, UPDATE, DELETE), the conversation input…
mem0_list_entitiesList the users, agents, apps and runs that have memories in the Mem0 project, with their type, name, memory count and dates, plus totals…
mem0_get_entityRead one Mem0 entity (a user, agent, app or run): id, name, owner, metadata and dates
mem0_get_user_profileRead the memory profile Mem0 builds for a user: a summary of who they are and what they prefer
mem0_create_userRegister a user id in the Mem0 project with optional metadata, before any memory is added for it
mem0_list_eventsList the memory operations of the Mem0 project (add and search events) with type, status (PENDING, RUNNING, SUCCEEDED, FAILED), payload…
mem0_get_eventRead one Mem0 event, e.g. the event_id returned by mem0_add_memories: status, the memories it added, updated or deleted, latency…
mem0_get_statsShow Mem0 usage statistics: total memories, add events, search (retrieval) events and the plan's retrieval limit, and memories per user…
mem0_delete_memoryDelete one Mem0 memory permanently
mem0_delete_entityDelete a Mem0 user, agent, app or run together with all of its memories

示例提示

  • “为用户 alice 记住:她吃素,并且对坚果过敏。”
  • “关于用户 alice 的饮食偏好我们知道些什么?请搜索她的记忆。”
  • “我上次添加时的记忆提取成功了吗?创建了哪些记忆?”
  • “说 alice 住在里昂的那条记忆已经过时了,她搬到了都灵。请修正它并显示它的历史。”
  • “哪些用户的记忆最多?我们离套餐的搜索上限还有多远?”

下一步

这份指南对你有帮助吗?

2 分钟将 Mem0 连接到 Claude、ChatGPT 或 Copilot

开始 AnythingMCP Cloud 免费试用,在引导式设置中连接 Mem0,再把你的 MCP URL 添加到你的 AI 助手。无需代码,也无需自行运行服务器。

相关指南

连接器

将 Mem0 MCP 接入 ChatGPT:保存记忆

借助 Mem0 Platform 为你的 AI 提供长期记忆:按用户、智能体、应用或会话保存对话中的事实,按语义搜索,列出、读取和修正记忆并追踪其变化,还能查看用户、智能体、画像、处理事件和用量。

连接器

将 Mem0 MCP 接入 Claude:搜索长期记忆

借助 Mem0 Platform 为你的 AI 提供长期记忆:按用户、智能体、应用或会话保存对话中的事实,按语义搜索,列出、读取和修正记忆并追踪其变化,还能查看用户、智能体、画像、处理事件和用量。

连接器

将 Mem0 MCP 接入 Cursor:搜索记忆

借助 Mem0 Platform 为你的 AI 提供长期记忆:按用户、智能体、应用或会话保存对话中的事实,按语义搜索,列出、读取和修正记忆并追踪其变化,还能查看用户、智能体、画像、处理事件和用量。

连接器

将 Mem0 MCP 接入 Gemini CLI

借助 Mem0 Platform 为你的 AI 提供长期记忆:按用户、智能体、应用或会话保存对话中的事实,按语义搜索,列出、读取和修正记忆并追踪其变化,还能查看用户、智能体、画像、处理事件和用量。

连接器

将 Mem0 MCP 接入 Meta Muse

借助 Mem0 Platform 为你的 AI 提供长期记忆:按用户、智能体、应用或会话保存对话中的事实,按语义搜索,列出、读取和修正记忆并追踪其变化,还能查看用户、智能体、画像、处理事件和用量。

连接器

将 Mem0 MCP 接入 Microsoft Copilot

借助 Mem0 Platform 为你的 AI 提供长期记忆:按用户、智能体、应用或会话保存对话中的事实,按语义搜索,列出、读取和修正记忆并追踪其变化,还能查看用户、智能体、画像、处理事件和用量。