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.pt-PT.md">🇵🇹 Português</a> • <a href="READMEs/README.pt-BR.md">🇧🇷 Português (Brasil)</a> • <a href="READMEs/README.es-ES.md">🇪🇸 Español</a> • <a href="READMEs/README.de-DE.md">🇩🇪 Deutsch</a> • <a href="READMEs/README.fr-FR.md">🇫🇷 Français</a> • <a href="READMEs/README.it-IT.md">🇮🇹 Italiano</a> • <a href="READMEs/README.nl-NL.md">🇳🇱 Nederlands</a> • <a href="READMEs/README.pl-PL.md">🇵🇱 Polski</a> • <a href="READMEs/README.cs-CZ.md">🇨🇿 Čeština</a> • <a href="READMEs/README.ro-RO.md">🇷🇴 Română</a> • <a href="READMEs/README.hu-HU.md">🇭🇺 Magyar</a> • <a href="READMEs/README.el-GR.md">🇬🇷 Ελληνικά</a> • <a href="READMEs/README.sv-SE.md">🇸🇪 Svenska</a> • <a href="READMEs/README.da-DK.md">🇩🇰 Dansk</a> • <a href="READMEs/README.nb-NO.md">🇳🇴 Norsk</a> • <a href="READMEs/README.fi-FI.md">🇫🇮 Suomi</a> • <a href="READMEs/README.ru-RU.md">🇷🇺 Русский</a> • <a href="READMEs/README.uk-UA.md">🇺🇦 Українська</a> • <a href="READMEs/README.tr-TR.md">🇹🇷 Türkçe</a> • <a href="READMEs/README.he-IL.md">🇮🇱 עברית</a> • <a href="READMEs/README.ar-SA.md">🇸🇦 العربية</a> • <a href="READMEs/README.hi-IN.md">🇮🇳 हिन्दी</a> • <a href="READMEs/README.bn-BD.md">🇧🇩 বাংলা</a> • <a href="READMEs/README.ur-PK.md">🇵🇰 اردو</a> • <a href="READMEs/README.th-TH.md">🇹🇭 ไทย</a> • <a href="READMEs/README.vi-VN.md">🇻🇳 Tiếng Việt</a> • <a href="READMEs/README.id-ID.md">🇮🇩 Bahasa Indonesia</a> • <a href="READMEs/README.tl-PH.md">🇵🇭 Tagalog</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://skills.sh/rohitg00/agentmemory"><img src="https://skills.sh/b/rohitg00/agentmemory" alt="skills.sh" height="28" /></a> <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="3,300+ 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>
---
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.22.1 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.22.1 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.22.1 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 --force ```
This merges global hooks and rewrites the agentmemory MCP entry, preserving unrelated entries. Review any custom agentmemory endpoint settings before using 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 (agentmemory pins the engine to the same release as its iii-sdk;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. ``` Alternatively, full hooks/skills plugin from the GitHub subdircopilot plugin install rohitg00/agentmemory:plugin ```
vs built-in agent memoryEvery AI coding agent ships with built-in memory: Claude Code has
---
|
| 原始名称 | agentmemory |
| 原始描述 | 开源AI工作流:#1 Persistent memory for AI coding agents based on real-world benchmarks。⭐13.6k · TypeScript |
| Topics | 智能体记忆AI工作流编码助手Claude持久化存储 |
| GitHub | https://github.com/rohitg00/agentmemory |
| License | Apache-2.0 |
| 语言 | TypeScript |
收录时间:2026-05-19 · 更新时间:2026-05-30 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。