Memoir

RAG & Memory 💻 Python ⚖️ Apache-2.0 🟢 Actively maintained
610 stars

Memoir is a semantic memory system for AI agents that brings Git-like version control to memory management. It replaces opaque vector databases with transparent, versioned, cryptographically secure storage using hierarchical semantic paths. It is for developers building AI agents, coding assistants, or personal assistants that need reliable, auditable memory.

Memoir demo
🎞️ Demo from the project README

✨ Key features

  • Git-like versioning: branch, commit, merge, rollback memories with cryptographic integrity.
  • Semantic paths instead of UUID keys, e.g., profile.professional.skills.python.
  • O(log n) hierarchical lookups, faster than vector operations.
  • Memory aggregation: automatic consolidation of related memories.
  • Multiple search engines: keyword-based or LLM-powered.
  • Plugins for Claude Code, Codex, Hermes, OpenClaw, OpenCode, and MCP hosts.

🎯 Use cases

  • Give coding agents branch-aware memory to avoid context contamination across git checkouts.
  • Reduce token costs by avoiding full-context re-processing with versioned memory updates.
  • Audit and revert agent memory changes with git-like commands (blame, checkout).
  • Provide long-term memory to personal assistants like Hermes or OpenClaw.
  • Add versioned memory to any MCP-compatible host (Claude Desktop, Cursor, etc.).

📦 Installation

🧰 Requirements: Python 3.x, optionally uv for plugin auto-resolution; API key for LLM features (default Anthropic claude-haiku-4-5) or Claude Code subscription for CLI auth.

pip install memoir-ai

For agent plugins, see README sections for Claude Code, Codex, Hermes, OpenClaw, OpenCode, or MCP. Example for MCP:

{
  "mcpServers": {
    "memoir": {
      "command": "uvx",
      "args": ["--from", "memoir-ai[mcp]", "memoir-mcp"],
      "env": { "MEMOIR_STORE": "~/.memoir/mcp" }
    }
  }
}

🚀 Usage

export ANTHROPIC_API_KEY="sk-..."
memoir new my-memoir-store
cd my-memoir-store
memoir remember "Sarah prefers tabs and 2-space indents" -p preferences.coding.style
memoir get preferences.coding.style
memoir recall "what does Sarah prefer?"

⚠️ Good to know

Memoir is alpha; contributions welcome, and some features require LLM API keys or specific agent plugin setups.

❓ FAQ

How do I install Memoir?

Install from PyPI with pip install memoir-ai. The import is import memoir and the CLI is memoir.

Does Memoir require an API key?

LLM-backed features (auto-classification, semantic search) need an API key, defaulting to Anthropic's claude-haiku-4-5. Offline operations like storing with explicit paths work without a key.

Can I use Memoir with my existing agent?

Yes, Memoir provides plugins for Claude Code, Codex, Hermes, OpenClaw, OpenCode, and any MCP-compatible host via the memoir-mcp server.

How is Memoir different from a vector database?

Memoir uses hierarchical semantic paths and Git-like versioning instead of opaque vector embeddings, offering O(log n) lookups and full auditability.

📊 Repository

Stars★ 610
Forks🍴 41
Open issues🐛 4
Last commit🕒 Sep 3, 2026
Created📅 Aug 2025
Language💻 Python
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.