SkillAgentSearch skills...

Agentmemory

Persistent memory for AI coding agents

Install / Use

/learn @rohitg00/Agentmemory
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<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.</strong><br/> Persistent memory for Claude Code, Cursor, Gemini CLI, OpenCode, and any MCP client. </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" 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" 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" alt="License" /></a> <a href="https://github.com/rohitg00/agentmemory/stargazers"><img src="https://img.shields.io/github/stars/rohitg00/agentmemory?style=flat&color=yellow" alt="Stars" /></a> </p> <p align="center"> <img src="assets/demo.gif" alt="agentmemory demo" width="720" /> </p> <p align="center"> <a href="#quick-start">Quick Start</a> &bull; <a href="#why-agentmemory">Why</a> &bull; <a href="#benchmarks-measured-not-projected">Benchmarks</a> &bull; <a href="#how-it-works">How It Works</a> &bull; <a href="#search">Search</a> &bull; <a href="#mcp-server">MCP</a> &bull; <a href="#real-time-viewer">Viewer</a> &bull; <a href="#configuration">Config</a> &bull; <a href="#api">API</a> </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.

| | | |---|---| | 95.2% R@5 | LongMemEval (ICLR 2025) retrieval accuracy | | 92% fewer tokens | ~1,900 injected vs ~19,000 full context ($10/yr vs $500+/yr) | | 43 MCP tools | Search, remember, forget, actions, leases, signals, mesh sync | | 12 hooks | Captures every tool use automatically, zero manual effort | | 0 external deps | No Postgres, no Redis, no vector DB. Just iii-engine (auto-installed) |

npx @agentmemory/agentmemory   # installs iii-engine if missing, starts everything

Quick Start

Claude Code (paste this, the agent does the rest)

Install agentmemory: run `npx @agentmemory/agentmemory` in a separate terminal to start the memory server. Then run `/plugin marketplace add rohitg00/agentmemory` and `/plugin install agentmemory` to register all 12 hooks, 4 skills, and 43 MCP tools. Verify with `curl http://localhost:3111/agentmemory/health`. The real-time viewer is at http://localhost:3113.

That's it. Paste the block above into Claude Code. The agent handles installation, engine startup, plugin registration, and verification.

Other agents

Start the memory server first: npx @agentmemory/agentmemory

Then add the MCP config for your agent. All agents use the same server, so memories are shared across them.

| Agent | Setup | |---|---| | OpenClaw | Add to MCP config: {"mcpServers": {"agentmemory": {"command": "npx", "args": ["agentmemory-mcp"]}}} | | Cursor | Add to ~/.cursor/mcp.json: {"mcpServers": {"agentmemory": {"command": "npx", "args": ["agentmemory-mcp"]}}} | | OpenCode | Add to .opencode/config.json: {"mcpServers": {"agentmemory": {"command": "npx", "args": ["agentmemory-mcp"]}}} | | Codex CLI | Add to .codex/config.yaml: mcp_servers: {agentmemory: {command: npx, args: ["agentmemory-mcp"]}} | | Gemini CLI | gemini mcp add agentmemory -- npx agentmemory-mcp | | Hermes Agent | Add to ~/.hermes/config.yaml: mcp_servers: {agentmemory: {command: npx, args: ["agentmemory-mcp"]}} or use the memory provider plugin | | Cline | Add MCP server in Cline settings | | Goose | Add to ~/.config/goose/config.yaml: mcp_servers: {agentmemory: {command: npx, args: ["agentmemory-mcp"]}} | | Kilo Code | Add MCP server in Kilo Code settings | | Aider | Use REST API: curl -X POST http://localhost:3111/agentmemory/smart-search -d '{"query": "auth"}' | | Claude Desktop | Add to claude_desktop_config.json: {"mcpServers": {"agentmemory": {"command": "npx", "args": ["agentmemory-mcp"]}}} | | Any agent (32+) | npx skillkit install agentmemory |


Why agentmemory

Every coding agent forgets everything when the session ends. You waste the first 5 minutes of every session re-explaining your stack, your conventions, your recent decisions. agentmemory runs in the background and eliminates that entirely.

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
    - The rate limit discussion from last week's debugging session
  Zero re-explaining. Starts working immediately.

