知识库问答 · 中文选型解读

claude-mem

已解读GitHubApache-2.0JavaScript

这是一款为各类AI编程助手、大模型Agent提供跨会话持久记忆能力的工具,自动压缩历史会话内容,新会话启动时自动注入相关上下文。

92.7kstar今天仍有更新维护状态Apache-2.0 · 可评估商用商用提醒
在 GitHub 查看官方项目
适合解决把企业文档和数据变成可追溯的 AI 问答能力
更适合有文档沉淀、客服或内部知识复用需求的团队
投入判断上手门槛:需评估。通常需要整理数据、配置模型与权限
一分钟看懂

这个项目值得继续研究吗?

AI 依据上游资料解读 · 2026/8/31

这是一款为各类AI编程助手、大模型Agent提供跨会话持久记忆能力的工具,自动压缩历史会话内容,新会话启动时自动注入相关上下文。

解决什么问题
业务人员、开发者使用AI编程助手或大模型处理项目时,每次新开会话都需要重复告知项目背景、此前的操作与决策逻辑,手动复制历史信息效率低,还容易遗漏关键上下文导致输出不符合预期。
适合什么团队
适合频繁使用Claude Code、Copilot等AI编程工具的开发、运维团队,以及需要AI Agent保持跨会话上下文一致性的企业技术团队。
使用前注意
安装时不可使用npm全局安装命令,需通过官方指定的npx命令或Claude Code内置插件命令安装,部署需要Node.js 20及以上版本,采用Apache-2.0许可可商用。

本页用于缩短初步筛选时间,不构成技术、采购或法律结论。 正式使用前请在真实业务数据上验证,并以官方说明与许可证为准。

项目导读

从官方资料看清能力、部署与采用边界

AI 翻译整理 · 保留官方来源

以下内容依据项目公开 README 或模型卡翻译整理,代码、命令和产品名保持原样。

Claude-Mem 项目导读

1. 项目定位

Claude-Mem是一款为AI编程助手、大模型Agent打造的跨会话持久记忆系统,最初为Claude Code设计,目前也兼容OpenClaw、Codex、Gemini、Hermes、Copilot、OpenCode等多款主流AI工具,可实现跨会话的上下文自动复用,无需用户手动同步历史信息。 Claude-Mem Preview

2. 核心能力

该工具的核心能力覆盖记忆采集、存储、召回全流程,面向业务使用者的核心价值包括:

  • 跨会话持久记忆:会话结束后历史上下文不会丢失,新会话启动时会自动注入相关的历史内容,无需用户重复介绍项目背景、历史操作逻辑
  • 成本透明:采用分层召回机制,可查看每次注入上下文的token消耗情况,方便控制AI使用成本
  • 历史内容搜索:支持用自然语言查询项目的历史操作、决策记录,快速找回之前的处理方案
  • 可视化管理:提供Web查看界面,可实时查看记忆采集流,也可通过ID回溯任意历史操作记录
  • 隐私可控:支持用``标签标记敏感内容,被标记的内容不会被存入记忆库
  • 自动化运行:安装完成后无需人工干预,自动完成记忆的采集、压缩、注入全流程
  • 多场景适配:支持Claude桌面端、OpenClaw网关、各类IDE插件等多种部署形态

3. 安装部署方式

该工具安装流程简单,针对不同使用场景提供对应的一键安装命令:

  1. 通用场景安装:直接运行npx claude-mem install即可完成安装
  2. OpenCode用户安装:运行npx claude-mem install --ide opencode
  3. Antigravity CLI用户安装:运行npx claude-mem install --ide antigravity
  4. Claude Code内置安装:在Claude Code中依次运行/plugin marketplace add thedotmack/claude-mem、/plugin install claude-mem即可
  5. OpenClaw网关安装:运行curl -fsSL https://install.cmem.ai/openclaw.sh | bash,安装程序会自动处理依赖、配置、服务启动,还支持配置将实时操作通知推送到Telegram、Discord、Slack等协作工具

安装完成后重启对应AI工具即可生效。

注意:不可使用npm install -g claude-mem命令安装,该命令只会安装SDK组件,不会注册插件钩子和启动后台服务,无法正常使用全部功能。部署环境要求Node.js版本不低于20.0.0。

4. 运行逻辑

Claude-Mem的运行全程自动化,无需用户手动操作:

  1. 工具通过生命周期钩子自动采集会话全流程的内容,包括会话启动、用户提交问题、工具调用结果、会话结束等各个节点的信息
  2. 采集到的内容会通过AI生成语义摘要,分别存储在本地SQLite数据库和Chroma向量数据库中
  3. 新会话启动时,系统会通过混合语义+关键词搜索,召回和当前会话相关的历史上下文,自动注入到当前会话的提示词中
  4. 使用者也可以通过内置的mem-search技能,主动用自然语言查询历史记忆内容

5. 许可证与采用建议

