> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# cache.stats

> Return a snapshot of local cache state: entry counts, storage size, and per-backend breakdown.

```python theme={null}
sdk.cache.stats()
```

`stats()` returns a dict describing the current state of the SDK's local cache: how many entries it holds across all backends, total storage footprint, and a per-backend breakdown. Use it to verify your cache configuration is taking effect, to monitor cache size in production, or to debug stale-data issues during development.

This is a synchronous method, no `await`. If the cache manager is not initialized (e.g., caching disabled in `SDKConfig`), the returned dict is `{"enabled": False}`.

### Parameters

This method takes no parameters.

### Returns

A `dict[str, Any]` describing cache state.

<ResponseField name="enabled" type="bool">
  Whether the local cache is active. `False` indicates no other fields will be present.
</ResponseField>

<ResponseField name="client_id" type="str">
  The client identifier the cache is scoped to.
</ResponseField>

<ResponseField name="base_path" type="str">
  Filesystem path where cache backends store their data.
</ResponseField>

<ResponseField name="total_entries" type="int">
  Total number of entries summed across all backends.
</ResponseField>

<ResponseField name="total_bytes" type="int">
  Total storage footprint in bytes, summed across all backends.
</ResponseField>

<ResponseField name="backends" type="List[Dict[str, Any]]">
  Per-backend stats. Each entry has a `key` (backend identifier) plus that backend's own metrics (`entry_count`, `total_bytes`, and any backend-specific fields).
</ResponseField>

### Example

```python theme={null}
from maximem_synap import MaximemSynapSDK

sdk = MaximemSynapSDK(api_key="synap_your_key_here")
await sdk.initialize()

# ... after some fetch() activity ...
stats = sdk.cache.stats()
if stats["enabled"]:
    print(f"Entries: {stats['total_entries']}")
    print(f"Size:    {stats['total_bytes'] / 1024:.1f} KB")
    for backend in stats["backends"]:
        print(f"  {backend['key']}: {backend.get('entry_count', 0)} entries")
else:
    print("Cache disabled")
```

### Raises

This method does not raise SDK errors. See [Error Codes](/sdk-reference/errors) for the full SDK exception hierarchy.

### See also

* [cache.clear](/sdk-reference/cache/clear): drop the entire local cache.
* [cache.clear\_user](/sdk-reference/cache/clear-user): drop one user's cached data (GDPR).
* [cache.clear\_customer](/sdk-reference/cache/clear-customer): drop one customer's cached data.
