MemorySync
Getting Started

AgentOps Memory Observability

Memory operations as first-class spans in AgentOps: the first SDK-level tracing instrumentor shipped by any memory vendor. One line after agentops.init() and every add, recall, query, and forget appears in your AgentOps traces — with memory content excluded by default. Install opentelemetry-instrumentation-memorysync from PyPI.

One line of setup

pip install opentelemetry-instrumentation-memorysync agentops

agentops.init() registers AgentOps as the global OpenTelemetry tracer provider, and this package emits standard OTel spans through it — so the pairing needs no adapter, no plugin, and no AgentOps-specific code. The same instrumentor works unchanged with Respan, Traceloop, Langfuse, or a plain OTLP collector.

OperationSpanKey attributes
add / bulk_add / summarizememorysync.addmemory_id, status (stored/skipped), skip reason
query / retrieve / recall / search_routedmemorysync.queryk, results_count, score min/max/avg, context_chars, server latency
add_turnmemorysync.add_turntenant/user/session ids, already_exists idempotency signal
forgetmemorysync.forgetselector (ids/filters), ids_count, deleted_count, dry_run
get / update / history / feedback / list_memoriesmemorysync.getmemory_id, updated field NAMES (never values), result counts

Privacy: content is never recorded by default

Memory content is customer data. By default the spans carry counts, identifiers, scores, and latencies — never memory text, query text, or recalled context. Opt in explicitly with instrument_memorysync(capture_content=True) or MEMORYSYNC_OTEL_CAPTURE_CONTENT=true; even then input is truncated to 500 characters and at most 5 result texts of 200 characters each are recorded.

  • Instrumentation can never break the app. Attribute extraction is fully guarded; results and exceptions pass through untouched; spans always end.
  • Full sync/async parity — both MemorySyncClient and AsyncMemorySyncClient, all fourteen operations (the incumbent wrapper skips history on cloud clients).
  • Errors are first-class: failed calls produce ERROR spans with error.type and the HTTP status, and the original exception is re-raised unchanged.
  • Idempotent lifecycle: double-instrument is a no-op; uninstrument_memorysync() restores the original methods.
  • A memorysync.client.operation.duration histogram is recorded per call for latency dashboards.

Supported versions

SurfaceRequiresVerified on
opentelemetry-instrumentation-memorysync 1.0.0Python 3.9+; opentelemetry-api 1.20+; memorysync 1.8+21 CI checks: the REAL memorysync SDK over production response shapes with the OTel in-memory exporter — sync/async parity, privacy default, byte-identical pass-through, error spans, lifecycle, the late-binding provider seam — plus agentops installed at latest with seam drift alarms pinning the global-tracer-provider contract

Where to go next

Was this page helpful?