R501 · Agent architecture › Memory and context

Memory without a model call: parsers, git and revocation

Read the original

agent-memory, knowledge-graphs, determinism, retrieval, open-source, vendor-claims

mnem — "Git for AI agent knowledge": a versioned knowledge layer for agents, Apache-2.0, Rust, at github.com/Uranid/mnem. One binary; runs as a CLI, an HTTP server, an MCP server, a Python library, and in a browser via WebAssembly. Published to crates.io, PyPI and npm as mnem-cli.

The premise

Most agent memory graphs are built by asking a model to extract entities and relations from each document. That costs a model call per document and, more awkwardly, two runs over the same input can produce different graphs. A memory layer that is not reproducible cannot be reviewed, diffed, or trusted to be the same for two teammates.

mnem builds the graph with parsers instead. File types are detected and chunked structurally: Markdown at its headings, source code at function and class boundaries across many languages, PDFs by sliding window. No model call at ingest, so the same input always produces the same graph, and re-ingesting an unchanged file is a no-op.

The cost of that choice is real and should be stated: entities extracted by a parser are shallower than entities extracted by a model. You get the document's own structure, not an interpretation of it. Whether that is a loss depends on whether you wanted the structure or the interpretation.

Three design decisions worth copying

1. The memory lives in the repository. Skills, decisions and conventions are nodes with typed edges in a graph held in a .mnem/ directory, committed alongside the code. Every teammate's agent starts from the same baseline, and any write can be branched, diffed, merged or rolled back the way source is. This only works because ingest is deterministic — a non-reproducible graph produces a diff on every run and the version control becomes noise.

2. Forgetting is first-class. Revoke a fact and every retrieval path filters it out automatically, with the audit trail preserved. That is the right shape: a deletion loses the record of what was believed and when, while a revocation keeps it and stops it being retrieved. Any memory system that an organisation has to answer for needs this distinction, and most do not have it.

3. Retrieval reports its own spend. A query fuses vector, keyword and graph traversal in a single pass and returns how many tokens it spent and what it dropped at the budget — nothing is silently truncated. Optional multi-hop expansion stitches answers across linked documents. A retrieval layer that tells you what it discarded is debuggable; one that silently truncates teaches you nothing when an answer is missing its source.

The embedder is bundled and runs offline (a small ONNX sentence model by default), swappable in one line of configuration. No server, no external database, no required network.

The benchmark claims, and how to read them

The project claims best-or-tied recall on every public benchmark it tested, and a head-to-head against two named memory systems on six public datasets: ahead on five, tied on one. The headline numbers are published as images rather than text, so they are not quotable, but the methodology is written out, and it does not support a straight comparison — which the project says itself, in footnotes, rather than burying:

What is controlled is worth noting: the same embedder bytes for every system, dense-only retrieval with no sparse lane and no model-based reranking, stated sample counts per dataset, a reproduction script shipped in the repository and raw artefacts committed.

So the honest reading is: a self-run comparison with its caveats printed. That is better practice than most vendor benchmarks and still not evidence that the system wins. Nobody independent has reproduced it.

What to take from it

If you are building a memory layer, the transferable claims are not the scores. They are:

Connections

See R501 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.