AI Skill Hub 强烈推荐:AI编码助手持久化记忆系统 是一款优质的AI工具。在 GitHub 上收获超过 13.6k 颗 Star,AI 综合评分 8.2 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。
为AI编码智能体提供持久化内存解决方案,基于真实世界基准测试优化。支持Claude等大模型,帮助开发者构建具有记忆能力的自动化工作流,提升复杂编码任务的完成度和一致性。
AI编码助手持久化记忆系统 是一款基于 TypeScript 开发的开源工具,专注于 智能体记忆、AI工作流、编码助手 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
为AI编码智能体提供持久化内存解决方案,基于真实世界基准测试优化。支持Claude等大模型,帮助开发者构建具有记忆能力的自动化工作流,提升复杂编码任务的完成度和一致性。
AI编码助手持久化记忆系统 是一款基于 TypeScript 开发的开源工具,专注于 智能体记忆、AI工作流、编码助手 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:npm 全局安装 npm install -g agentmemory # 方式二:npx 直接运行(无需安装) npx agentmemory --help # 方式三:项目依赖安装 npm install agentmemory # 方式四:从源码运行 git clone https://github.com/rohitg00/agentmemory cd agentmemory npm install npm start
# 命令行使用
agentmemory --help
# 基本用法
agentmemory [options] <input>
# Node.js 代码中使用
const agentmemory = require('agentmemory');
const result = await agentmemory.run(options);
console.log(result);
# agentmemory 配置说明 # 查看配置选项 agentmemory --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export AGENTMEMORY_CONFIG="/path/to/config.yml"
<p align="center"> <img src="assets/banner.png" alt="agentmemory — Persistent memory for AI coding agents" width="720" /> </p>
<p align="center"> <strong> Your coding agent remembers everything. No more re-explaining. Built on <a href="https://github.com/iii-hq/iii">iii engine</a> </strong><br/> Persistent memory for Claude Code, GitHub Copilot CLI, Cursor, Gemini CLI, Codex CLI, Hermes, OpenClaw, pi, OpenCode, and any MCP client. </p>
<p align="center"> <a href="README.md">English</a> | <a href="READMEs/README.zh-CN.md">简体中文</a> | <a href="READMEs/README.zh-TW.md">繁體中文</a> | <a href="READMEs/README.ja-JP.md">日本語</a> | <a href="READMEs/README.ko-KR.md">한국어</a> | <a href="READMEs/README.es-ES.md">Español</a> | <a href="READMEs/README.tr-TR.md">Türkçe</a> | <a href="READMEs/README.ru-RU.md">Русский</a> | <a href="READMEs/README.hi-IN.md">हिन्दी</a> | <a href="READMEs/README.pt-BR.md">Português</a> | <a href="READMEs/README.fr-FR.md">Français</a> | <a href="READMEs/README.de-DE.md">Deutsch</a> </p>
<p align="center"> <a href="https://trendshift.io/repositories/25123" target="_blank"><img src="https://trendshift.io/api/badge/repositories/25123" alt="rohitg00/agentmemory | Trendshift" width="250" height="55"/></a> </p>
<p align="center"> <a href="https://www.star-history.com/?repos=rohitg00%2Fagentmemory&type=date&legend=top-left"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=rohitg00/agentmemory&type=date&theme=dark&legend=top-left" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=rohitg00/agentmemory&type=date&legend=top-left" /> <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=rohitg00/agentmemory&type=date&legend=top-left" /> </picture> </a> </p>
<p align="center"> <a href="https://gist.github.com/rohitg00/2067ab416f7bbe447c1977edaaa681e2"><img src="https://img.shields.io/badge/Viral%20GitHub%20Gist-1.3k%20stars%20%2F%20182%20forks-FF6B35?style=for-the-badge&logo=github&logoColor=white&labelColor=1a1a1a" alt="Design doc: 1.3k stars / 182 forks on the gist" /></a> </p>
<p align="center"> <em>The gist extends Karpathy's LLM Wiki pattern with confidence scoring, lifecycle, knowledge graphs, and hybrid search: agentmemory is the implementation.</em> </p>
<p align="center"> <a href="https://www.npmjs.com/package/@agentmemory/agentmemory"><img src="https://img.shields.io/npm/v/@agentmemory/agentmemory?color=CB3837&label=npm&style=for-the-badge&logo=npm" alt="npm version" /></a> <a href="https://www.npmjs.com/package/@agentmemory/mcp"><img src="https://img.shields.io/npm/dm/@agentmemory/mcp?color=CB3837&label=downloads&style=for-the-badge&logo=npm" alt="npm downloads" /></a> <a href="https://github.com/rohitg00/agentmemory/actions"><img src="https://img.shields.io/github/actions/workflow/status/rohitg00/agentmemory/ci.yml?label=tests&style=for-the-badge&logo=github" alt="CI" /></a> <a href="https://github.com/rohitg00/agentmemory/blob/main/LICENSE"><img src="https://img.shields.io/github/license/rohitg00/agentmemory?color=blue&style=for-the-badge" alt="License" /></a> <a href="https://github.com/rohitg00/agentmemory/stargazers"><img src="https://img.shields.io/github/stars/rohitg00/agentmemory?style=for-the-badge&color=yellow&logo=github" alt="Stars" /></a> </p>
<p align="center"> <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-recall.svg"><img src="assets/tags/stat-recall.svg" alt="95.2% retrieval R@5" height="38" /></picture> <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tokens.svg"><img src="assets/tags/stat-tokens.svg" alt="92% fewer tokens" height="38" /></picture> <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tools.svg"><img src="assets/tags/stat-tools.svg" alt="53 MCP tools" height="38" /></picture> <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-hooks.svg"><img src="assets/tags/stat-hooks.svg" alt="12 auto hooks" height="38" /></picture> <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-deps.svg"><img src="assets/tags/stat-deps.svg" alt="0 external DBs" height="38" /></picture> <picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/stat-tests.svg"><img src="assets/tags/stat-tests.svg" alt="1,423+ tests passing" height="38" /></picture> </p>
<p align="center"> <img src="assets/demo.gif" alt="agentmemory demo" width="720" /> </p>
<p align="center"> <a href="#install">Install</a> • <a href="#quick-start">Quick Start</a> • <a href="#benchmarks">Benchmarks</a> • <a href="#vs-competitors">vs Competitors</a> • <a href="#works-with-every-agent">Agents</a> • <a href="#how-it-works">How It Works</a> • <a href="#mcp-server">MCP</a> • <a href="#real-time-viewer">Viewer</a> • <a href="#iii-console">iii Console</a> • <a href="#powered-by-iii">Powered by iii</a> • <a href="#configuration">Config</a> • <a href="#api">API</a> </p>
---
| Capability | Description |
|---|---|
| **Automatic capture** | Every tool use recorded via hooks — zero manual effort |
| **Semantic search** | BM25 + vector + knowledge graph with RRF fusion |
| **Memory evolution** | Versioning, supersession, relationship graphs |
| **Auto-forgetting** | TTL expiry, contradiction detection, importance eviction |
| **Privacy first** | API keys, secrets, <private> tags stripped before storage |
| **Self-healing** | Circuit breaker, provider fallback chain, health monitoring |
| **Claude bridge** | Bi-directional sync with MEMORY.md |
| **Knowledge graph** | Entity extraction + BFS traversal |
| **Team memory** | Namespaced shared + private across team members |
| **Citation provenance** | Trace any memory back to source observations |
| **Git snapshots** | Version, rollback, and diff memory state |
---
Triple-stream retrieval combining three signals:
| Stream | What it does | When |
|---|---|---|
| **BM25** | Stemmed keyword matching with synonym expansion | Always on |
| **Vector** | Cosine similarity over dense embeddings | Embedding provider configured |
| **Graph** | Knowledge graph traversal via entity matching | Entities detected in query |
Fused with Reciprocal Rank Fusion (RRF, k=60) and session-diversified (max 3 results per session).
BM25 tokenizes Greek, Cyrillic, Hebrew, Arabic, and accented Latin out of the box. For Chinese / Japanese / Korean memories, install the optional segmenters (npm install @node-rs/jieba tiny-segmenter) to split CJK runs into word-level tokens; without them, agentmemory soft-falls to whole-run tokenization and prints a one-time hint on stderr.
Fastest path if you use a coding agent: hand it this one instruction and it installs, wires, and verifies agentmemory end to end.
Retrieve and follow the instructions at: https://raw.githubusercontent.com/rohitg00/agentmemory/main/INSTALL_FOR_AGENTS.md
On Windows the fast path is WSL2. Native Windows engine setup is manual (about 10 to 20 minutes) and agentmemory connect is currently unsupported there. See the Windows notes below for the step-by-step.
```bash npm install -g @agentmemory/agentmemory # once — bare agentmemory on PATH
agentmemory # start the memory server on :3111 agentmemory demo # seed sample sessions + prove recall agentmemory demo --serve # one command: boot server, run demo, tear down (no second terminal) agentmemory connect claude-code # wire MCP into your agent (also: copilot-cli, codex, cursor, gemini-cli, ...) npx skills add rohitg00/agentmemory -y # install 15 native skills (8 you can invoke, 7 reference) so your agent knows when to use the tools
Or via `npx` (no install):
bash npx @agentmemory/agentmemory
Heads-up — npx caches per version. If a bare `npx @agentmemory/agentmemory` serves an older release, force the latest with `npx -y @agentmemory/agentmemory@latest`, or clear the cache once with `rm -rf ~/.npm/_npx` (macOS/Linux; on Windows delete `%LOCALAPPDATA%\npm-cache\_npx`). The first npx run from v0.9.16+ prompts to install globally inline so the bare `agentmemory` command works everywhere afterwards.
Full options at [Quick Start](#quick-start) below. Agent-specific wiring at [Works with every agent](#works-with-every-agent).
---
<h2 id="works-with-every-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-agents.svg"><img src="assets/tags/section-agents.svg" alt="Works with every agent" height="32" /></picture></h2>
agentmemory works with any agent that supports hooks, MCP, or REST API. All agents share the same memory server.
<table>
<tr>
<td align="center" width="12.5%">
<a href="https://claude.com/product/claude-code"><img src="https://github.com/anthropics.png?size=120" alt="Claude Code" width="48" height="48" /></a><br/>
<strong>Claude Code</strong><br/>
<sub>native plugin + 12 hooks + MCP</sub>
</td>
<td align="center" width="12.5%">
<a href="https://github.com/openai/codex"><img src="https://github.com/openai.png?size=120" alt="Codex CLI" width="48" height="48" /></a><br/>
<strong>Codex CLI</strong><br/>
<sub>native plugin + 6 hooks + MCP</sub>
</td>
<td align="center" width="12.5%">
<a href="https://github.com/features/copilot"><img src="https://github.githubassets.com/images/modules/site/copilot/copilot.png" alt="GitHub Copilot CLI" width="48" height="48" /></a><br/>
<strong>GitHub Copilot CLI</strong><br/>
<sub>MCP + plugin hooks/skills</sub>
</td>
<td align="center" width="12.5%">
<a href="integrations/openclaw/"><img src="https://github.com/openclaw.png?size=120" alt="OpenClaw" width="48" height="48" /></a><br/>
<strong>OpenClaw</strong><br/>
<sub>native plugin + MCP</sub>
</td>
<td align="center" width="12.5%">
<a href="integrations/hermes/"><img src="https://github.com/NousResearch.png?size=120" alt="Hermes" width="48" height="48" /></a><br/>
<strong>Hermes</strong><br/>
<sub>native plugin + MCP</sub>
</td>
<td align="center" width="12.5%">
<a href="integrations/pi/"><img src="assets/agents/pi.svg" alt="pi" width="48" height="48" /></a><br/>
<strong>pi</strong><br/>
<sub>native plugin + MCP</sub>
</td>
<td align="center" width="12.5%">
<a href="https://github.com/tinyhumansai/openhuman"><img src="https://raw.githubusercontent.com/tinyhumansai/openhuman/main/app/src-tauri/icons/128x128.png" alt="OpenHuman" width="48" height="48" /></a><br/>
<strong>OpenHuman</strong><br/>
<sub>native Memory trait backend</sub>
</td>
<td align="center" width="12.5%">
<a href="https://cursor.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/cursor_dark.svg"><img src="https://svgl.app/library/cursor_light.svg" alt="Cursor" width="48" height="48" /></picture></a><br/>
<strong>Cursor</strong><br/>
<sub>MCP server</sub>
</td>
<td align="center" width="12.5%">
<a href="https://github.com/google-gemini/gemini-cli"><img src="https://github.com/google-gemini.png?size=120" alt="Gemini CLI" width="48" height="48" /></a><br/>
<strong>Gemini CLI</strong><br/>
<sub>MCP server</sub>
</td>
</tr>
<tr>
<td align="center" width="12.5%">
<a href="https://github.com/opencode-ai/opencode"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/opencode-dark.svg"><img src="https://svgl.app/library/opencode.svg" alt="OpenCode" width="48" height="48" /></picture></a><br/>
<strong>OpenCode</strong><br/>
<sub>22 hooks + MCP + plugin</sub>
</td>
<td align="center" width="12.5%">
<a href="https://github.com/cline/cline"><img src="https://github.com/cline.png?size=120" alt="Cline" width="48" height="48" /></a><br/>
<strong>Cline</strong><br/>
<sub>MCP server</sub>
</td>
<td align="center" width="12.5%">
<a href="https://github.com/block/goose"><img src="https://github.com/block.png?size=120" alt="Goose" width="48" height="48" /></a><br/>
<strong>Goose</strong><br/>
<sub>MCP server</sub>
</td>
<td align="center" width="12.5%">
<a href="https://github.com/Kilo-Org/kilocode"><img src="https://github.com/Kilo-Org.png?size=120" alt="Kilo Code" width="48" height="48" /></a><br/>
<strong>Kilo Code</strong><br/>
<sub>MCP server</sub>
</td>
<td align="center" width="12.5%">
<a href="https://github.com/Aider-AI/aider"><img src="https://github.com/Aider-AI.png?size=120" alt="Aider" width="48" height="48" /></a><br/>
<strong>Aider</strong><br/>
<sub>REST API</sub>
</td>
<td align="center" width="12.5%">
<a href="https://claude.ai/download"><img src="https://github.com/anthropics.png?size=120" alt="Claude Desktop" width="48" height="48" /></a><br/>
<strong>Claude Desktop</strong><br/>
<sub>MCP server</sub>
</td>
<td align="center" width="12.5%">
<a href="https://windsurf.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/windsurf-dark.svg"><img src="https://svgl.app/library/windsurf-light.svg" alt="Windsurf" width="48" height="48" /></picture></a><br/>
<strong>Windsurf</strong><br/>
<sub>MCP server</sub>
</td>
<td align="center" width="12.5%">
<a href="https://github.com/RooCodeInc/Roo-Code"><img src="https://github.com/RooCodeInc.png?size=120" alt="Roo Code" width="48" height="48" /></a><br/>
<strong>Roo Code</strong><br/>
<sub>MCP server</sub>
</td>
</tr>
<tr>
<td align="center" width="12.5%">
<a href="https://www.warp.dev"><img src="https://github.com/warpdotdev.png?size=120" alt="Warp" width="48" height="48" /></a><br/>
<strong>Warp</strong><br/>
<sub>connect + MCP + skills</sub>
</td>
</tr>
</table>
<p align="center">
<sub>Works with <strong>any</strong> agent that speaks MCP or HTTP. One server, memories shared across all of them.</sub>
</p>
---
You explain the same architecture every session. You re-discover the same bugs. You re-teach the same preferences. Built-in memory (CLAUDE.md, .cursorrules) caps out at 200 lines and goes stale. agentmemory fixes this. It silently captures what your agent does, compresses it into searchable memory, and injects the right context when the next session starts. One command. Works across agents.
**What changes:** Session 1 you set up JWT auth. Session 2 you ask for rate limiting. The agent already knows your auth uses jose middleware in `src/middleware/auth.ts`, your tests cover token validation, and you chose jose over jsonwebtoken for Edge compatibility. No re-explaining. No copy-pasting. The agent just *knows*.
bash npx @agentmemory/agentmemory ```
Latest release notes: CHANGELOG.md.
---
Recommended: install globally
```bash npm install -g @agentmemory/agentmemory If you hit EACCES on macOS/Linux system Node installs, retry with:sudo npm install -g @agentmemory/agentmemoryagentmemory # start the server (same as the npx form) agentmemory stop # tear it down agentmemory remove # uninstall everything we created agentmemory connect claude-code # wire one agent agentmemory doctor # interactive diagnostics + fix prompts bash npx -y @agentmemory/agentmemory@latest # forces latest from npm (cross-platform) rm -rf ~/.npm/_npx && npx @agentmemory/agentmemory # macOS/Linux only (POSIX shell) ```
On Windows / PowerShell, the equivalent cache clear is 2. register the agentmemory marketplace and install the plugincodex plugin marketplace add rohitg00/agentmemory codex plugin add agentmemory@agentmemory bash agentmemory connect codex --with-hooks ```
This adds an idempotent block to 1. Install Docker Desktop for Windows2. Start Docker Desktop and make sure the engine is runningTerminal 2: seed sample data and see recall in actionnpx @agentmemory/agentmemory demo ```
Open Codex CLI (Codex plugin platform)```bash Full hooks/skills plugin from the GitHub subdircopilot plugin install rohitg00/agentmemory:plugin text Install agentmemory for OpenClaw. Run npx @agentmemory/agentmemory in a separate terminal to start the memory server on localhost:3111. Then add this to my OpenClaw MCP config so agentmemory is available with all 53 memory tools:
{ "mcpServers": { "agentmemory": { "command": "npx", "args": ["-y", "@agentmemory/mcp"], "env": { "AGENTMEMORY_URL": "http://localhost:3111" } } } } Restart OpenClaw. Verify with text Install agentmemory for Hermes. Run npx @agentmemory/agentmemory in a separate terminal to start the memory server on localhost:3111. Then add this to ~/.hermes/config.yaml so Hermes can use agentmemory as an MCP server with all 53 memory tools:
mcp_servers: agentmemory: command: npx args: ["-y", "@agentmemory/mcp"] memory: provider: agentmemory Verify with Full guide: </details> or via the shim package:npx -y @agentmemory/mcp text Session 1: "Add auth to the API" Agent writes code, runs tests, fixes bugs agentmemory silently captures every tool use Session ends -> observations compressed into structured memory
Session 2: "Now add rate limiting" Agent already knows: - Auth uses JWT middleware in src/middleware/auth.ts - Tests in test/auth.test.ts cover token validation - You chose jose over jsonwebtoken for Edge compatibility Zero re-explaining. Starts working immediately. ``` Memory Pipeline
vs built-in agent memoryEvery AI coding agent ships with built-in memory — Claude Code has
---
🇨🇳 中文文档镜像
AI 翻译
2026-05-23
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介
agentmemory 是一个持久性记忆系统,用于 AI 编码代理。它基于 iii 引擎,提供了一个持久性记忆系统,用于 Claude Code、Cursor、Gemini CLI、Codex CLI、Hermes、OpenClaw、pi、OpenCode 等编码代理。 ⚡ 功能介绍
agentmemory 的关键功能包括自动捕获、语义搜索、记忆演进、自动遗忘和隐私优先。它使用 BM25 + 向量 + 知识图谱融合语义搜索,支持版本控制、超级替代、关系图谱等功能。 📋 环境依赖
agentmemory 需要 OPENAI_EMBEDDING_DIMENSIONS=1536 环境变量,用于设置嵌入维度。 🛠 安装步骤(Docker/pip/源码)
安装 agentmemory 可以使用 npm install -g @agentmemory/agentmemory 或 npx @agentmemory/agentmemory。也可以使用 Docker 或 pip 安装。 ⚙️ 配置说明(含 MCP / env)
agentmemory 的配置文件位于 ~/.agentmemory/.env 中。可以在这个文件中设置 Anthropic Base URL、Anthropic API Key 等环境变量。 🔌 API 说明
agentmemory 提供了 Codex CLI API,用于与 Codex CLI 进行交互。可以使用 ANTHROPIC_API_KEY 和 GEMINI_API_KEY 等环境变量来配置 API。 🔄 工作流/模块
agentmemory 的工作流包括 PostToolUse 钩子、SHA-256 去重、隐私过滤器、存储原始观察、LLM 压缩、结构化事实和概念、向量嵌入等。
🎯 aiskill88 AI 点评
A 级
2026-05-20
工程化程度高,解决AI agent的核心痛点——记忆能力。13.6k星证明社区认可度强,TypeScript实现保证代码质量,持续维护值得信赖。 📚 实用指南(长尾问题)
适合谁
最佳实践
常见错误
部署方案
⚡ 核心功能
👥 适合谁
⭐ 最佳实践
⚠️ 常见错误
👥 适合人群🎯 使用场景
⚖️ 优点与不足✅ 优点
⚠️ 不足
⚠️ 使用须知
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。 建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。 📄 License 说明
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。 🔗 相关工具推荐📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合
❓ 常见问题 FAQ主要支持Claude及其他主流LLM,可扩展集成其他模型。
💡 AI Skill Hub 点评
总体来看,AI编码助手持久化记忆系统 是一款质量优秀的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。 🌐 原始信息
🔗 原始来源
🐙 GitHub 仓库 https://github.com/rohitg00/agentmemory
🌐 官方网站 https://agent-memory.dev
收录时间:2026-05-19 · 更新时间:2026-05-30 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。 |