What it gives you

| Capability | What it does | |---|---| | Automatic capture | Every tool use, file edit, test run, and error is silently recorded via hooks | | LLM compression | Raw observations are compressed into structured facts, concepts, and narratives | | Context injection | Past knowledge is injected at session start within a configurable token budget | | Semantic search | Hybrid BM25 + vector search finds relevant memories even with different wording | | Memory evolution | Memories version over time, supersede each other, and form relationship graphs | | Project profiles | Aggregated per-project intelligence: top concepts, files, conventions, common errors | | Auto-forgetting | TTL expiry, contradiction detection, and importance-based eviction keep memory clean | | Privacy first | API keys, secrets, and <private> tags are stripped before anything is stored | | Self-healing | Circuit breaker, provider fallback chain, self-correcting LLM output, health monitoring | | Claude Code bridge | Bi-directional sync with ~/.claude/projects/*/memory/MEMORY.md | | Cross-agent MCP | Standalone MCP server for Cursor, Codex, Gemini CLI, Windsurf, any MCP client | | Citation provenance | JIT verification traces any memory back to source observations and sessions | | Cascading staleness | Superseded memories auto-flag related graph nodes, edges, and siblings as stale | | Knowledge graph | Entity extraction + BFS traversal across files, functions, concepts, errors | | 4-tier memory | Working → episodic → semantic → procedural consolidation with strength decay | | Team memory | Namespaced shared + private memory across team members | | Governance | Edit, delete, bulk-delete, and audit trail for all memory operations | | Git snapshots | Version, rollback, and diff memory state via git commits |

How it compares to built-in agent memory

Every AI coding agent now ships with built-in memory. Claude Code has MEMORY.md, Cursor has notepads, Cline has memory bank. These work like sticky notes: fast, always-on, but fundamentally limited.

agentmemory is the searchable database behind the sticky notes.

| | Built-in (CLAUDE.md, .cursorrules) | agentmemory | |---|---|---| | Scale | 200-line cap (MEMORY.md) | Unlimited | | Search | Loads everything into context | BM25 + vector + graph (returns top-K only) | | Token cost | 22K+ tokens at 240 observations | ~1,900 tokens (92% less) | | At 1K observations | 80% of memories invisible | 100% searchable | | At 5K observations | Exceeds context window | Still ~2K tokens | | Cross-session recall | Only within line cap | Full corpus search | | Cross-agent | Per-agent files (no sharing) | MCP + REST API (any agent) | | Multi-agent coordination | Impossible | Leases, signals, actions, routines | | Cross-agent sync | No | P2P mesh (7 scopes: memories, actions, semantic, procedural, relations, graph) | | Memory trust | No verification | Citation chain back to source observations with confidence scores | | Semantic search | No (keyword grep) | Yes (95.2% R@5 on LongMemEval-S) | | Memory lifecycle | Manual pruning | Ebbinghaus decay + tiered eviction | | Knowledge graph | No | Entity extraction + temporal versioning | | Observability | Read files manually | Real-time viewer on :3113 |

What it costs (spoiler: almost nothing)

| Approach | Tokens/year | Annual cost | Notes | |---|---|---|---| | Paste full history into context | 19.5M+ | Impossible | Exceeds context window after ~200 observations | | LLM-summarized memory (extraction-based) | ~650K | ~$500/yr | Loses context, summarization is lossy | | agentmemory context injection | ~170K | ~$10/yr | Token-budgeted, only relevant memories injected | | agentmemory with local embeddings | ~170K | $0 | all-MiniLM-L6-v2 runs locally, no API calls |

How memory flows

PostToolUse hook fires
  -> SHA-256 dedup (5min window)
  -> Privacy filter (strip secrets, API keys)
  -> Store raw observation
  -> LLM compress -> structured facts + concepts + narrative
  -> Generate vector embedding
  -> Index in BM25 + vector + knowledge graph

SessionStar

Related Skills

View on GitHub
GitHub Stars665
CategoryDevelopment
Updated1h ago
Forks69

Languages

TypeScript

Security Score

95/100

Audited on Apr 9, 2026

No findings