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

# configure

> Update SDK configuration. Must be called before initialize().

```python Python theme={null}
sdk.configure(**kwargs)
```

```typescript TypeScript theme={null}
sdk.configure(options?: ConfigureOptions)
```

Adjusts SDK-wide settings such as cache backend, session timeout, retry policy, and logging. `configure()` is synchronous and **must be called before `initialize()`**. Once the SDK is initialized, re-configuration is rejected to prevent inconsistent runtime state. In JavaScript, `initialize()` is optional; `configure()` is locked only after you call it yourself. Any options not supplied keep their existing values.

### Parameters

**storage\_path** `str`

Override the default cache storage path on disk. Python only. JavaScript accepts it and ignores it.

**cache\_backend** `str | None`

Cache backend selection. Pass `"sqlite"` to enable on-disk caching, or `None` to disable it. Anything other than `"sqlite"` or `None` raises `InvalidInputError` (Python 0.5.21 and later; earlier versions treated any value as `"sqlite"`). Python only. JavaScript accepts it and ignores it.

**session\_timeout\_minutes** `int`

Session timeout in minutes. Accepted range is `5`-`1440`. Python only. JavaScript accepts it and ignores it.

**timeouts** `TimeoutConfig | dict`

Per-operation timeout overrides. Pass either a `TimeoutConfig` instance or a plain dict with the fields you want to override.

**retry\_policy** `RetryPolicy | dict | None`

Retry policy for transient failures. Pass a `RetryPolicy`, a dict, or `None` to disable retries entirely.

**log\_level** `str`

Logging verbosity. One of `"DEBUG"`, `"INFO"`, `"WARNING"`, `"ERROR"` or `"CRITICAL"`, in any case. Anything else raises `InvalidInputError` (Python 0.5.21 and later; earlier versions used `WARNING`). Python only. JavaScript accepts it and ignores it.

**logger** `logging.Logger`

Custom logger instance to replace the SDK's internal logger.

**agent\_model** `str`

The model your agent runs on, for example `"gpt-4o"`. Sent with every turn you record (`record_message`, `send_message`), and Synap uses its context window to decide when to compact; see [`record_message`](https://docs.maximem.ai/sdk-reference/conversation/record-message) for when that happens. A name is enough for common models. Without it, Synap assumes a 128K window. The per-call `model` on `record_message` and `send_message` overrides it. Python 0.5.11 and later. JavaScript and TypeScript 0.5.9 and later.

**agent\_context\_window** `int`

Your agent model's context window, in tokens. Only needed for a model Synap does not know by name. It takes precedence over the model name. The per-call `context_window` overrides it. Python 0.5.11 and later. JavaScript and TypeScript 0.5.9 and later.

**history\_search\_model** `str | None` (default: auto)

The local model the SDK uses to search earlier turns after a compaction, and to match a fetch to context it already holds, by meaning rather than only by words. `"auto"` (default) uses the SDK's multilingual model (`paraphrase-multilingual-MiniLM-L12-v2`) when its runtime is installed (see [Installation](https://docs.maximem.ai/setup/installation.md#local-search-model)). It is downloaded once, about 135 MB, into `~/.synap/models`, and loaded in the background. `None` (`null` in JavaScript) keeps keyword matching only; so does `SYNAP_SDK_LOCAL_MODEL=off`. Python 0.5.11 and later. JavaScript and TypeScript: on the constructor from 0.5.9, on `configure()` from 0.5.19.

### Returns

Returns `None`.

### Example

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

sdk = MaximemSynapSDK()  # reads SYNAP_API_KEY from your environment

# Configure BEFORE initialize().
sdk.configure(
    cache_backend="sqlite",
    session_timeout_minutes=60,
    log_level="INFO",
)

await sdk.initialize()
```

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

const sdk = new SynapClient(); // reads SYNAP_API_KEY from your environment

// Configure BEFORE initialize().
sdk.configure({ agent_model: 'gpt-4o', retry_policy: { maxAttempts: 2 } });

await sdk.initialize();
```

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

const sdk = new SynapClient(); // reads SYNAP_API_KEY from your environment

// Configure BEFORE initialize().
sdk.configure({ agent_model: 'gpt-4o', retry_policy: { maxAttempts: 2 } });

await sdk.initialize();
```

### Raises

* `InvalidInputError`: when `configure()` is called after `initialize()`, or when a value is not accepted (Python 0.5.21 and later; earlier Python raised pydantic's `ValidationError` for an out-of-range value).
* An unknown setting is logged as a warning and ignored (Python 0.5.21 and later).

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

### See also

* [initialize](https://docs.maximem.ai/sdk-reference/lifecycle/initialize.md): the next step after `configure()`.
* [shutdown](https://docs.maximem.ai/sdk-reference/lifecycle/shutdown.md): graceful teardown on exit.


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