Skip to main content

> open source · MIT licensed

Your agent forgets
everything. Fix that.

openmem is a deterministic memory engine for AI agents. BM25 search, graph activation, competition scoring. No vectors. No embeddings. No cloud. Just a SQLite file.

$pip install openmem-engine
agent.py
from openmem import MemoryEngine

engine = MemoryEngine("memories.db")

# Store
m1 = engine.add("JWT tokens expire after 24h",
type="decision", entities=["JWT"])
m2 = engine.add("Auth uses refresh tokens",
type="fact", entities=["auth"])
engine.link(m1.id, m2.id, "supports")

# Recall
results = engine.recall("how does auth work?")
for r in results:
print(f"{r.score:.3f} {r.memory.text}")
terminal
# One command to install
uvx openmem-engine install

# Claude Code now has persistent memory.
# 7 MCP tools available across sessions:
# memory_store memory_recall
# memory_link memory_reinforce
# memory_supersede
# memory_contradict
# memory_stats

# Browse your memories
openmem-engine ui

# Memories persist in ~/.openmem/memories.db
terminal
# Coming soon — Cursor MCP integration

uvx openmem-engine install --cursor

# Persistent memory across Cursor sessions.
# Same engine, same database, same recall.

# All 7 memory tools work the same way:
# store, recall, link, reinforce,
# supersede, contradict, stats

# Browse your memories
openmem-engine ui

terminal
# Coming soon — Codex integration

uvx openmem-engine install --codex

# Persistent memory across Codex sessions.
# Same engine, same database, same recall.

# All 7 memory tools work the same way:
# store, recall, link, reinforce,
# supersede, contradict, stats

# Browse your memories
openmem-engine ui

>

How we compare

Other memory systems rely on embeddings and hosted infrastructure.
We think agent memory should be deterministic, local, and inspectable.

> openmemBM25 + graph
Mem0Vector, managed cloud
ZepKG + vector
LettaAgent runtime
File-basedCLAUDE.md, etc.
Deterministic retrieval
Graph relationships
~
Memory decay & reinforcement
Conflict resolution
~
Token-budgeted output
No embedding model needed
Local-first, no cloud
~
~
Inspectable scoring
N/A
Zero external dependencies
Open source
~
~
>

Six-stage retrieval

Every recall() runs a deterministic pipeline. No magic. No black boxes.

input
recall("how does auth work?")
01BM25FTS5 lexical match against text, gist, entities
02SeedNormalize BM25 scores to [0, 1]
03SpreadTraverse graph edges up to 2 hops with decay
04CompeteWeighted: activation + recency + strength + confidence
05ResolveDetect contradictions, demote weaker memory
06PackSort by score, fit within token budget
output
0.92 "Auth uses refresh tokens"0.87 "JWT tokens expire after 24h"0.41 "Session store uses Redis"
>

Built for agents

Everything your agent needs to remember, recall, and reason over time.

Deterministic

Same query, same results. No stochastic embedding drift. Every score is inspectable.

r.components
# {activation: 0.72, recency: 0.95,
#  strength: 0.80, confidence: 0.90}

Zero dependencies

Pure Python + SQLite. No vector DB, no embedding model, no external services.

engine = MemoryEngine()       # in-memory
engine = MemoryEngine("p.db") # persistent

Biological recall

Memories decay, get reinforced, compete for activation, and resolve conflicts.

engine.reinforce(m.id)     # boost
engine.supersede(old, new)  # outdated
engine.decay_all()          # forget

Token-budgeted

Retrieval respects a token budget. Never blow your context window.

engine.recall(
  query, top_k=10, token_budget=2000
) # packs by score until budget hit

Graph-linked

Spreading activation pulls in connected context that BM25 alone would miss.

engine.link(
  m1.id, m2.id, "supports", weight=0.8
) # m2 activates when m1 is recalled

Web UI

Browse, search, and inspect your memory store. One command.

openmem-engine ui
# Opens http://localhost:3333
MCP Integration

Drop into Claude Code

One command installs 7 MCP tools that give Claude persistent memory across every session. Your agent remembers what it learned yesterday.

storesave a memory
recallsearch & retrieve
linkconnect memories
reinforceboost strength
supersedereplace outdated
contradictflag conflicts
statsstore overview
Read the docs →
terminal
$ uvx openmem-engine install

Adding OpenMem to Claude Code...
Done! OpenMem is now available.

$ openmem-engine status
Memories: 142
Active: 130
Edges: 87
Avg strength: 0.84

Stop losing context.

Give your agent a memory that decays, reinforces, and competes — just like yours.