High-performance semantic memory system integrating LangMem with ProllyTree
Project description
Memoir
Git for AI Memory
Hierarchical Memory with Git-Like Version Control
Memoir is a high-performance semantic memory system for AI agents that brings Git-like version control to AI memory management. It replaces opaque vector databases with transparent, versioned, cryptographically secure memory storage using hierarchical semantic paths.
Project page: memoir-ai.dev — full overview, demos, and roadmap.
Why agents need versioned memory
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.
Your agent's memory is code without version control.
Today's AI memory — CLAUDE.md, vector stores, scratchpads — is treated like an append-only blob. One bad session poisons every future retrieval. Without memoir blame or memoir checkout, there's no way to audit who taught the agent a rule or revert a hallucination without wiping the whole store.
Key Features
- Git-like Versioning — Branch, commit, merge, and rollback memories with cryptographic integrity.
- Semantic Paths — Replace UUID keys with meaningful paths like
profile.professional.skills.python. - O(log n) Lookups — Fast hierarchical search instead of expensive vector operations.
- Memory Aggregation — Automatic consolidation of related memories at semantic locations.
- Clean Architecture — Proper separation of storage, classification, and search layers.
- Multiple Search Engines — Choose between fast keyword-based or intelligent LLM-powered search.
Install from PyPI
pip install memoir-ai
The distribution name on PyPI is
memoir-ai. The Python import isimport memoirand the CLI ismemoir.
Install for Claude Code
Inside a Claude Code session, run:
/plugin marketplace add zhangfengcdt/memoir
/plugin install memoir@memoir
No need to pip install memoir-ai first — if you have uv (or uvx) on PATH, the plugin will fetch the CLI on demand via uvx --from memoir-ai memoir. It registers hooks for session start, user-prompt-submit, and stop, so your project gets automatic context injection and auto-captured memories. See the Claude Code plugin guide for the full slash-command and hook reference.
Quick look
Memoir's CLI defaults to Anthropic claude-haiku-4-5 as of v0.1.6 — set your key first:
export ANTHROPIC_API_KEY="sk-..."
Then create a store and round-trip a memory:
# 1. Create a memoir store
memoir new my-memoir-store
cd my-memoir-store
# 2. Store with an explicit path (offline, no LLM call)
memoir remember "Sarah prefers tabs and 2-space indents" -p preferences.coding.style
# 3. Store with auto-classification (LLM picks the path; needs API key)
memoir remember "I work in Pacific time"
# 4. Read back by path (offline)
memoir get preferences.coding.style
# 5. Semantic search (LLM-backed)
memoir recall "what does Sarah prefer?"
# 6. Open the visual explorer (auto-opens in your browser)
memoir ui
Curious what the UI looks like before installing? Browse the UI Gallery.
Prefer a different model? memoir recall "..." --model gpt-4o-mini (needs OPENAI_API_KEY), or set MEMOIR_LLM_MODEL in your shell. Resolution order: --model flag → MEMOIR_LLM_MODEL → claude-haiku-4-5.
See the full Quickstart for the Python API and version-control workflow.
Documentation
Full docs live at zhangfengcdt.github.io/memoir:
- Quickstart — five-minute tour of the core loop.
- CLI Reference — every command, flag, and exit code.
- UI — the visual explorer (Tree / Graph / Timeline / Places +
/stats). - Claude Code — plugin install, slash commands, hooks, lifecycle.
- Architecture — taxonomy, classifier, store, search.
- API Reference — Python SDK.
- Examples — context branching, memory debugging, reproducible testing.
Contributing
Memoir is alpha and contributions are very welcome — especially from people building coding agents, since that's the audience we're optimizing for. Good first paths in:
- Pick an issue from the issue tracker or open one describing a gap.
- Fork the repo, branch off
main, and runmake cibefore opening a PR (lint, tests, docs build must be green). - Bug reports with a minimal reproducer and benchmark / taxonomy proposals for coding-agent use cases are particularly appreciated.
License
Apache License 2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file memoir_ai-0.1.9.tar.gz.
File metadata
- Download URL: memoir_ai-0.1.9.tar.gz
- Upload date:
- Size: 554.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0c9ef56dffd242dd659ef79bd77749a9c96f3f51c7d6d6e920d67e5488be750
|
|
| MD5 |
c163c968e18f4e507f8b6ff2983fcdf6
|
|
| BLAKE2b-256 |
09f4590c5fca157eed0cbf4296c20971a5370cba9d359a47d5f9c183e8bb6dca
|
Provenance
The following attestation bundles were made for memoir_ai-0.1.9.tar.gz:
Publisher:
release.yml on zhangfengcdt/memoir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memoir_ai-0.1.9.tar.gz -
Subject digest:
e0c9ef56dffd242dd659ef79bd77749a9c96f3f51c7d6d6e920d67e5488be750 - Sigstore transparency entry: 1429890795
- Sigstore integration time:
-
Permalink:
zhangfengcdt/memoir@f5f141b0acb833468ce701b8dc0de63a4178991a -
Branch / Tag:
refs/heads/release/v0.1.9 - Owner: https://github.com/zhangfengcdt
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f5f141b0acb833468ce701b8dc0de63a4178991a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file memoir_ai-0.1.9-py3-none-any.whl.
File metadata
- Download URL: memoir_ai-0.1.9-py3-none-any.whl
- Upload date:
- Size: 774.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df2fc8fa3471876aa0533492c54ab49e797e01d0445577bf5c380cb746ff72cb
|
|
| MD5 |
3cdc60e07373df910a3c855a0f604a93
|
|
| BLAKE2b-256 |
131eaf0e365ee4cd681699ddab21192e7485528ea89d8ae98a3a9a3e89868386
|
Provenance
The following attestation bundles were made for memoir_ai-0.1.9-py3-none-any.whl:
Publisher:
release.yml on zhangfengcdt/memoir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memoir_ai-0.1.9-py3-none-any.whl -
Subject digest:
df2fc8fa3471876aa0533492c54ab49e797e01d0445577bf5c380cb746ff72cb - Sigstore transparency entry: 1429890797
- Sigstore integration time:
-
Permalink:
zhangfengcdt/memoir@f5f141b0acb833468ce701b8dc0de63a4178991a -
Branch / Tag:
refs/heads/release/v0.1.9 - Owner: https://github.com/zhangfengcdt
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f5f141b0acb833468ce701b8dc0de63a4178991a -
Trigger Event:
workflow_dispatch
-
Statement type: