rohitg00 / agentmemory

rohitg00 / agentmemory

Your coding agent remembers everything. No more re-explaining. Built on iii engine Persistent memory for Claude Code, Cursor, Gemini CLI, Codex CLI, pi, OpenCode, and any MCP client. The gist extends Karpathy’s LLM Wiki pattern with confidence scoring, lifecycle, knowledge graphs, and hybrid search. agentmemory is the implementation. 你的编程助手现在可以记住一切,无需反复解释。该项目基于 iii 引擎构建,为 Claude Code、Cursor、Gemini CLI、Codex CLI、pi、OpenCode 以及任何 MCP 客户端提供持久化记忆。其核心理念扩展了 Karpathy 的 LLM Wiki 模式,引入了置信度评分、生命周期管理、知识图谱和混合搜索。agentmemory 即是这一理念的实现。

Quick Start • Benchmarks • vs Competitors • Agents • How It Works • MCP • Viewer • iii Console • Powered by iii • Config • API 快速开始 • 基准测试 • 竞品对比 • 代理支持 • 工作原理 • MCP • 查看器 • iii 控制台 • 由 iii 驱动 • 配置 • API

agentmemory works with any agent that supports hooks, MCP, or REST API. All agents share the same memory server. agentmemory 适用于任何支持钩子(hooks)、MCP 或 REST API 的代理。所有代理共享同一个记忆服务器。

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. 你是否在每个会话中都要解释相同的架构?是否在重复发现相同的 Bug?是否在反复教导相同的偏好?内置的记忆文件(如 CLAUDE.md, .cursorrules)通常限制在 200 行以内且容易过时。agentmemory 解决了这个问题。它会在后台静默捕获代理的操作,将其压缩为可搜索的记忆,并在下一次会话开始时注入正确的上下文。只需一条命令,即可跨代理工作。

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. 场景示例:在会话 1 中,你设置了 JWT 认证。在会话 2 中,你要求添加速率限制。此时,代理已经知道你的认证使用了 src/middleware/auth.ts 中的 jose 中间件,你的测试覆盖了令牌验证,并且你为了 Edge 兼容性选择了 jose 而非 jsonwebtoken。无需重新解释,无需复制粘贴,代理直接知晓。

npx @agentmemory/agentmemory New in v0.9.0 — Landing site at agent-memory.dev, filesystem connector (@agentmemory/fs-watcher), standalone MCP now proxies to the running server so hooks and the viewer agree, audit policy codified across every delete path, health stops flagging memory_critical on tiny Node processes. Full notes in CHANGELOG.md. v0.9.0 新特性 — 官网 agent-memory.dev 上线,新增文件系统连接器 (@agentmemory/fs-watcher),独立的 MCP 现在代理至运行中的服务器,确保钩子与查看器同步,所有删除路径均已编码审计策略,修复了小型 Node 进程中健康检查误报 memory_critical 的问题。完整说明请见 CHANGELOG.md。

Retrieval Accuracy: agentmemory achieves 95.2% R@5 and 98.6% R@10, significantly outperforming BM25-only fallback. 检索准确率:agentmemory 的 R@5 达到 95.2%,R@10 达到 98.6%,显著优于仅使用 BM25 的回退方案。

Token Savings: Compared to pasting full context (19.5M+ tokens) or LLM-summarized approaches (~650K tokens), agentmemory reduces usage to ~170K tokens/year, costing ~$10/year or $0 with local embeddings. Token 节省:与粘贴完整上下文(1950 万+ tokens)或 LLM 总结方案(约 65 万 tokens)相比,agentmemory 将年消耗降低至约 17 万 tokens,每年成本仅约 10 美元,若使用本地嵌入模型则成本为 0。

Competitor comparison: agentmemory vs mem0, Letta, Khoj, claude-mem, Hippo. 竞品对比:agentmemory 与 mem0、Letta、Khoj、claude-mem、Hippo 的详细对比。

Try it in 30 seconds:

  1. Start the server: npx @agentmemory/agentmemory
  2. Seed sample data: npx @agentmemory/agentmemory demo
  3. Open http://localhost:3113 to watch the memory build live. 30 秒快速上手:
  4. 启动服务器:npx @agentmemory/agentmemory
  5. 植入示例数据:npx @agentmemory/agentmemory demo
  6. 访问 http://localhost:3113 实时查看记忆构建过程。

Session Replay: Every session agentmemory records is replayable. Open the viewer, pick the Replay tab, and scrub through the timeline: prompts, tool calls, tool results, and responses render as discrete events with play/pause, speed control, and keyboard shortcuts. 会话回放:agentmemory 记录的每个会话均可回放。打开查看器,选择“回放”选项卡,即可在时间轴上拖动查看:提示词、工具调用、工具结果和响应均以独立事件呈现,支持播放/暂停、速度控制和快捷键操作。

Claude Code (one block, paste it): Install agentmemory by running npx @agentmemory/agentmemory in a separate terminal. Then run /plugin marketplace add rohitg00/agentmemory and /plugin install agentmemory. The plugin registers 12 hooks, 4 skills, and auto-wires the MCP server, providing 51 MCP tools without extra config. Claude Code(一键安装):在独立终端运行 npx @agentmemory/agentmemory 安装记忆服务器。随后运行 /plugin marketplace add rohitg00/agentmemory/plugin install agentmemory。该插件会自动注册 12 个钩子、4 个技能并自动配置 MCP 服务器,无需额外设置即可获得 51 个 MCP 工具。