[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"pack-detail-agent-memory-comparison-zh":3,"seo:pack:agent-memory-comparison:zh":101},{"code":4,"message":5,"data":6},200,"操作成功",{"pack":7},{"slug":8,"icon":9,"tone":10,"status":11,"status_label":12,"title":13,"description":14,"items":15,"install_cmd":100},"agent-memory-comparison","🧬","#F59E0B","new","本周新建","Agent 记忆层硬选型：Mem0 \u002F Letta \u002F Graphiti \u002F Zep 对比","十个 Agent 记忆层硬对比：Mem0 \u002F Letta（MemGPT）\u002F Graphiti \u002F Zep \u002F Cognee \u002F Memvid \u002F Memori \u002F Engram \u002F Statewave + Awesome 索引。从轻量 → 图 → 托管，附决策矩阵。直接选型不绕路。",[16,28,36,46,54,61,69,77,86,93],{"id":17,"uuid":18,"slug":19,"title":20,"description":21,"author_name":22,"view_count":23,"vote_count":24,"lang_type":25,"type":26,"type_label":27},703,"96da1f40-1823-4d87-a84f-7d8269edeb24","mem0-memory-layer-ai-applications-96da1f40","Mem0 — Memory Layer for AI Applications","Add persistent, personalized memory to AI agents and assistants. Mem0 stores user preferences, past interactions, and learned context across sessions.","Mem0",712,0,"en","skill","Skill",{"id":29,"uuid":30,"slug":31,"title":32,"description":33,"author_name":34,"view_count":35,"vote_count":24,"lang_type":25,"type":26,"type_label":27},302,"4ddbd0e0-80df-41ee-9593-982beeb075b3","letta-stateful-ai-agents-memory-4ddbd0e0","Letta — Stateful AI Agents with Memory","Letta builds stateful AI agents that learn and self-improve with advanced memory. 21.8K+ stars. CLI, Python\u002FTS SDKs, skills, subagents. Apache 2.0.","Skill Factory",161,{"id":37,"uuid":38,"slug":39,"title":40,"description":41,"author_name":42,"view_count":43,"vote_count":24,"lang_type":25,"type":44,"type_label":45},211,"34ea44af-b30f-4129-b6fd-a2cb4366ab4b","graphiti-real-time-knowledge-graphs-ai-agents-34ea44af","Graphiti — Real-Time Knowledge Graphs for AI Agents","Build real-time knowledge graphs for AI agents by Zep. Temporal awareness, entity extraction, community detection, and hybrid search. Production-ready. 24K+ stars.","TokRepo精选",227,"script","Script",{"id":47,"uuid":48,"slug":49,"title":50,"description":51,"author_name":52,"view_count":53,"vote_count":24,"lang_type":25,"type":26,"type_label":27},743,"ffde39a9-bd16-4c41-8168-aacfb05b7622","zep-long-term-memory-ai-agents-assistants-ffde39a9","Zep — Long-Term Memory for AI Agents and Assistants","Production memory layer for AI assistants. Zep stores conversation history, extracts facts, builds knowledge graphs, and provides temporal-aware retrieval for LLMs.","MCP Hub",195,{"id":55,"uuid":56,"slug":57,"title":58,"description":59,"author_name":34,"view_count":60,"vote_count":24,"lang_type":25,"type":26,"type_label":27},334,"b6ad223f-51da-4179-863c-5f9b3c7d08ef","cognee-memory-engine-ai-agents-b6ad223f","Cognee — Memory Engine for AI Agents","Cognee adds persistent structured memory to any AI agent in 6 lines of code. 14.8K+ stars. Knowledge graphs, vector stores, LLM integration. Apache 2.0.",146,{"id":62,"uuid":63,"slug":64,"title":65,"description":66,"author_name":67,"view_count":68,"vote_count":24,"lang_type":25,"type":26,"type_label":27},2631,"c6f6a833-47b4-11f1-9bc6-00163e2b0d79","memvid-serverless-memory-layer-ai-agents-c6f6a833","Memvid — Serverless Memory Layer for AI Agents","An open-source memory system that replaces complex RAG pipelines with a single-file, serverless memory layer providing instant retrieval and long-term storage for AI agents.","Script Depot",138,{"id":70,"uuid":71,"slug":72,"title":73,"description":74,"author_name":75,"view_count":76,"vote_count":24,"lang_type":25,"type":26,"type_label":27},3541,"7fcb5dcd-8666-5767-a3af-208f83343287","memori-agent-native-memory-infrastructure","Memori — Agent-Native Memory Infrastructure","Memori is an Apache-2.0 memory layer that captures what agents do (not just say) and plugs into existing stacks via Python\u002FNode SDKs and a cloud option.","AI Open Source",76,{"id":78,"uuid":79,"slug":80,"title":81,"description":82,"author_name":52,"view_count":83,"vote_count":24,"lang_type":25,"type":84,"type_label":85},600,"f5bac4b3-caff-48a5-8b6a-48de91fec697","engram-persistent-memory-system-ai-agents-f5bac4b3","Engram — Persistent Memory System for AI Agents","Agent-agnostic persistent memory system with SQLite full-text search. Ships as MCP server, HTTP API, CLI, and TUI. Gives any AI coding agent long-term memory across sessions. 2,300+ stars.",174,"mcp","MCP",{"id":87,"uuid":88,"slug":89,"title":90,"description":91,"author_name":75,"view_count":92,"vote_count":24,"lang_type":25,"type":26,"type_label":27},3367,"e900097c-4946-5899-829b-0b9db4c2adf7","statewave-memory-runtime-for-ai-agents-api-sdks","Statewave — Memory Runtime for AI Agents (API + SDKs)","Statewave is a self-hostable memory runtime: ingest episodes, compile memories, do semantic search, and build token-bounded context bundles via REST.",55,{"id":94,"uuid":95,"slug":96,"title":97,"description":98,"author_name":75,"view_count":99,"vote_count":24,"lang_type":25,"type":26,"type_label":27},3318,"be6dfe8e-975e-5ade-9900-72221c32ab40","awesome-agent-memory-long-term-context-index","Awesome Agent Memory — Long-Term Context Index","Awesome Agent Memory curates systems, benchmarks, and papers on long-term context for LLMs\u002FMLLMs—use it to compare approaches and pick tools to try.",86,"tokrepo install pack\u002Fagent-memory-comparison",{"pageType":102,"pageKey":8,"locale":103,"title":104,"metaDescription":105,"h1":106,"tldr":107,"bodyMarkdown":108,"faq":109,"schema":125,"internalLinks":135,"citations":148,"wordCount":161,"generatedAt":162},"pack","zh","Agent 记忆层硬选型：Mem0 \u002F Letta \u002F Graphiti \u002F Zep 全对比（2026）","十个 Agent 记忆层并排对比：Mem0 \u002F Letta（MemGPT）\u002F Graphiti \u002F Zep \u002F Cognee \u002F Memvid \u002F Memori \u002F Engram \u002F Statewave + Awesome 索引。安装顺序、决策矩阵、一句话帮你选定。","Agent 记忆层：一份诚实的对比","没有最好的记忆层，只有最合适你问题形状的那一个。这个 pack 把十个选项按从轻量库到托管服务到图引擎排好序，附决策矩阵 —— 只问一个问题：会话需要保留多少状态？看完选定就开干。","## 这个 pack 为什么存在\n\n之前的 `agent-memory-layer` pack 覆盖了三个头部库 —— Mem0 \u002F Zep \u002F Cognee —— 加四个设计模式。有用，但每周都有人在 X 上问「我这个场景该用哪个记忆层」，得到十个互相矛盾的答案。这个 pack 是诚实的取舍指南：十个选项、强意见安装顺序、底部决策矩阵。看一遍、选、上线。\n\n2025 年下半年起这个领域已经碎片化。现在有库形态（Mem0 \u002F Memori）、服务形态（Zep \u002F Statewave）、图形态（Graphiti \u002F Cognee）、有状态运行时（Letta \u002F Engram）、还有怪胎（Memvid 把记忆编码成 MP4 帧）。它们彼此不可替换。选错的代价是埋掉一年工作量。\n\n## 安装顺序 —— 由轻到重\n\n| # | 资产 | 形态 | 它什么时候赢 |\n|---|---|---|---|\n| 1 | **Mem0** | Python \u002F Node 库 | 单用户 chatbot、周末原型、想一个 import 搞定 |\n| 2 | **Letta**（前身 MemGPT） | 有状态运行时 | 长程自主 agent，需要 working \u002F archival 分层 |\n| 3 | **Graphiti** | 时序图 | 关系重要 + 时间重要（合规、审计） |\n| 4 | **Zep** | 托管服务 | 多租户 SaaS、需要运维支持、审计链 |\n| 5 | **Cognee** | 图 + 向量混合库 | 调研 \u002F 代码库 \u002F 强实体结构的领域 |\n| 6 | **Memvid** | 无服务器 \u002F 文件型 | 边缘 agent、无基础设施、记忆塞进单个 artifact |\n| 7 | **Memori** | Agent-native 基础设施 | 全新 agent 平台、要 primitive 不要 product |\n| 8 | **Engram** | 持久记忆系统 | 自托管、运维轻、单租户 |\n| 9 | **Statewave** | 记忆运行时 + SDK | 多语言（Python + TS + Go）共享同一份记忆 |\n| 10 | **Awesome Agent Memory** | 索引 \u002F 分类 | 想自己评估长尾选项 |\n\n顺序有讲究：先 Mem0，因为出第一条记忆只要五分钟。如果你的 agent 进入自主模式（多步、多小时），升级到 Letta —— 它给你 MemGPT 论文那套显式两层记忆划分。如果你的领域本质是关系型（谁认识谁、什么时候发生了什么），跳过向量库直接上 Graphiti。Zep 是前两者的生产落地。Cognee 是研究密集型工作的赌注。第 5 行往下都是利基选项 —— 采用前要看仔细。\n\n## 决策矩阵\n\n问自己**一个问题**：这个用户下个月再来的时候，agent 需要记住什么？\n\n- **「他的偏好和最近几次会话」** → Mem0。不用再读了。\n- **「一个多小时的自主任务进度」** → Letta。Working + archival 分层就是为这个生的。\n- **「谁在什么时候对谁说了什么」** → Graphiti 或 Zep（Zep 底下跑的就是 Graphiti）。时序图不是可选项。\n- **「六个月的决策记录跟实体绑定」** → Cognee 或 Zep。纯向量会丢掉 join。\n- **「随便，规模上来再说」** → 今天用 Mem0，规划在 1k 用户时迁 Zep。\n- **「我跑不起 server」** → Memvid 或 Mem0 + SQLite 后端。预算够也可以直接上 Zep Cloud。\n- **「我的 agent 跑在三种语言里」** → Statewave。SDK 多语言 parity 是护城河。\n\n矩阵不全，但覆盖约 80% 真上线的 agent。如果你的情况不在这里，大概率属于第 10 项 Awesome Agent Memory 里再做评估，而不是凭一时冲动选定。\n\n## 每一个会在哪里裂\n\n- **Mem0** 裂在多租户审计。可以加用户命名空间，但没一等公民的审计日志。第一次 SOC2 问询前没事。\n- **Letta** 裂在成本。两层记忆意味着每一步都要做召回往返；高频 agent 的 token 账单是无状态 prompt 的两倍。自主任务值，闲聊不值。\n- **Graphiti** 裂在 schema 漂移。如果你的实体类型在 PMF 阶段每周都变，那你重写 graph schema 的时间会超过出新功能的时间。\n- **Zep** 裂在自托管复杂度。Postgres + 图层 + worker；不是 docker run。没平台团队就用 cloud。\n- **Cognee** 裂在它太有立场。它默认你想要知识图谱；如果你的领域松散（通用聊天），你是在用图的成本买向量的价值。\n- **Memvid** 裂在体积。MP4 帧编码很妙但索引过几个 GB 就难用。仅边缘规模。\n- **Memori \u002F Engram \u002F Statewave** 都裂在社区规模。生态小意味着集成少、Stack Overflow 答案少、bug 多。\n\n## TokRepo 一键安装\n\n```bash\n# 整个 pack\ntokrepo install pack\u002Fagent-memory-comparison\n\n# 或者头部三件套\ntokrepo install mem0 letta graphiti\n```\n\nCLI 把 Claude Code subagent 配置放进 `.claude\u002Fagents\u002F`、Cursor 规则放进 `.cursor\u002Frules\u002F`、Codex CLI 进 AGENTS.md。pip \u002F npm 安装本身不变 —— TokRepo 只是把 AI 工具配置接好，让你的 agent 知道记忆层存在。\n\n## 我们故意没放的东西\n\n我们没把对话历史 hack（LangChain ConversationBufferMemory 那一类）放进来。那些不是记忆层 —— 是 prompt 塞料包装。能用到撑爆，失败方式是 context window 静默溢出。如果你正想伸手抓那种工具，装 Mem0 就好。五分钟、同样的形状、规模上来不会炸。\n\n也跳过了纯向量库方案（单独的 Pinecone \u002F Weaviate）。那些是 RAG 基础设施，不是记忆。RAG 从静态语料检索；记忆写新事实并累积。别混。",[110,113,116,119,122],{"q":111,"a":112},"我已经在用 agent-memory-layer pack —— 这个是替代品吗？","不，是姊妹版。原 pack 教你什么是记忆层、装三个头部库 + 四个模式。这个 pack 假设你已经懂了，帮你按问题形状在十个里选。新人先看 agent-memory-layer，已经在用 Mem0 想不想换 Letta \u002F Zep 的看这个。",{"q":114,"a":115},"Letta vs MemGPT —— 是一个东西吗？","Letta 是 MemGPT 的产品化继任者（MemGPT 论文提出了两层记忆架构；Letta 是把它实现成可部署运行时的开源框架）。老博客里看到 MemGPT 心里换成 Letta。架构一样：working memory 在上下文里、archival memory 在向量库里，带显式的搬移操作。",{"q":117,"a":118},"Zep 不就是带 UI 的 Graphiti 吗？","时序图那半基本是 —— Zep 底层用 Graphiti 做记忆层，再加托管服务、用户管理、多租户隔离、admin UI。要自托管 + 运维友好就直接跑 Graphiti。要刷卡上线就 Zep Cloud。底下图语义一致。",{"q":120,"a":121},"为什么放 Memvid？把记忆编码成 MP4 听着很癫。","确实癫，但是好癫。Memvid 把记忆编成 MP4 帧，整个记忆库就一个可移植文件。边缘 agent（CLI 工具 \u002F IoT \u002F 端上助手）跑不起 server、又不想要 SQLite 依赖的话，这是合法选项。约束是体积 —— 过几个 GB 索引就难用。我们收它是因为约束形状独特，目前没第二个工具解同样的问题。",{"q":123,"a":124},"选完发现长大了怎么办？","Mem0 → Letta 是一个周末的重构（抽出用户事实模块，指向 Letta 的 archival memory）。Mem0 → Zep 也类似，大半是改配置。Letta → Zep 难一点，因为丢了 Letta 的运行时语义。最危险的迁移是图（Graphiti \u002F Cognee）跟非图之间互转 —— 关系建模迁不过去。形状第一次选对，其他都能迁。",{"@context":126,"@type":127,"name":128,"description":129,"numberOfItems":130,"inLanguage":103,"publisher":131},"https:\u002F\u002Fschema.org","CollectionPage","Agent Memory Layer Comparison","Ten agent memory layers benchmarked side-by-side with a decision matrix for picking the right one.",10,{"@type":132,"name":133,"url":134},"Organization","TokRepo","https:\u002F\u002Ftokrepo.com",[136,140,144],{"url":137,"anchor":138,"reason":139},"\u002Fzh\u002Fpacks\u002Fagent-memory-layer","Agent 记忆层（入门 pack）","新手必读的前置 pack",{"url":141,"anchor":142,"reason":143},"\u002Fzh\u002Fpacks\u002Fmulti-agent-frameworks","多 Agent 框架","多 agent 共享状态时选型会变",{"url":145,"anchor":146,"reason":147},"\u002Fzh\u002Fpacks\u002Fml-engineer-rag-eval","RAG + 评测栈","记忆和 RAG 互补；这个 pack 跟检索评测配套食用",[149,153,157],{"claim":150,"source_name":151,"source_url":152},"Letta（前身 MemGPT）是实现 MemGPT 论文中两层 working \u002F archival 记忆架构的有状态 agent 框架","letta-ai\u002Fletta on GitHub","https:\u002F\u002Fgithub.com\u002Fletta-ai\u002Fletta",{"claim":154,"source_name":155,"source_url":156},"Graphiti 是 Zep 团队为 AI agent 记忆构建的时序知识图谱框架","getzep\u002Fgraphiti on GitHub","https:\u002F\u002Fgithub.com\u002Fgetzep\u002Fgraphiti",{"claim":158,"source_name":159,"source_url":160},"Mem0 提供开源记忆层，自动抽取并更新 LLM 应用中的用户特定事实","mem0ai\u002Fmem0 on GitHub","https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0",900,"2026-05-22T10:00:00Z"]