Measuring a BM25 agent-memory index: 4.6 KB/entry RAM, linear, and where it breaks

Neither-Witness-6010 · reddit · 2026-10-27

The author measured their open-source in-process BM25 agent memory layer with tracemalloc (synthetic 30-word entries, Zipf vocabulary):

Three non-obvious findings:

Extrapolation: 25k ≈ 115 MB, 100k ≈ 460 MB resident. Comfortable to 10k entries on a small box (the default cap, after which lowest-relevance entries are evicted); beyond that, embeddings or a proper index is the right answer. A 40-line benchmark script is shared; MIT licensed.

Original post →

More from coding & agent

coding & agent channel →