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://gist.github.com/rohitg00/2067ab416f7bbe447c1977edaaa681e2"><img src="https://img.shields.io/badge/Viral%20GitHub%20Gist-1.6k%20stars%20%2F%20230%20forks-FF6B35?style=for-the-badge&logo=github&logoColor=white&labelColor=1a1a1a" alt="Design doc: 1.6k stars / 230 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://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="54 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,674+ 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="#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, no manual effort |
| **Semantic search** | BM25 + vector + knowledge graph with RRF fusion |
| **Memory evolution** | Versioning, supersession, relationship graphs |
| **Recall hygiene** | Superseded memory versions leave the search indexes; the version chain in KV keeps full history |
| **Near-duplicate hints** | Saves report an advisory similarTo match when new content closely resembles an existing memory |
| **Per-agent scoping** | agentId threads through save and recall across REST, MCP, and the search index, in shared or isolated mode |
| **Write-time provenance** | Every observation and memory carries an immutable origin channel (user, agent, tool, import, or shared) stamped at capture, save, and import |
| **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 |
---
Requirements:
node -v, npm -v, and npx -v).curl, a POSIX sh, and tar. Minimal images such as node:20-slim may not include them.iii.exe to be installed manually. WSL2 or Docker Desktop are the other supported paths.Canonical fresh-install command:
npx -y @agentmemory/agentmemory@latest
The first run is an interactive setup: pick the agents to wire (Claude Code, Cursor, Codex, Gemini CLI, OpenCode, ...), pick an LLM provider or stay keyless, and it seeds the config, starts the memory server and its pinned iii engine, and offers to install globally so the bare agentmemory command works everywhere afterward. -y accepts npx's package prompt and @latest avoids a stale cached release. A provider makes LLM features available, but LLM-written observation compression starts only when AGENTMEMORY_AUTO_COMPRESS=true is also set.
Keyless mode disables vector embeddings. memory_recall (the mem::search path) uses BM25, while memory_smart_search can also fuse structural graph matches when graph data already exists. For free on-device semantic recall, set EMBEDDING_PROVIDER=local in ~/.agentmemory/.env and restart. The first embedding request downloads Xenova/all-MiniLM-L6-v2; inference runs locally after that initial model download.
The local runtime uses four ports: 3111 for REST/MCP HTTP, 3112 for iii streams, 3113 for the viewer, and 49134 for the iii worker WebSocket. Persistent iii state lives in ~/Library/Application Support/agentmemory on macOS, $XDG_DATA_HOME/agentmemory or ~/.local/share/agentmemory on Linux, and %APPDATA%\agentmemory on Windows. Use --data-dir <path> or AGENTMEMORY_DATA_DIR to override it, and reuse the same value on every restart. For backward compatibility, an existing ./data/state_store.db or ./data/iii-config.yaml takes precedence over the platform default for instance 0; an explicit flag or environment override still wins.
Then prove recall works and give your agent its skills:
npx -y @agentmemory/agentmemory@latest demo # seed sample sessions + exercise recall
npx skills add rohitg00/agentmemory -y # 17 native skills so your agent knows when to reach for memory
The keyword searches should hit in default keyless mode through BM25. The demo's database performance optimization query is intentionally semantic and can return zero until an embedding provider is configured.
Prefer to let a coding agent do the whole thing? Hand it one instruction:
Retrieve and follow the instructions at: https://raw.githubusercontent.com/rohitg00/agentmemory/main/INSTALL_FOR_AGENTS.md
Wire more agents any time with agentmemory connect <agent> — 20 adapters listed at Works with every agent. Full command reference at Quick Start.
<details> <summary><strong>Windows</strong></summary>
The fast path is WSL2. Native Windows engine setup requires the pinned v0.11.2 ZIP to be downloaded and iii.exe extracted manually; the CLI does not auto-extract it. Docker Desktop is also supported. See the Windows notes for the step-by-step.
</details>
<details> <summary><strong>Global install / EACCES</strong></summary>
npm install -g @agentmemory/agentmemory@latest
The npx command above remains the canonical fresh-install path and avoids global-prefix permission issues.
</details>
<details> <summary><strong>npx serves an old version</strong></summary>
npx caches per version. 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).
</details>
<details> <summary><strong>Already running your own iii engine</strong></summary>
agentmemory pins iii-engine v0.11.2 and won't attach to a different version (the worker can't speak another engine's protocol). Stop the other engine, then run npx -y @agentmemory/agentmemory@latest. It installs and runs the pinned v0.11.2 in ~/.agentmemory/bin, leaving your own iii untouched.
</details>
---
agentmemory works with any agent that supports hooks, MCP, or REST API. All agents share the same memory server.
<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, with no re-explaining and no copy-pasting.
npx -y @agentmemory/agentmemory@latest
By default, agentmemory stores iii-engine state outside the repository you start it from: ~/Library/Application Support/agentmemory on macOS, $XDG_DATA_HOME/agentmemory or ~/.local/share/agentmemory on Linux, and %APPDATA%\agentmemory on Windows. An existing legacy ./data/state_store.db or ./data/iii-config.yaml is reused for instance 0 before that platform default. To choose a location explicitly, pass --data-dir <path> or set AGENTMEMORY_DATA_DIR; either explicit setting takes precedence over legacy discovery:
npx -y @agentmemory/agentmemory@latest --data-dir ~/.agentmemory-projects/main
AGENTMEMORY_DATA_DIR=~/.agentmemory-projects/main npx -y @agentmemory/agentmemory@latest
Native and Docker launches use this same resolved host directory; Docker bind-mounts it at /data. --instance 1 appends instance-1 to the resolved directory and selects the separate default port quartet 3211/3212/3213/49234.
Latest release notes: CHANGELOG.md.
---
Validate a fresh install and restart persistenceWith the server running, validate REST, health, the viewer, and the iii-backed runtime status:
The startup ready panel accounts for all four ports: REST/MCP HTTP on 3111, iii streams on 3112, the viewer on 3113, and the iii worker WebSocket on 49134.
Then run 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 running3. Select Docker explicitly and run agentmemory:$env:AGENTMEMORY_USE_DOCKER = "1" npx -y @agentmemory/agentmemory@latest powershell npx -y @agentmemory/agentmemory@latest mcp
Terminal 2: seed sample data and see recall in actionnpx -y @agentmemory/agentmemory@latest 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 -y @agentmemory/agentmemory@latest 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 54 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 -y @agentmemory/agentmemory@latest 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 54 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 不对第三方内容的准确性作法律背书。 |