Skip to main content

🧠 Mneme

A cue-indexed tag memory for conversational agents — no embeddings, no LLM in the memory path.

PyPI Python License: MIT

Most agent memories embed every turn and distill it with a write-time LLM, then search by vector similarity — expensive and opaque. Mneme instead does what human recall does: index by cues, reinstate by cue-match, and spread activation along both shared meaning and the thread of conversation — with a plain inverted index over deterministic tags. No vector database, no language model, no embeddings.

At zero memory cost, under an identical controlled comparison, on each benchmark's primary metric Mneme is on par with a strong dense retriever (LoCoMo F1 52.4±0.1 vs 52.9; LongMemEval acc 62.8 vs 62.2) and beats the cheaper baselines (mem0 and BM25 on LoCoMo, BM25 on LongMemEval). Same answerer, judge, prompt, and budget; only the memory differs.


✨ Why Mneme

  • Zero cost. No write-time LLM calls, no embeddings, sub-millisecond recall, storage is plain JSON files.
  • Competitive quality. Matches or beats embedding + LLM memory on standard benchmarks (see below).
  • Interpretable. Retrieval is explicit cue overlap ranked by IDF — no opaque similarity threshold to tune.
  • Human-like forgetting. What has no distinctive cue, or whose cues never recur, is simply never surfaced — forgetting as retrieval failure, for free.
  • Local & sovereign. Your memory is a folder of files you can read, edit, or delete. English by default; Chinese optional.

📊 Benchmarks (controlled: same answerer/judge/prompt/budget, only the memory differs)

LoCoMo — low-distractor dialogue (F1 / accuracy):

method cost F1 acc
mem0 (LLM extract + vectors) LLM+emb 40.4 57.3
BM25 (raw turns) zero 45.8 57.0
Mneme (hybrid edges) zero 52.4 67.5
dense retriever (bge-large) embeddings 52.9 67.7

LongMemEval — high-distractor, ~50 sessions per question (accuracy):

method cost acc
BM25 (raw turns) zero 61.2
dense retriever (bge-large) embeddings 62.2
Mneme (hybrid) zero 62.8

Zero-cost Mneme is on par with dense retrieval on both benchmarks, at no embedding or write-time cost, and it is reader-agnostic (near-identical with two different answerer LLMs) and interpretable. Which edge type helps is regime-sensitive: discourse edges clearly help clean dialogue (~5 points on LoCoMo), while on high-distractor histories the edge configurations differ only within run-to-run noise.

🚀 Install

pip install mnemekit
python -m spacy download en_core_web_sm     # English model (required)

pip install "mnemekit[zh]"                   # optional: Chinese (jieba)

New in 0.3

Mneme now compiles typed propositions alongside its original tags in the same deterministic spaCy pass. The stored representation includes provenance-linked memory atoms, event collections, participant roles, salience, repetition, and access history. These structures support ontology recall and inspectable evidence cards while keeping the memory path free of embeddings and language models. The existing Memory.recall interface and old stored turns remain compatible.

⚡ Quick start

from mneme import Memory

m = Memory(root="~/.mneme")

m.remember("My dog Lucky is a golden retriever", "Cute! How old is Lucky?",
           session_id="chat-42", round_id=1)

m.recall("what breed is my dog")     # -> [Turn(...), ...]

Turns are stored one file per round at {root}/{session_id}/{YYYY-MM-DD}/{round_id}.json, so any session is trivial to inspect, export, or delete.

🔍 How it works

INGEST (no LLM, no embedding)
  turn ──▶ tag extraction (spaCy NER + lemmas / jieba) ──▶ inverted index  (tag → turns)
                                                           + event tag inheritance

RECALL (per query) — spread over an ephemeral heterogeneous graph, then discard it
  query ─▶ ① lexical: IDF cue reinstatement ─seeds─┬─▶ ② associative edge (shared tag, 1 hop)
                                                   └─▶ ③ discourse edge (adjacent turn in event)
                                                                        │
                                                          recalled context ─▶ your reader
  1. Cue index. Each turn is tagged deterministically; tags form an inverted index (a sparse cue index, à la hippocampal indexing). Keyword-free follow-ups inherit their event's tags, so they stay recallable.
  2. Reinstatement, then two kinds of edge. A query reinstates directly-cued turns lexically, then spreads activation over an ephemeral graph with two edge types: associative edges (shared discriminative cue → one hop) reach the associative tail a direct cue can't; discourse edges (adjacent turns in the same event) pull in the local conversational context around a hit. Neither is materialized — both are read straight off the index and event structure, used for the one query, and discarded.

🀄 Chinese & custom dictionaries

m = Memory(root="~/.mneme", userdict="my_terms.txt")   # jieba user dictionary
m.remember("我养了只金毛狗,叫 Lucky", "可爱!", session_id="u1", round_id=1)

Chinese is segmented by jieba; a custom dictionary keeps vertical-domain terms intact.

📄 Paper & reproduction

The write-up (method, cognitive grounding, controlled comparison, ablations) is in paper/; the evaluation harness (LoCoMo / LongMemEval / mem0) is in eval/. The frozen reproduction version is on the paper-repro branch.

📌 Citation

@misc{mneme2026,
  title  = {Do Conversational Agents Need Vectors? A Zero-LLM, Zero-Embedding Tag Memory},
  author = {Hao, Shaochun},
  year   = {2026},
  note   = {https://github.com/FTP2026/Mneme}
}

License

MIT

Metadata

Release files for mnemekit 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mnemekit 0.3.0
File Size Uploaded Provenance
mnemekit-0.3.0.tar.gz 28.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mnemekit 0.3.0
File Interpreter ABI Platform
mnemekit-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.7 kB

Release files / mnemekit-0.3.0.tar.gz

Download URL mnemekit-0.3.0.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5705d1cea8ef020c0f257824ecb499e9710a118ba4cb1be48685d46100ea686c
BLAKE2b-256 checksum
How to use checksums
3c4337c19a6ae9201d71c4d63c5face25a78166b0c278b58416df17f650d9680
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / mnemekit-0.3.0-py3-none-any.whl

Download URL mnemekit-0.3.0-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b3cb9b169f9d88629dec914b3f27c5d31915c8a50cfb8352aeeb9a9a21aa921
BLAKE2b-256 checksum
How to use checksums
8c3d977da588cca6a1d986792085592e40159d1a4bf4dc39b658261bb3fe213e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for mnemekit 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page