OpenMem
Deterministic memory engine for AI agents. Retrieves context via BM25 lexical search, graph-based spreading activation, and human-inspired competition scoring. SQLite-backed, zero dependencies.
No vectors, no embeddings, no LLM in the retrieval loop. The LLM is the consumer, not the retriever.
Why OpenMem?
| Deterministic | Same input, same output. No stochastic embedding drift. |
| Zero dependencies | Pure Python + SQLite. Nothing to install, nothing to break. |
| Human-inspired | Memories decay, get reinforced, compete, and conflict — just like human recall. |
| Token-budgeted | Retrieval respects a token budget so you never blow your context window. |
Install
pip install openmem-engine
Or add to Claude Code for persistent memory across coding sessions:
uvx openmem-engine install
Browse your memories in the Web UI:
openmem-engine ui
Quick example
from openmem import MemoryEngine
engine = MemoryEngine()
m1 = engine.add("We chose SQLite for simplicity", type="decision", entities=["SQLite"])
m2 = engine.add("Postgres has better concurrent writes", type="fact", entities=["Postgres"])
engine.link(m1.id, m2.id, "supports")
results = engine.recall("Why did we pick SQLite?")
for r in results:
print(f"{r.score:.3f} | {r.memory.text}")