← 开源
zhangfengcdt

memoir

Hierarchical Agent Memory with Git-Like Version Control

InfrastructureData systemsPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
622
Star
44
Fork
+2
本周
7
贡献者
创建于 2025-08-08 · 更新于 2026-10-16 · 今日第 15944 名
主要开发者
zhangfengcdtrapidSpacedisafronov

zhangfengcdt/memoir 排名第 15,944,有 622 个星标。

同类别比较

zhangfengcdt/memoir 排名第 15,944,此处有 8 个同类条目;ai365vip/chat-api 排名第 15,930。

同类别比较
名称排名指标
jingkaihe/matchlock15,908
语言:
Go
星标数:
624
分叉数:
38
简介:
Matchlock secures AI agent workloads with a Linux-based sandbox.
OtterMind/Nubase15,914
语言:
Java
星标数:
623
分叉数:
74
简介:
🔥🔥🔥 Turn AI-written code into real apps. Nubase is an open-source, AI-native backend platform for AI Coding, agentic applications, and modern product teams: Memory, Database, Storage, and Auth in one self-hostable service.
neptune-ai/neptune-client15,921
语言:
Python
星标数:
623
分叉数:
75
简介:
📘 The experiment tracker for foundation model training
ai365vip/chat-api15,930
语言:
JavaScript
星标数:
622
分叉数:
141
简介:
OpenAI 接口聚合管理,我们致力于提供优质的API接入服务,让您可以轻松集成先进的AI模型至您的产品和服务。
Tlntin/Qwen-TensorRT-LLM15,963
语言:
Python
星标数:
620
分叉数:
58
objectbox/objectbox-swift15,991
语言:
Swift
星标数:
619
分叉数:
37
简介:
Swift database - fast, simple and lightweight (iOS, macOS)
apoorvumang/prompt-lookup-decoding15,997
语言:
Jupyter Notebook
星标数:
618
分叉数:
28
简介:
Simple speculative decoding technique, integrated in vLLM and transformers
algolia/instantsearch-ios16,052
语言:
Swift
星标数:
614
分叉数:
61
简介:
⚡️ A library of widgets and helpers to build instant-search applications on iOS.
关键参数与规格
关键参数与规格
参数值
语言Python
类别Infrastructure
子类别Data systems
关键词Agent-ready APIs, Embeddings, Memory management, Retrieval
星标数622
分叉数44
贡献者7
创建日期2025-08-08
更新日期2026-10-16
1 天星标数0
7 天星标数2
排名15,944
上次排名4,390
排名变化-11,554
7 天星标排名8,723
上次 7 天星标排名8,782
7 天星标排名变化59
总星标排名16,329
上次总星标排名16,285
总星标排名变化-44
README 摘录

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. 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 . 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 or 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. One bad session poisons every future retrieval. Without or , there's no way to audit who taught the agent a rule or revert a hallucination without wiping the whole store. Multiple agent sessions working with Memoir. Install a plugin for your agent Memoir ships as a plugin for several coding and personal-assistant agents. 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. Codex Memoir's Codex plugin is distributed from this repository's Codex marketplace. In Codex, run , add the marketplace from , restart Codex if prompted, then choose **Memoir Plugins** and install . You can also register the marketplace from the CLI: While developing from a local checkout, use instead. The repo marketplace lives at and points Codex at , relative to the repository root. Enable Codex hooks with in or pass for a smoke run

. The Codex plugin ships lifecycle hooks; , , , , and skills; Codex-specific transcript parsing; and local marketplace metadata. See the Codex plugin guide for setup, limitations, and the real Codex smoke-test flow. Hermes Memoir is a memory provider for Hermes, the Nous Research personal-assistant agent. Install the plugin into your Hermes home and activate it: Hermes then auto-captures durable facts (people, schedule, preferences, standing instructions) each turn and exposes / / / / tools. Capture/classification run on your host-selected model via

direct provider APIs (never the CLI). See the Hermes plugin guide for install, configuration, model selection, and proxy routing. OpenClaw (community) Memoir is a memory plugin for OpenClaw, the personal-assistant gateway. Install it into the memory slot, allow conversation access, and restart the gateway: OpenClaw then auto-captures durable facts each turn (remembered across your sessions by default) and exposes / / / tools plus an in-chat command. See the OpenClaw plugin guide for configuration, scoping, model selection, and tool-profile

notes. OpenCode (community) **opencode-memoir** is a community-maintained plugin that brings Memoir's long-term memory workflows to OpenCode through

常见问题

记录了多少星标和分叉?

zhangfengcdt/memoir 有 622 个星标和 44 个分叉。

仓库排名是多少?

zhangfengcdt/memoir 排名第 15,944。

记录的语言和类别是什么?

zhangfengcdt/memoir 有 622 个星标,语言为 Python,类别为 Infrastructure。

哪个仓库排名最接近?

