Memory infrastructure for AI agents

Git for AI Memory

Local-first memory your agents can explain, rewind, and branch.

Memoir replaces opaque vector memory with a local-first, taxonomy-structured, Git-versioned store. Recall by path, not by similarity. Time-travel to reproduce bugs. Branch to test risky strategies. Built for coding agents and custom runtimes alike.

memoir.recall( " what's my coding style? " )
Apache 2.0 Python 3.10+ Claude Code, Codex & OpenCode plugins

Python install for the SDK or CLI.

Claude Code plugin install. Run inside a Claude Code session.

Using Codex or OpenCode instead? Codex install · OpenCode install →

Why Memoir

Today's AI memory is a Global Variable anti-pattern.

Every production agent hits the same three walls: context contamination, token rent, and memory drift. Memoir brings version control to your agent's mind.

Your agent doesn't respect your git state.

Context contamination happens every time you git checkout. Without branch-aware memory, your agent tries to apply experimental refactor patterns to stable production hotfixes.

You’re paying "token rent" on a flat file.

Using CLAUDE.md or MEMORY.md as a global store is a cache-killer. Every minor memory update invalidates your entire prefix cache, forcing you to pay full price to re-process your entire conversation.

Memory is a codebase without version control.

One bad session poisons every future retrieval. Without memoir blame or memoir checkout, there is no way to audit who taught the agent a rule or revert a hallucination without wiping the entire store.

The solution

Git for memory.

Memoir replaces fuzzy retrieval with version-controlled, branch-aware memory. It ships as a Claude Code plugin — a set of automatic skills and hooks that follow your git workflow.

Semantic path retrieval.

Instead of "vibe search" (vector DB), Memoir uses hierarchical paths like api.v2.auth to fetch the exact 10 tokens needed — keeping your prompt cache stable.

memoir get api.v2.auth
→ "JWT, 15-min expiry, refresh on 401"

Automated branch shadowing.

Memoir branches follow your git branches automatically via Claude Code hooks. No manual sync, no contamination across checkouts.

$ git checkout migrate-to-deck-gl
→ memoir · switched to migrate-to-deck-gl

The merge workflow.

Lessons learned on a feature branch can be reviewed and merged into the main knowledge base — just like code.

memoir merge feature/deck-gl → main
3 paths added · 1 conflict resolved
Quickstart

From zero to persistent memory in 60 seconds.

Nine entry points. Pick your runtime — Memoir stores are compatible across all of them.

Memoir installs as a first-class Claude Code plugin. Auto-capture on session end, context injection on start.

# Inside a Claude Code session:
/plugin marketplace add zhangfengcdt/memoir
/plugin install memoir@memoir

# That's it. Next session starts with:
#   • auto-capture of session memories
#   • context injection on start
#   • slash commands (/memoir-remember, /memory-recall, /memoir-ui)
Full docs
Real session

Memoir, running in Claude Code

A real Claude Code session — same plugin, same store, same commands.

See another demo Simulated multi-agent walkthrough