Persistent memory layer for AI coding agents — current-state retrieval that knows what is still true
Membrick
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Open-source agent memory for coding agents.**
> **AI memory that knows what is still true.** Your agent doesn't just forget; it can confidently remember outdated decisions.
Membrick is an open-source **persistent agent memory** layer for Claude Code, Codex, Gemini CLI, Antigravity CLI (AGY), and Muse Code. It turns project history — sessions, documents, decisions, traces, notes, and code — into **current, evidence-backed context** when an agent needs it.
Search can find the right topic. Membrick helps an agent answer the harder question: **is this information still true?** It uses relevance, time, and semantic relationships to distinguish the latest truth from old-but-still-relevant history.
Agent memory guide · Quickstart · Reproducible demo · Agent integrations · Benchmarks · Documentation
**Current benchmark:** 500-question LongMemEval-S. See the
latest benchmark results for metrics and the source report.
---
The stale-memory problem
Your project says one thing on Monday and something different on Friday. Both versions remain relevant to the same question.
**Older — decision-a.md**
**Newer — decision-b.md**
Now ask:
A normal retriever can return either document — or both — and leave the model to guess which value is current.
**Membrick keeps 2 as the current answer and preserves 5 as superseded history.**
That difference matters anywhere project truth changes over time: architecture decisions, API contracts, configuration values, runbooks, ownership, terminology, and implementation plans.
There is no required supersedes: frontmatter in this example. For simple configuration/value claims, Membrick can infer chronological replacement when the documents establish the same semantic domain. Inferred supersession is domain-scoped so unrelated settings such as two different services' timeout values do not suppress one another. Explicit supersession metadata remains authoritative when you provide it.
Current-state retrieval returns the newer decision with semantic_status: current, and membrick context excludes the stale value.
Reproducible terminal demo
The repository includes a reproducible **asciinema PTY recording** that builds the actual membrick binary, sets deterministic file mtimes for a controlled stale-memory scenario, runs the neutral query above, verifies the result, and renders the captured terminal session.
See examples/demo-real-terminal/ and .github/workflows/demo-real-terminal.yml.
---
Why Membrick?
Agent memory is not only a retrieval problem. It is a **state problem**.
A useful memory layer has to answer:
1. **Relevance** — is this about the question?
2. **Recency** — when was this evidence true?
3. **Supersession** — did something newer replace it?
4. **Temporal intent** — is the user asking about now, last Tuesday, or a historical state?
5. **Evidence** — where did the answer come from?
| Ordinary retrieval | Membrick |
|---|---|
| Finds topically similar text | Ranks relevant **and current** evidence |
| Can surface stale decisions as if they are current | Tracks time and supersession |
| Treats relative time as mostly query text | Resolves temporal intent against a reference clock |
| Returns passages | Returns context with source and relationship evidence |
| Treats documents mostly in isolation | Connects facts, entities, links, symbols, ownership, and time |
| Leaves corpus drift hidden | Surfaces contradictions, stale claims, terminology drift, orphan pages, and missing links |
Historical evidence is not deleted. A historical query can still retrieve superseded material as history rather than presenting it as current state.
---
Quickstart
Install directly from GitHub:
Check what is currently indexed in a folder without scanning it:
Check or index a local corpus:
Query it:
Get LLM-ready context:
See the CLI reference and full quickstart
for Docker, HTTP, Python, Rust, and MCP setup.
---
Agent integrations
Membrick provides opt-in integrations for major coding-agent clients.
| Integration | Project memory | Lifecycle capture | MCP tools | Replay / comparison |