This library allows tracing Mem0 memory operations (add, search, update, delete) using OpenTelemetry, emitting spans with GenAI memory semantic convention attributes.
pip install opentelemetry-instrumentation-mem0
from opentelemetry.instrumentation.mem0 import Mem0Instrumentor
from mem0 import Memory
Mem0Instrumentor().instrument()
m = Memory()
m.add("I prefer dark mode", user_id="alice")
results = m.search("preferences", user_id="alice")