Skip to main content

mem_stats

Signature

mem.mem_stats(user_id: str) -> Mapping[str, int]

Returns lightweight counters for the user — useful for diagnostics, dashboards, and verifying that a save actually landed.

note

Always scoped to user_id. Global stats are intentionally not exposed via the public API (privacy + multi-tenant safety).

Parameters

ParámetroTipoRequeridoDescripción
user_idstrOwner scope.

Returns

Mapping[str, int] (dict):

At minimum:

  • observations (int) — total observations stored for user_id.
  • sessions (int) — total sessions (open or closed) for user_id.

The store may add additional integer counters in future versions; treat unknown keys as informational.

Examples

stats = mem.mem_stats(user_id="alice")
print(stats["observations"], stats["sessions"])

See also