docs: make Chinese README the default
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
<!-- WEHUB_ZH_README -->
|
||||
> [!NOTE]
|
||||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||||
> [English](./README.en.md) · [原始项目](https://github.com/mem0ai/mem0) · [上游 README](https://github.com/mem0ai/mem0/blob/HEAD/README.md)
|
||||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/mem0ai/mem0">
|
||||
<img src="docs/images/banner-sm.png" width="800px" alt="Mem0 - The Memory Layer for Personalized AI">
|
||||
<img src="docs/images/banner-sm.png" width="800px" alt="Mem0 - 面向个性化 AI 的记忆层">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center" style="display: flex; justify-content: center; gap: 20px; align-items: center;">
|
||||
@@ -10,11 +16,11 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://mem0.ai">Learn more</a>
|
||||
<a href="https://mem0.ai">了解更多</a>
|
||||
·
|
||||
<a href="https://mem0.dev/DiG">Join Discord</a>
|
||||
<a href="https://mem0.dev/DiG">加入 Discord</a>
|
||||
·
|
||||
<a href="https://mem0.dev/demo">Demo</a>
|
||||
<a href="https://mem0.dev/demo">演示</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
@@ -22,16 +28,16 @@
|
||||
<img src="https://img.shields.io/badge/Discord-%235865F2.svg?&logo=discord&logoColor=white" alt="Mem0 Discord">
|
||||
</a>
|
||||
<a href="https://pepy.tech/project/mem0ai">
|
||||
<img src="https://img.shields.io/pypi/dm/mem0ai" alt="Mem0 PyPI - Downloads">
|
||||
<img src="https://img.shields.io/pypi/dm/mem0ai" alt="Mem0 PyPI - 下载量">
|
||||
</a>
|
||||
<a href="https://github.com/mem0ai/mem0">
|
||||
<img src="https://img.shields.io/github/commit-activity/m/mem0ai/mem0?style=flat-square" alt="GitHub commit activity">
|
||||
<img src="https://img.shields.io/github/commit-activity/m/mem0ai/mem0?style=flat-square" alt="GitHub 提交活动">
|
||||
</a>
|
||||
<a href="https://pypi.org/project/mem0ai" target="blank">
|
||||
<img src="https://img.shields.io/pypi/v/mem0ai?color=%2334D058&label=pypi%20package" alt="Package version">
|
||||
<img src="https://img.shields.io/pypi/v/mem0ai?color=%2334D058&label=pypi%20package" alt="包版本">
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/mem0ai" target="blank">
|
||||
<img src="https://img.shields.io/npm/v/mem0ai" alt="Npm package">
|
||||
<img src="https://img.shields.io/npm/v/mem0ai" alt="Npm 包">
|
||||
</a>
|
||||
<a href="https://www.ycombinator.com/companies/mem0">
|
||||
<img src="https://img.shields.io/badge/Y%20Combinator-S24-orange?style=flat-square" alt="Y Combinator S24">
|
||||
@@ -39,56 +45,56 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://mem0.ai/research"><strong>📄 Benchmarking Mem0's token-efficient memory algorithm →</strong></a>
|
||||
<a href="https://mem0.ai/research"><strong>📄 Mem0 高 Token 效率记忆算法基准测试 →</strong></a>
|
||||
</p>
|
||||
|
||||
## New Memory Algorithm (April 2026)
|
||||
## 新记忆算法(2026 年 4 月)
|
||||
|
||||
| Benchmark | Old | New | Tokens | Latency p50 |
|
||||
| Benchmark | 旧版 | 新版 | Tokens | 延迟 p50 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| **LoCoMo** | 71.4 | **92.5** | 7.0K | 0.88s |
|
||||
| **LongMemEval** | 67.8 | **94.4** | 6.8K | 1.09s |
|
||||
| **BEAM (1M)** | — | **64.1** | 6.7K | 1.00s |
|
||||
| **BEAM (10M)** | — | **48.6** | 6.9K | 1.05s |
|
||||
|
||||
All benchmarks run on the same production-representative model stack. Single-pass retrieval (one call, no agentic loops) at a top_200 retrieval budget. Scores reflect Mem0's managed platform, which includes proprietary optimizations not available in the open-source SDK; open-source users should expect directionally similar gains but not identical numbers.
|
||||
所有基准测试均在相同的、具有生产代表性的模型栈上运行。采用单次检索(一次调用,无 agentic 循环),检索预算为 top_200。分数反映的是 Mem0 托管平台的表现,其中包含开源 SDK 中不可用的专有优化;开源用户可预期方向相近的提升,但数值不会完全一致。
|
||||
|
||||
**What changed:**
|
||||
- **Single-pass ADD-only extraction** -- one LLM call, no UPDATE/DELETE. Memories accumulate; nothing is overwritten.
|
||||
- **Agent-generated facts are first-class** -- when an agent confirms an action, that information is now stored with equal weight.
|
||||
- **Entity linking** -- entities are extracted, embedded, and linked across memories for retrieval boosting.
|
||||
- **Multi-signal retrieval** -- semantic, BM25 keyword, and entity matching scored in parallel and fused.
|
||||
- **Temporal Reasoning** -- time-aware retrieval that ranks the right dated instance for queries about current state, past events, and upcoming plans.
|
||||
**主要变更:**
|
||||
- **单次 ADD-only 提取** -- 一次 LLM 调用,无 UPDATE/DELETE。记忆持续累积;不会被覆盖。
|
||||
- **Agent 生成的事实为一等公民** -- 当 agent 确认某项操作时,该信息现在会以同等权重存储。
|
||||
- **实体链接(Entity linking)** -- 提取实体、进行嵌入,并在各条记忆间建立链接以提升检索效果。
|
||||
- **多信号检索(Multi-signal retrieval)** -- 语义、BM25 关键词与实体匹配并行评分并融合。
|
||||
- **时序推理(Temporal Reasoning)** -- 具备时间感知的检索,针对当前状态、过往事件和即将发生的计划类查询,对正确日期的实例进行排序。
|
||||
|
||||
See the [migration guide](https://docs.mem0.ai/migration/oss-v2-to-v3) for upgrade instructions. The [evaluation framework](https://github.com/mem0ai/memory-benchmarks) is open-sourced so anyone can reproduce the numbers.
|
||||
升级说明请参阅[迁移指南](https://docs.mem0.ai/migration/oss-v2-to-v3)。[评估框架](https://github.com/mem0ai/memory-benchmarks) 已开源,任何人都可以复现这些数字。
|
||||
|
||||
## Research Highlights
|
||||
- **92.5 on LoCoMo** -- +21 points over the previous algorithm
|
||||
- **94.4 on LongMemEval** -- +27 points, with 98.2 on assistant memory recall
|
||||
- **64.1 on BEAM (1M)** -- production-scale memory evaluation at 1M tokens
|
||||
- [Read the full paper](https://mem0.ai/research)
|
||||
## 研究亮点
|
||||
- **LoCoMo 得分 92.5** -- 较上一版算法提升 21 分
|
||||
- **LongMemEval 得分 94.4** -- 提升 27 分,assistant 记忆召回达 98.2
|
||||
- **BEAM (1M) 得分 64.1** -- 在 1M tokens 规模下的生产级记忆评估
|
||||
- [阅读完整论文](https://mem0.ai/research)
|
||||
|
||||
# Introduction
|
||||
# 简介
|
||||
|
||||
[Mem0](https://mem0.ai) ("mem-zero") enhances AI assistants and agents with an intelligent memory layer, enabling personalized AI interactions. It remembers user preferences, adapts to individual needs, and continuously learns over time—ideal for customer support chatbots, AI assistants, and autonomous systems.
|
||||
[Mem0](https://mem0.ai)("mem-zero")通过智能记忆层增强 AI 助手与 agent,实现个性化的 AI 交互。它能记住用户偏好、适应个人需求,并随时间持续学习——非常适合客服聊天机器人、AI 助手和自主系统。
|
||||
|
||||
### Key Features & Use Cases
|
||||
### 核心特性与用例
|
||||
|
||||
**Core Capabilities:**
|
||||
- **Multi-Level Memory**: Seamlessly retains User, Session, and Agent state with adaptive personalization
|
||||
- **Developer-Friendly**: Intuitive API, cross-platform SDKs, and a fully managed service option
|
||||
**核心能力:**
|
||||
- **多级记忆(Multi-Level Memory)**:无缝保留 User、Session 与 Agent 状态,并支持自适应个性化
|
||||
- **开发者友好**:直观的 API、跨平台 SDK,以及完全托管的服务选项
|
||||
|
||||
**Applications:**
|
||||
- **AI Assistants**: Consistent, context-rich conversations
|
||||
- **Customer Support**: Recall past tickets and user history for tailored help
|
||||
- **Healthcare**: Track patient preferences and history for personalized care
|
||||
- **Productivity & Gaming**: Adaptive workflows and environments based on user behavior
|
||||
**应用场景:**
|
||||
- **AI 助手**:一致且上下文丰富的对话
|
||||
- **客户支持**:回忆历史工单与用户记录,提供定制化帮助
|
||||
- **医疗健康**:跟踪患者偏好与病史,实现个性化护理
|
||||
- **生产力与游戏**:基于用户行为自适应工作流与环境
|
||||
|
||||
## 🚀 Quickstart Guide <a name="quickstart"></a>
|
||||
## 🚀 快速入门指南 <a name="quickstart"></a>
|
||||
|
||||
### Sign up as an agent
|
||||
### 以 Agent 身份注册
|
||||
|
||||
AI agents can mint a working Mem0 API key in under five seconds — no email, no dashboard, no OTP. Four commands end-to-end:
|
||||
AI agent 可在五秒内生成可用的 Mem0 API 密钥 —— 无需邮箱、无需控制台、无需 OTP。端到端只需四条命令:
|
||||
|
||||
```bash
|
||||
# 1. Install
|
||||
@@ -104,40 +110,40 @@ mem0 add "I am using mem0"
|
||||
mem0 search "am I using mem0"
|
||||
```
|
||||
|
||||
The human owner can claim the account later with `mem0 init --email <their-email>` — same key, memories preserved. Full guide: [Sign up as an agent](https://docs.mem0.ai/platform/agent-signup).
|
||||
人类所有者可稍后通过 `mem0 init --email <their-email>` 认领账户 —— 同一密钥,记忆完整保留。完整指南:[以 Agent 身份注册](https://docs.mem0.ai/platform/agent-signup).
|
||||
|
||||
| | Library | Self-Hosted Server | Cloud Platform |
|
||||
|---|---------|-------------------|----------------|
|
||||
| **Best for** | Testing, prototyping | Teams running on their own infrastructure | Zero-ops production use |
|
||||
| **Setup** | `pip install mem0ai` | `docker compose up` | Sign up at [app.mem0.ai](https://app.mem0.ai?utm_source=oss&utm_medium=readme) |
|
||||
| **Dashboard** | -- | [Yes](https://docs.mem0.ai/open-source/setup) | Yes |
|
||||
| **Auth & API Keys** | -- | Yes | Yes |
|
||||
| **Advanced Features** | -- | Teasers | All included |
|
||||
| **最适合** | 测试、原型开发 | 在自有基础设施上运行的团队 | 零运维的生产使用 |
|
||||
| **设置** | `pip install mem0ai` | `docker compose up` | 在 [app.mem0.ai](https://app.mem0.ai?utm_source=oss&utm_medium=readme) 注册 |
|
||||
| **控制台** | -- | [有](https://docs.mem0.ai/open-source/setup) | 有 |
|
||||
| **认证与 API 密钥** | -- | 有 | 有 |
|
||||
| **高级功能** | -- | 预览 | 全部包含 |
|
||||
|
||||
Just testing? Use the library. Building for a team? Self-hosted. Want zero ops? Cloud.
|
||||
只是测试?用 Library。为团队构建?选自托管。想要零运维?选 Cloud。
|
||||
|
||||
### Library (pip / npm)
|
||||
### Library(pip / npm)
|
||||
|
||||
```bash
|
||||
pip install mem0ai
|
||||
```
|
||||
|
||||
For enhanced hybrid search with BM25 keyword matching and entity extraction, install with NLP support:
|
||||
如需增强型混合检索(BM25 关键词匹配与实体提取),请安装带 NLP 支持的版本:
|
||||
|
||||
```bash
|
||||
pip install mem0ai[nlp]
|
||||
python -m spacy download en_core_web_sm
|
||||
```
|
||||
|
||||
Install sdk via npm:
|
||||
通过 npm 安装 SDK:
|
||||
|
||||
```bash
|
||||
npm install mem0ai
|
||||
```
|
||||
|
||||
### Self-Hosted Server
|
||||
### 自托管服务器
|
||||
|
||||
> **Note:** Self-hosted auth is on by default. Upgrading from a pre-auth build? Set `ADMIN_API_KEY`, register an admin through the wizard, or `AUTH_DISABLED=true` for local dev only. See [upgrade notes](https://docs.mem0.ai/open-source/setup#upgrade-notes).
|
||||
> **注意:** 自托管认证默认开启。从启用认证前的版本升级?请设置 `ADMIN_API_KEY`,通过向导注册管理员,或仅在本地开发时使用 `AUTH_DISABLED=true`。详见[升级说明](https://docs.mem0.ai/open-source/setup#upgrade-notes).
|
||||
|
||||
```bash
|
||||
# Recommended: one command — start the stack, create an admin, issue the first API key.
|
||||
@@ -147,17 +153,17 @@ cd server && make bootstrap
|
||||
cd server && docker compose up -d # http://localhost:3000
|
||||
```
|
||||
|
||||
See the [self-hosted docs](https://docs.mem0.ai/open-source/overview) for configuration.
|
||||
配置说明请参阅[自托管文档](https://docs.mem0.ai/open-source/overview)。
|
||||
|
||||
### Cloud Platform
|
||||
### 云平台
|
||||
|
||||
1. Sign up on [Mem0 Platform](https://app.mem0.ai?utm_source=oss&utm_medium=readme)
|
||||
2. Embed the memory layer via SDK or API keys
|
||||
3. Using hosted Qdrant vectors? See the [Platform migration guide](https://docs.mem0.ai/migration/oss-to-platform) to import them into Mem0 Platform.
|
||||
1. 在 [Mem0 Platform](https://app.mem0.ai?utm_source=oss&utm_medium=readme) 注册
|
||||
2. 通过 SDK 或 API 密钥嵌入记忆层
|
||||
3. 使用托管的 Qdrant 向量?请参阅[平台迁移指南](https://docs.mem0.ai/migration/oss-to-platform),将其导入 Mem0 Platform。
|
||||
|
||||
### CLI
|
||||
|
||||
Manage memories from your terminal:
|
||||
在终端中管理记忆:
|
||||
|
||||
```bash
|
||||
npm install -g @mem0/cli # or: pip install mem0-cli
|
||||
@@ -167,13 +173,13 @@ mem0 add "Prefers dark mode and vim keybindings" --user-id alice
|
||||
mem0 search "What does Alice prefer?" --user-id alice
|
||||
```
|
||||
|
||||
See the [CLI documentation](https://docs.mem0.ai/platform/cli) for the full command reference.
|
||||
完整命令参考请参阅 [CLI 文档](https://docs.mem0.ai/platform/cli)。
|
||||
|
||||
### Agent Skills
|
||||
|
||||
Teach your AI coding assistant (Claude Code, Codex, Cursor, Windsurf, OpenCode, OpenClaw, and any tool that supports the skills standard) how to build with Mem0. Two categories:
|
||||
教会你的 AI 编程助手(Claude Code、Codex、Cursor、Windsurf、OpenCode、OpenClaw,以及任何支持 skills 标准的工具)如何使用 Mem0 进行开发。分为两类:
|
||||
|
||||
**Reference skills — always on** (SDK knowledge loaded into the assistant's context):
|
||||
**参考型 skills —— 始终开启**(将 SDK 知识加载到助手上下文中):
|
||||
|
||||
```bash
|
||||
npx skills add https://github.com/mem0ai/mem0 --skill mem0
|
||||
@@ -181,7 +187,7 @@ npx skills add https://github.com/mem0ai/mem0 --skill mem0-cli
|
||||
npx skills add https://github.com/mem0ai/mem0 --skill mem0-vercel-ai-sdk
|
||||
```
|
||||
|
||||
**Pipeline skills — run on demand** (execute an end-to-end workflow in an existing repo):
|
||||
**流水线型 skills —— 按需运行**(在现有仓库中执行端到端工作流):
|
||||
|
||||
```bash
|
||||
npx skills add https://github.com/mem0ai/mem0 --skill mem0-integrate
|
||||
@@ -189,15 +195,15 @@ npx skills add https://github.com/mem0ai/mem0 --skill mem0-test-integration
|
||||
npx skills add https://github.com/mem0ai/mem0 --skill mem0-oss-to-platform
|
||||
```
|
||||
|
||||
Use `/mem0-integrate` to wire Mem0 into an existing repo via a test-first pipeline, then `/mem0-test-integration` to verify. Use `/mem0-oss-to-platform` to migrate an existing project from Mem0 OSS to the hosted Platform SDK. See the [skills catalog](./skills/) or [Vibecoding with Mem0](https://docs.mem0.ai/vibecoding) for the full picture.
|
||||
使用 `/mem0-integrate` 通过测试优先(test-first)流水线将 Mem0 接入现有仓库,然后使用 `/mem0-test-integration` 进行验证。使用 `/mem0-oss-to-platform` 将现有项目从 Mem0 OSS 迁移到托管版 Platform SDK。完整说明请参阅 [skills 目录](./skills/) 或 [Vibecoding with Mem0](https://docs.mem0.ai/vibecoding) for the full picture.
|
||||
|
||||
### Basic Usage
|
||||
|
||||
Mem0 requires an LLM to function, with `gpt-5-mini` from OpenAI as the default. However, it supports a variety of LLMs; for details, refer to our [Supported LLMs documentation](https://docs.mem0.ai/components/llms/overview).
|
||||
Mem0 需要 LLM 才能运行,默认使用来自 OpenAI 的 `gpt-5-mini`。不过它也支持多种 LLM;详情请参阅我们的 [Supported LLMs documentation](https://docs.mem0.ai/components/llms/overview).
|
||||
|
||||
Mem0 uses `text-embedding-3-small` from OpenAI as the default embedding model. For best results with hybrid search (semantic + keyword + entity boosting), we recommend using at least [Qwen 600M](https://huggingface.co/Alibaba-NLP/gte-Qwen2-1.5B-instruct) or a comparable embedding model. See [Supported Embeddings](https://docs.mem0.ai/components/embedders/overview) for configuration details.
|
||||
Mem0 默认使用来自 OpenAI 的 `text-embedding-3-small` 作为嵌入(embedding)模型。要在混合搜索(语义 + 关键词 + 实体加权)中获得最佳效果,我们建议至少使用 [Qwen 600M](https://huggingface.co/Alibaba-NLP/gte-Qwen2-1.5B-instruct) 或同等级别的嵌入模型。配置详情请参阅 [Supported Embeddings](https://docs.mem0.ai/components/embedders/overview)
|
||||
|
||||
First step is to instantiate the memory:
|
||||
第一步是实例化 memory:
|
||||
|
||||
```python
|
||||
from openai import OpenAI
|
||||
@@ -236,24 +242,24 @@ if __name__ == "__main__":
|
||||
main()
|
||||
```
|
||||
|
||||
For detailed integration steps, see the [Quickstart](https://docs.mem0.ai/quickstart) and [API Reference](https://docs.mem0.ai/api-reference).
|
||||
详细的集成步骤请参阅 [Quickstart](https://docs.mem0.ai/quickstart) 和 [API Reference](https://docs.mem0.ai/api-reference).
|
||||
|
||||
## 🔗 Integrations & Demos
|
||||
|
||||
- **ChatGPT with Memory**: Personalized chat powered by Mem0 ([Live Demo](https://mem0.dev/demo))
|
||||
- **Browser Extension**: Store memories across ChatGPT, Perplexity, and Claude ([Chrome Extension](https://chromewebstore.google.com/detail/onihkkbipkfeijkadecaafbgagkhglop?utm_source=item-share-cb))
|
||||
- **Langgraph Support**: Build a customer bot with Langgraph + Mem0 ([Guide](https://docs.mem0.ai/integrations/langgraph))
|
||||
- **CrewAI Integration**: Tailor CrewAI outputs with Mem0 ([Example](https://docs.mem0.ai/integrations/crewai))
|
||||
- **ChatGPT with Memory**:由 Mem0 驱动的个性化聊天([Live Demo](https://mem0.dev/demo))
|
||||
- **Browser Extension**:在 ChatGPT、Perplexity 和 Claude 之间存储记忆([Chrome Extension](https://chromewebstore.google.com/detail/onihkkbipkfeijkadecaafbgagkhglop?utm_source=item-share-cb))
|
||||
- **Langgraph Support**:使用 Langgraph + Mem0 构建客服机器人([Guide](https://docs.mem0.ai/integrations/langgraph))
|
||||
- **CrewAI Integration**:使用 Mem0 定制 CrewAI 输出([Example](https://docs.mem0.ai/integrations/crewai))
|
||||
|
||||
## 📚 Documentation & Support
|
||||
|
||||
- Full docs: https://docs.mem0.ai
|
||||
- Community: [Discord](https://mem0.dev/DiG) · [X (formerly Twitter)](https://x.com/mem0ai)
|
||||
- Contact: founders@mem0.ai
|
||||
- 完整文档:https://docs.mem0.ai
|
||||
- 社区:[Discord](https://mem0.dev/DiG) · [X(原 Twitter)](https://x.com/mem0ai)
|
||||
- 联系:founders@mem0.ai
|
||||
|
||||
## Citation
|
||||
|
||||
We now have a paper you can cite:
|
||||
我们现在提供一篇可供引用的论文:
|
||||
|
||||
```bibtex
|
||||
@article{mem0,
|
||||
@@ -266,4 +272,4 @@ We now have a paper you can cite:
|
||||
|
||||
## ⚖️ License
|
||||
|
||||
Apache 2.0 — see the [LICENSE](https://github.com/mem0ai/mem0/blob/main/LICENSE) file for details.
|
||||
Apache 2.0 — 详情请参阅 [LICENSE](https://github.com/mem0ai/mem0/blob/main/LICENSE) 文件。
|
||||
|
||||
Reference in New Issue
Block a user