█▀▀▄ ▄▀▀▄ █▀▄▀▄ ▄▀▀▄ █▀▄▀▄ █ █ █ █ █ █ █ █▀▀▀ █ █ █ ▀ ▀ ▀▀ ▀ ▀ ▀▀▀ ▀ ▀
Not Only Memory
Memory for agents, with no LLM in the loop¶
NoMem stores every message verbatim, indexes it with deterministic rules, and builds a context that is guaranteed to fit your token budget. Writes cost nothing, and you can see why every line is in the prompt.
0model calls per write
<1 msto store a message
92.1%LongMemEval session recall@5
0budget overruns in 500 random trials
Thirty seconds of NoMem¶
from nomem import NoMem
mem = NoMem(max_tokens=300, user_id="saswat", db="memory.db")
mem.add_user("I live in Pune and work as a backend engineer.") # 1 Mar
mem.add_user("My flight to Tokyo leaves at 9am on Friday.") # 2 Mar
# ... sixty turns about recipes and weekend plans ...
mem.add_user("I moved to Bangalore last week!") # 20 Mar
mem.add_user("Actually my flight got moved to 11am.") # 25 Mar
ctx = mem.build_context(query="when is my flight, and where do I live now?")
print(ctx.text) # 290 of 300 tokens: it always fits
print(ctx.explain()) # why every line is there, and what was dropped
system: Known facts:
- location: Bangalore (since 20 Mar 2026; before that Pune, said 1 Mar 2026)
system: Relevant earlier context:
- [1 Mar 2026] user: I live in Pune and work as a backend engineer. [CONFLICT: changed on 20 Mar 2026 (location: Pune -> Bangalore); user said "I moved to Bangalore last week!"]
- [2 Mar 2026] user: My flight to Tokyo leaves at 9am on Friday. [CONFLICT: changed on 25 Mar 2026 (flight: 09:00 -> 11:00); user said "Actually my flight got moved to 11am."]
...
user: I moved to Bangalore last week!
user: Actually my flight got moved to 11am.
Nothing above came from a language model. The facts card, the dates and the conflict marker are rules over what the user actually said.
Why NoMem¶
-
No LLM, no bill
Mem0, Zep and Letta call a model on every write to extract and merge memories. NoMem replaces those jobs with rules, hashes and ranking, so a write takes well under a millisecond and costs nothing.
-
Verbatim, never paraphrased
Every memory is something that was actually said, with its date. Nothing is lost to a bad extraction, and nothing is invented.
-
A hard token budget
build_context()is guaranteed to fitmax_tokens. Core persona, facts, retrieved memories and recent turns share one budget, in priority order. -
Every decision logged
explain()shows each message kept, dropped, retrieved or summarised, with the reason and its token cost. No black box. -
Contradictions surfaced, not hidden
When a fact changes, both versions are kept and shown with their dates, so your agent's own model decides what is true now.
-
Local-first
One SQLite file, zero required dependencies, runs offline. Optional 8M-parameter embeddings on CPU if you want a vector ranker.
Use it your way¶
How it compares¶
NoMem against Mem0's own search engine, on the same questions with the same scoring and no LLM on either side. Full method and numbers: NoMem vs Mem0.
| Same questions, no LLM on either side | NoMem | Mem0 (OSS 2.2.1, infer=False) |
|---|---|---|
| LoCoMo search recall@5 (potion-base-8M) | 58.6% | 55.9% |
| LoCoMo search recall@5 (bge-small) | 59.5% | 59.1% |
| LongMemEval session recall@5 | 92.8% | 92.2% |
| LongMemEval turn recall@5 | 57.1% | 69.0% |
| Write latency, p50 | 0.6 ms | 10 ms |
| Search latency, p50 | 6 ms | 72 ms |
| LLM calls per write as normally used | 0 | 1 (Mem0's default infer=True) |