> For the complete documentation index, see [llms.txt](https://docs.envector.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.envector.io/1.4.x/sdk-user-guide/initialize/index-configuration/2.-presets.md).

# 2. 🚀 Presets

These pre-defined settings and modes are used to configure the cryptographic operations and balance the trade-offs between security, accuracy, and search performance.

* `query_encryption` (str, default: `plain`) Determines whether the client sends search queries to the server in an encrypted state. This setting balances security and performance based on the chosen mode:
  * `plain` sends queries in plaintext, prioritizing performance over security. This mode can be used in scenarios where the encryption of query data is deemed unnecessary, such as when handling publicly accessible or low-sensitivity information.
  * `cipher` ensures that queries are encrypted during transmission, providing robust protection for sensitive data but may introduce additional latency. Currently, only `plain` is supported for queries.
* `index_encryption` (str, default: `cipher`) Determines if the vectors in the index are sent to the server in an encrypted format.
  * This value must be `cipher`. The system is fundamentally designed to always work with encrypted data on the server.

    Similar to query encryption, the SDK automatically handles the encryption of your data vectors. You can provide plaintext vectors when adding data to the index, and the client will securely encrypt them before they are sent to the server.
* `eval_mode` (str, default: `'mm32'`) Defines the FHE computation method used on the server to evaluate queries.

  | Mode    | Required preset | Notes                                  |
  | ------- | --------------- | -------------------------------------- |
  | `mm`    | `ip1` (forced)  | MM-family path.                        |
  | `mms`   | `ip1` (forced)  | memory-efficient MM.                   |
  | `mm32`  | `ip2` (forced)  | memory-efficient MM. **Default mode.** |
  | `mms32` | `ip2` (forced)  | memory-efficient MM.                   |

  * **Setting `eval_mode` automatically pins `preset`** for MM-family modes; you cannot override it. If you set `preset` first and then assign an incompatible `eval_mode`, the new `eval_mode` overwrites `preset`.
  * **Note:** eval\_mode, `mm32` and `mms32` are experimental modes and may have compatibility issues in the future. For production-ready environments, we recommend using the `mm` mode.
* `preset` (str, default: `'ip2'`) A pre-configured set of parameters for the underlying Fully Homomorphic Encryption (FHE) scheme.
  * Supported values: `'ip1'`, `'ip2'`.
  * The `preset` is **strictly coupled with `eval_mode`** for MM-family modes — see the table above. Setting an incompatible pair (e.g., `eval_mode='mm32'` with `preset='ip1`) raises a `ValueError`.
  * **Note:** preset, `ip2` is experimental mode and may have compatibility issues in the future. For production-ready environments, we recommend using the `ip1` mode.
* `index_params` (dict, default: `{"index_type": "flat"}`) Specifies the algorithm and structure used for the vector search index.
  * Example 1: `{"index_type": "flat"}` — Performs an exhaustive search over all vectors. Guarantees 100% recall (perfect accuracy) but may be slower on very large datasets compared to approximate search methods.
  * Example 2: `{"index_type": "ivf_flat", "nlist": 4000, "centroids": <2d-matrix>, "default_nprobe": 1}` — Uses an inverted file (IVF) index for faster approximate searches on large datasets. `nlist` controls the number of clusters; `default_nprobe` controls how many clusters are scanned per query.
    * If `centroids` is omitted, the client initializes random centroids and sends them to the server.
    * `centroids` accepted types: 2D NumPy `ndarray` with shape `(nlist, dim)`, `list[np.ndarray]`, or `list[list[float]]`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.envector.io/1.4.x/sdk-user-guide/initialize/index-configuration/2.-presets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
