Mneme
A local, cue-indexed tag memory for conversational agents — no embeddings, no LLM in the memory path.
Human recall is cue-driven: a partial cue brings back a cluster of related memories that the mind wires into a momentary web and then lets dissolve. Mneme models this. Each turn is tagged deterministically; tags form an inverted index (the cue index); a query reinstates directly-cued turns lexically and then builds an ephemeral association graph over them—spreading activation to related turns—which is discarded once the query is answered. No vector DB, no graph DB, no language model.
Install
pip install mnemekit # English (default)
python -m spacy download en_core_web_sm # required language model
pip install "mnemekit[zh]" # + Chinese (adds jieba)
pip install "mnemekit[eval]" # + benchmark/baseline deps
import mneme regardless of the distribution name.
Usage
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, ...]
- Structured ids & storage.
session_id(default"default-session") +round_idform each turn's id; turns are stored one file per round under{root}/{session_id}/{YYYY-MM-DD}/{round_id}.json, so a session is easy to inspect, export, or delete. - Chinese. With
[zh]installed, Chinese is segmented byjieba; pass a custom dictionary for vertical domains:Memory(userdict="terms.txt"). - Optional LLM enrichment. An
enrich(text, source, tags) -> tagscallback can add semantic tags; off by default (the memory path stays LLM-free).
Design
schema.py — Tag / Turn / Event records
extract.py — TagExtractor: spaCy NER+lemmas (en) / jieba.posseg (zh, +userdict)
thread.py — Threader: event segmentation + tag inheritance for keyword-free follow-ups
store.py — Store: per-session/day turn files + inverted.json + events.json
recall.py — Recaller: lexical IDF reinstatement + ephemeral association graph
memory.py — Memory: remember() / recall()
Two-stage recall: (1) lexical, IDF-weighted lookup over the inverted index; (2) a per-query association graph seeded by the lexical hits that spreads activation through shared entities and is then discarded. Because information without distinctive cues is never surfaced, forgetting is implicit and cue-dependent.
Evaluation & paper
See paper/ for the write-up and eval/ for the LoCoMo / LongMemEval harness and the controlled mem0 comparison. The frozen reproduction version is on the paper-repro branch.
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 mnemekit-0.1.0.tar.gz.
File metadata
- Download URL: mnemekit-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04bea0f7dc14f915da99462d35f6698d5bbc16f465c9a2ea5951ee465256f1e2
|
|
| MD5 |
31f2893521e70981808782bccf0f2978
|
|
| BLAKE2b-256 |
4a2a33e44b1674561dc45a6db5fabab46466bb8d762287ec5e343c06d0f6e502
|
File details
Details for the file mnemekit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mnemekit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cda872acde07244e8ae1b89393da953ccdcdb9ebea618af3abe4ffa812cd5f35
|
|
| MD5 |
e1f78cfbff43f2b9fc0d4498480153c2
|
|
| BLAKE2b-256 |
7d8d92f8711f9814a3c4efdc25dbfe2dd468ec96458345d97e7e6d3e544bab41
|