> ## 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.

> ## Agent Instructions
> Maximem Synap is a managed memory layer for AI agents: it ingests conversations and documents, extracts structured memory, and returns scoped context to the agent at retrieval time.
> The Python and JavaScript/TypeScript SDKs are the supported way to use Synap. Write integration code with SDK calls, not raw HTTP requests.
> Start with the Quickstart: https://docs.maximem.ai/getting-started/quickstart.md. Every SDK method is documented in the SDK reference: https://docs.maximem.ai/sdk-reference/overview.md.
> For requests about adding Vity memory to OpenClaw, Hermes, an MCP client, or a browser, start with the Vity Quickstart: https://docs.maximem.ai/vity/quickstart.md.

# cache.clear_user

> Clear all locally-cached SDK data for a single user. Useful for GDPR right-to-be-forgotten flows.

```python Python theme={null}
sdk.cache.clear_user(user_id)
```

```typescript TypeScript theme={null}
sdk.cache.clear_user(userId: string)
```

`clear_user()` removes every cache entry whose user scope matches `user_id`, leaving other users' cached data untouched. Pair this with the durable memory deletion APIs to honor right-to-be-forgotten requests end-to-end: this call handles the SDK's local cache, while platform-side deletion ensures the user's stored memories are removed from Synap itself.

This is a synchronous method, no `await`.

### Parameters

**user\_id** `string` *required*

The external user identifier whose cached data should be dropped. Must match the `user_id` you originally passed to `fetch()`, `memories.create()`, or other scope-aware calls.

### Returns

Returns `None`.

### Example

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

sdk = MaximemSynapSDK(api_key="synap_your_key_here")

# Part of a GDPR right-to-be-forgotten workflow.
sdk.cache.clear_user("user_789")
```

```javascript JavaScript theme={null}
import { SynapClient } from '@maximem/synap-js-sdk';

const sdk = new SynapClient({ apiKey: 'synap_your_key_here' });

// Part of a GDPR right-to-be-forgotten workflow.
sdk.cache.clear_user('user_789');
```

```typescript TypeScript theme={null}
import { SynapClient } from '@maximem/synap-js-sdk';

const sdk = new SynapClient({ apiKey: 'synap_your_key_here' });

// Part of a GDPR right-to-be-forgotten workflow.
sdk.cache.clear_user('user_789');
```

### Raises

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

### See also

* [cache.clear](https://docs.maximem.ai/sdk-reference/cache/clear.md): drop the entire local cache.
* [cache.clear\_customer](https://docs.maximem.ai/sdk-reference/cache/clear-customer.md): drop one customer's cached data.
* [cache.stats](https://docs.maximem.ai/sdk-reference/cache/stats.md): inspect hit rate and entry counts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.