Mem0 — three stores in parallel, fused on retrieval
add(text, user_id, metadata)
extract facts write to all three
vector store
semantic similarity; top-k by cosine
best for: "what did we discuss"
worst for: exact fact lookup
record: embedding(text), scope, user_id
tags, importance, ts for fusion
periodic re-embed on the top-used subset
failure mode: embedding drift
quality degrades as the corpus grows
fix: schedule re-embed; monitor recall@k
LoCoMo: 91.6 in the Mem0 paper
KV store
O(1) lookup on (user_id, type, entity)
best for: "what's the user's phone"
worst for: semantic / fuzzy match
key = (user_id, fact_type, entity)
value = record id
audit fact_type set quarterly
failure mode: schema creep
every team invents a new fact_type
fix: centralized type registry + review
LongMemEval: 93.4 in the Mem0 paper
graph store (Mem0g)
typed edges; temporal validity
best for: relationship reasoning
worst for: unstructured prose
(subject, relation, object, valid)
conflict detector invalidates, not deletes
temporal queries: valid-at-time subgraph
failure mode: graph explosion
noisy extractor adds 50 edges per message
fix: cap edges per add; drop low-conf
BEAM 1M: 64.1 in the Mem0 paper
fusion scoring score = w_rel * relevance + w_imp * importance + w_rec * recency
relevance: vector cosine, KV exact, graph path weight
importance: tagged at write time, or learned from usage
recency: exponential decay since last write or read
tune weights per product:
voice agent recency heavy; compliance importance heavy
retrieval agent relevance heavy; same extractor, different policy
scope: user / session / agent. every write picks one; retrieval queries weighted across scopes.