agentmemory  by rohitg00

Persistent memory for AI coding agents

Created 1 month ago
715 stars

Top 47.8% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This project addresses the critical issue of AI coding agent memory loss between sessions, which forces repetitive context re-explanation and hinders efficiency. agentmemory provides a persistent, searchable, and versioned database, significantly enhancing agent efficiency, reducing token costs, and enabling faster, more aware session starts for developers.

How It Works

Leverages hooks to capture agent actions (tool use, file edits, errors), then uses LLMs for compression into structured facts and narratives. Core retrieval employs a novel triple-stream approach combining BM25, vector embeddings, and knowledge graph traversal, fused via Reciprocal Rank Fusion. Memory management includes 4-tier consolidation, automatic versioning, superseding facts, and cascading staleness propagation, ensuring context remains clean and relevant.

Quick Start & Requirements

  • Primary Install/Run: npx @agentmemory/agentmemory (auto-installs iii-engine). For Claude Code: /plugin marketplace add rohitg00/agentmemory then /plugin install agentmemory.
  • Prerequisites: Node.js >= 20, iii-engine.
  • Dependencies: Supports multiple LLM/embedding providers (Claude default, Gemini, OpenAI, etc.); local Xenova embeddings recommended. Zero external DB dependencies.
  • Links: Real-time viewer: http://localhost:3113.

Highlighted Details

  • Triple-Stream Retrieval: Fuses BM25, vector, and graph search for superior recall (64% Recall@10 with embeddings vs. 56% for grep).
  • Memory Evolution: Automatic versioning, superseding memories, and relationship graphs with cascading staleness.
  • Cross-Agent MCP: Standalone MCP server enables shared memory across agents (Cursor, Codex, Windsurf) via 41 tools.
  • Performance: Achieves 64% Recall@10 and perfect MRR, using 92% fewer tokens than naive context dumping.
  • Provenance: JIT verification traces memories to source observations.
  • Auto-forgetting: Implements TTL expiry, contradiction detection, and importance-based eviction.

Maintenance & Community

The project features 581 unit tests and zero external database dependencies, indicating a focus on stability and self-containment. No specific community channels or contributor details were highlighted in the README.

Licensing & Compatibility

Licensed under Apache-2.0, a permissive license suitable for commercial use and integration into closed-source projects.

Limitations & Caveats

While robust, the system relies on LLM compression and embedding generation, which can be resource-intensive. Configuration for specific LLM/embedding providers is required for optimal performance beyond the default Claude integration. The project appears to be under active development (v0.7.1).

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
19
Issues (30d)
21
Star History
715 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.