zhangfengcdt/memoir 与 ai365vip/chat-api 比较,后者排名第 15,930,有 622 个星标。

README

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 is import memoir and the CLI is memoir.

Install a plugin for your agent

Memoir ships as a plugin for several coding and personal-assistant agents. Expand the one you use:

Claude Code

Inside a Claude Code session, run:

/plugin marketplace add zhangfengcdt/memoir
/plugin install memoir@memoir

No manual pip install needed if you have uv on PATH — the plugin auto-resolves to uvx --from memoir-ai memoir when the bare memoir binary isn't installed. Don't have uv? Install it once with the standard one-liner:

curl -LsSf https://astral.sh/uv/install.sh | sh

That's enough — the plugin handles the rest. 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.

Codex

Memoir's Codex plugin is distributed from this repository's Codex marketplace. In Codex, run /plugins, add the memoir marketplace from zhangfengcdt/memoir, restart Codex if prompted, then choose Memoir Plugins and install memoir.

You can also register the marketplace from the CLI:

codex plugin marketplace add zhangfengcdt/memoir

While developing from a local checkout, use codex plugin marketplace add /absolute/path/to/memoir instead. The repo marketplace lives at .agents/plugins/marketplace.json and points Codex at ./plugins/codex, relative to the repository root.

No manual pip install needed if you have uv on PATH — the Codex plugin resolves the Memoir CLI the same way the Claude Code plugin does: memoir on PATH first, then uvx --from memoir-ai== memoir, then uv tool run --from memoir-ai== memoir.

Enable Codex hooks with [features].hooks = true in ~/.codex/config.toml or pass --enable hooks for a smoke run. The Codex plugin ships lifecycle hooks; memory-recall, memoir-onboard, memoir-remember, memoir-status, and memoir-ui skills; Codex-specific transcript parsing; and local marketplace metadata. See the Codex plugin guide for setup, limitations, and the real Codex smoke-test flow.

Hermes

Memoir is a memory provider for Hermes, the Nous Research personal-assistant agent. Install the plugin into your Hermes home and activate it:

hermes plugins install zhangfengcdt/memoir/plugins/hermes   # or: cp -r plugins/hermes ~/.hermes/plugins/memoir
hermes memory setup                                         # choose "memoir"

Hermes then auto-captures durable facts (people, schedule, preferences, standing instructions) each turn and exposes memoir_recall / memoir_remember / memoir_forget / memoir_sync / memoir_status tools. Capture/classification run on your host-selected model via direct provider APIs (never the claude CLI). See the Hermes plugin guide for install, configuration, model selection, and proxy routing.

OpenClaw (community)

Memoir is a memory plugin for OpenClaw, the personal-assistant gateway. It lives in its own repo, zhangfengcdt/openclaw-memoir. Install it into the memory slot, allow conversation access, and restart the gateway:

openclaw plugins install https://github.com/zhangfengcdt/openclaw-memoir   # or: --link /path/to/openclaw-memoir
openclaw config set plugins.entries.memory-memoir.hooks.allowConversationAccess true
systemctl --user restart openclaw-gateway

OpenClaw then auto-captures durable facts each turn (remembered across your sessions by default) and exposes memoir_recall / memoir_remember / memoir_forget / memoir_status tools plus an in-chat /memoir command. Set a capture model + provider key in config — plugins.entries.memory-memoir.config.{model,apiKey} (OpenClaw keeps its own keys in a secret store; use a temperature=0-capable model like anthropic/claude-haiku-4-5). See the OpenClaw plugin guide for configuration, scoping, model selection, and tool-profile notes.

OpenCode (community)

opencode-memoir is a community-maintained plugin that brings Memoir's long-term memory workflows to OpenCode through its native plugin system. Follow the install instructions in that repository.

Any MCP host (Claude Desktop, Cursor, Cline, Windsurf, VS Code, Zed, …)

Memoir ships an MCP server (memoir-mcp) on the official Model Context Protocol SDK, so any MCP-compatible host gets git-versioned memory — including the memoir_branches / memoir_checkout / memoir_commits versioning tools no other memory server has. No install needed if you have uv; add to your host's mcpServers config:

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

Recall is LLM-free by default (keyless), with opt-in single-call or multi-level tiered LLM modes; the store auto-creates on first use. See the MCP server guide for per-host config (VS Code/Zed/Continue/LibreChat differ slightly), recall modes + LLM setup, remote HTTP for ChatGPT/Claude.ai connectors, and the one-click Claude Desktop .mcpb.

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-..."

Note that if you do not set any model api keys, it will try to use the claude -p command to authenticate via claude code's subscription.

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. Watch a file by indexing it on the fly
memoir watch add ~/papers/transformer.pdf -n research

# 7. Search the indexed content
memoir search "transformer attention mechanism"

# 8. 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.
  • Codex — plugin install, hooks, skills, transcript parsing, smoke-test evidence.
  • 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 run make ci before 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.

排名相邻
同类项目