该项目采用Apache-2.0开源许可证,企业可自由使用、修改、二次分发,也可用于商业场景。目前项目处于活跃维护状态,有完善的官方文档,包含安装指南、使用说明、配置方法、常见问题排查等内容,同时提供中文在内的多语言文档支持,中文用户可直接查看官方中文说明文档。 如果你的团队经常使用AI编程助手处理中长期项目,需要AI工具记住项目的历史决策、操作逻辑,减少重复沟通成本,提升AI使用效率,可以考虑部署试用。

可核对的事实层

官方资料与来源

查看来源 →
  • ai
  • ai-agents
  • ai-memory
  • anthropic
  • artificial-intelligence
  • chromadb
  • claude
  • claude-agent-sdk
  • claude-agents
  • claude-code
  • claude-code-plugin
  • claude-skills
默认分支main
关注仓库293
复刻次数8.1k
开放议题266
近期更新2026/8/30
仓库状态未标记归档
上游部署线索
## Quick Start

Install with a single command:

```bash
npx claude-mem install
```

Or install for OpenCode:

```bash
npx claude-mem install --ide opencode
```

Or install for Antigravity CLI ([setup guide](https://docs.claude-mem.ai/antigravity-cli/setup)):

```bash
npx claude-mem install --ide antigravity
```

Or install from the plugin marketplace inside Claude Code:

```bash
/plugin marketplace add thedotmack/claude-mem

/plugin install claude-mem
```

Restart Claude Code. Context from previous sessions will automatically appear in new sessions.

> **Note:** Claude-Mem is also published on npm, but `npm install -g claude-mem` installs the **SDK/library only** — it does not register the plugin hooks or set up the worker service. Always install via `npx claude-mem install` or the `/plugin` commands above.

### 🦞 OpenClaw Gateway

Install claude-mem as a persistent memory plugin on [Op

该片段来自项目 README,仅用于初步判断;实际部署请以官方文档为准。

核对上游原始说明节选

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

🇨🇳 中文 • 🇹🇼 繁體中文 • 🇯🇵 日本語 • 🇵🇹 Português • 🇧🇷 Português • 🇰🇷 한국어 • 🇪🇸 Español • 🇩🇪 Deutsch • 🇫🇷 Français • 🇮🇱 עברית • 🇸🇦 العربية • 🇷🇺 Русский • 🇵🇱 Polski • 🇨🇿 Čeština • 🇳🇱 Nederlands • 🇹🇷 Türkçe • 🇺🇦 Українська • 🇻🇳 Tiếng Việt • 🇵🇭 Tagalog • 🇮🇩 Indonesia • 🇹🇭 ไทย • 🇮🇳 हिन्दी • 🇧🇩 বাংলা • 🇵🇰 اردو • 🇷🇴 Română • 🇸🇪 Svenska • 🇮🇹 Italiano • 🇬🇷 Ελληνικά • 🇭🇺 Magyar • 🇫🇮 Suomi • 🇩🇰 Dansk • 🇳🇴 Norsk

Persistent memory compression system built for Claude Code.

Quick Start • How It Works • Search Tools • Documentation • Configuration • Troubleshooting • License

Claude-Mem seamlessly preserves context across sessions by automatically capturing tool usage observations, generating semantic summaries, and making them available to future sessions. This enables Claude to maintain continuity of knowledge about projects even after sessions end or reconnect.

Documentation

📚 View Full Documentation - Browse on official website

Getting Started

  • Installation Guide - Quick start & advanced installation
  • Usage Guide - How Claude-Mem works automatically
  • Search Tools - Query your project history with natural language
  • Cloud Sync - Back up your memories to cmem.ai — no daemon, the worker syncs on write

Best Practices

  • Context Engineering - AI agent context optimization principles
  • Progressive Disclosure - Philosophy behind Claude-Mem's context priming strategy

Architecture

  • Overview - System components & data flow
  • Architecture Evolution - The journey from v3 to v5
  • Hooks Architecture - How Claude-Mem uses lifecycle hooks
  • Hooks Reference - 7 hook scripts explained
  • Worker Service - HTTP API & Bun management
  • Database - SQLite schema & FTS5 search
  • Search Architecture - Hybrid search with Chroma vector database

Configuration & Development

  • Configuration - Environment variables & settings
  • Development - Building, testing, contributing
  • Release Branches - Stable, core-dev, and community-edge branch flow
  • Troubleshooting - Common issues & solutions

---

How It Works

Core Components:

  1. 5 Lifecycle Hooks - SessionStart, UserPromptSubmit, PostToolUse, Stop, SessionEnd (6 hook scripts)
  2. Smart Install - Cached dependency checker (pre-hook script, not a lifecycle hook)
  3. Worker Service - Local HTTP API with web viewer UI and search endpoints, managed by Bun
  4. SQLite Database - Stores sessions, observations, summaries
  5. mem-search Skill - Natural language queries with progressive disclosure
  6. Chroma Vector Database - Hybrid semantic + keyword search for intelligent context retrieval

See Architecture Overview for details.

---

MCP Search Tools

Claude-Mem provides intelligent memory search through 4 MCP tools following a token-efficient 3-layer workflow pattern:

Th