memcell

中文文档
2.2.1发布于 2026/11/04Apache-2.0ES Module构建来源已验证

Shared, persistent memory for any AI agent. Agents recall what your workspace established — instructions, decisions, facts, preferences, active working threads, and grounded PDF/DOCX/CSV/web documents — before they act, then report outcomes so confidence

原始使用文档
文档目录12 节
  1. Why MemCell?
  2. How It Works
  3. Everyday Usage
  4. 1. Recall Verified Context Before Implementing
  5. 2. Record a Decision or Instruction
  6. 3. Report What Happened
  7. 4. Ingest Specs and Existing Guidelines
  8. 5. Check Attributed Token Savings
  9. Supported Agents & IDEs
  10. Command Cheat Sheet
  11. Clean Uninstall
  12. Links

MemCell Logo

memcell

Persistent, adaptive memory engine for AI agents.
Stop your agents from repeating the same mistakes across sessions.

npm version License: Apache-2.0 Node.js >= 20 Documentation

# Install globally
npm install -g memcell

# In any project:
memcell connect

Run it in any project. memcell connect automatically:

  • Approves in 1 tap: Opens browser approval (no upfront account needed; guest memories carry over seamlessly on sign-in).
  • Auto-detects agents: Wires Claude Code, Cursor, Copilot CLI, Gemini CLI, OpenAI Codex, OpenCode, Cline, Windsurf, and more with non-destructive lifecycle hooks and the local stdio MCP server (memcell mcp).
  • Secures credentials: Stores scoped agent keys directly in your OS keyring (Keychain / Secret Service / Credential Manager).
  • Creates .memcell: Adds a clean, git-safe project descriptor to your repo root.

Verify anytime:

memcell status

Why MemCell?

Every time you start a new session with an AI agent, it starts with complete amnesia. It falls into the same traps, repeats outdated assumptions, and recreates issues you already resolved yesterday.

Static instruction files and monolithic system prompts don't solve this:

  • Context Bloat: Stacking dozens of instructions wastes tokens on every turn and dilutes model attention.
  • Zero Adaptability: Outdated instructions keep firing even when requirements change.
  • Manual Overhead: You remain the sole feedback loop, constantly hand-editing markdown files.

MemCell gives your agents closed-loop memory:

  1. Pre-Action Recall — Before taking action, agents receive verified memories relevant to the current task.
  2. Execution & Feedback — When actions succeed or fail, real outcomes are reported back.
  3. Earned Confidence — Memories that work gain confidence; memories that fail decay. Zero manual prompt maintenance.

How It Works

MemCell pairs two lightweight layers so agents stay aligned without getting in your way:

  • Deterministic Hooks (Zero-Touch): Fire automatically on session start, prompt submit, and turn end. Relevant memories, active session threads, and instructions are checked before actions begin—without relying on the model remembering to call a tool. Hooks fail open in <50ms, so offline or slow networks never block your editor.
  • MCP Tool Bridge (memcell mcp): Provides interactive tools (recall, remember, report) when agents need to search memory or record discoveries mid-turn.

Everyday Usage

Once connected, agents recall and report memory automatically. You can also interact with memory directly from your terminal:

1. Recall Verified Context Before Implementing

memcell recall "how do we handle multi-tenant database sessions?"

2. Record a Decision or Instruction

# Record a workspace instruction
memcell remember "Always use pnpm for package operations; never invoke npm directly" --type instruction

# Record an architectural decision
memcell remember "Use Next.js for both backend and frontend with shadcn for UI" --type decision

# Bind an instruction to a specific lifecycle trigger
memcell remember "Check database migrations for column locks before altering tables" --type instruction --at change

3. Report What Happened

Memories sharpen when told what happened. When an approach succeeds or fails, report the outcome:

memcell report mem_019a4b2c worked --note "CI suite passed cleanly"
memcell report mem_019a4b2c failed --note "broke Next.js 15 async cookies"

4. Ingest Specs and Existing Guidelines

# Index workspace docs and project manifests for grounded RAG and graph extraction
memcell ingest

# Scan and import existing guideline files (CLAUDE.md, etc.)
memcell import

5. Check Attributed Token Savings

memcell stats

Displays memories followed, errors avoided, estimated tokens saved from prevented error loops, and 30-day activity sparklines.


Supported Agents & IDEs

Agent / HarnessIntegrationHow It Runs
Claude CodeHooks + MCP + PluginAutomatic lifecycle hooks or marketplace plugin (/plugin marketplace add memcell-ai/mcp)
CursorHooks + MCP BridgeNative lifecycle hooks in .cursor/hooks.json and stdio bridge in .cursor/mcp.json
Gemini CLIHooks + MCPSession and prompt hooks via native CLI harness
GitHub Copilot CLILifecycle HooksPre-command validation hooks
OpenAI Codex / OpenCodeHooks + MCPWorkspace descriptor hooks and stdio tools
Cline & WindsurfMCP BridgeNative editor MCP client configuration
Factory Droid, Devin, Kiro, GooseHooks + MCPWorkspace adapters and tool harnesses

Command Cheat Sheet

CommandDescription
memcell start [--daemon]Run local MemCell server with embedded PGlite vector engine
memcell stopHalt background local server daemon
memcell connectConnect this directory to MemCell, install hooks, and configure MCP
memcell statusCheck authentication standing, active workspace, and connection health
memcell statsShow memories followed, errors avoided, and token savings
memcell recall <intent>Query memory for verified memories, threads, and documents
memcell remember <text>File an instruction, decision, fact, or preference
memcell report <id> <outcome>Report worked, failed, or avoided to update confidence
memcell threadList, inspect, resume, or complete working session threads
memcell ingest [paths...]Index workspace docs and manifests into grounded RAG and memory graph
memcell documentList, search, or delete indexed workspace documents
memcell import [files...]Import existing guideline files (CLAUDE.md, etc.)
memcell exportExport workspace memories as a portable document (--format json|md)
memcell orgsList or switch active organization (memcell orgs switch <slug>)
memcell workspacesList or switch active workspace (memcell workspaces use <slug>)
memcell hook removeCleanly remove all MemCell hooks from this directory
memcell resetClear all cached credentials, keys, and tokens on this machine

Run memcell --help or memcell <command> --help for full flag details.


Clean Uninstall

To remove MemCell hooks from a repository without touching your code:

memcell hook remove
rm .memcell

To remove all stored keys and credentials from your local machine:

memcell reset

Apache License 2.0 · © 2026 Memcell, Inc.

版本与发布记录

memcell 共发布 52 个版本,首次发布于 2026/07/31;过去 12 个月发布了 52 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.2.1latest2026/11/04今天
2.2.02026/11/04今天
2.1.12026/11/013 天前
2.1.02026/11/013 天前
2.0.32026/11/013 天前
2.0.22026/11/013 天前

关于 memcell 的常见问题

memcell 是什么?

Shared, persistent memory for any AI agent. Agents recall what your workspace established — instructions, decisions, facts, preferences, active working threads, and grounded PDF/DOCX/CSV/web documents — before they act, then report outcomes so confidence

如何安装 memcell?

在项目目录运行 npm install memcell,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mem、memcell,可以用 npx mem 直接运行。

memcell 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/memcell 是否存在。

memcell 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

memcell 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

memcell 可以商用吗?

memcell 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

memcell 还在维护吗?

最新版本 2.2.1 发布于 2026/11/04(今天);至今共发布 52 个版本,其中过去 12 个月发布了 52 个;首次发布于 2026/07/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。