4. IndexConfig() Reference 🧩
IndexConfig is the SDK object that holds all index-related settings in one place: identity (name, dimension), key management, and crypto/search presets. You can build it directly, or let the helpers (ev.init_index_config(...) + ev.create_index(...)) construct and use it for you.
When to use
You want a single, explicit object to pass around across functions or tests.
You need to clone/adjust configuration safely (e.g., same key_path, different
index_nameordim).
Constructor (most-used fields)
Identity
index_name(str): Unique name of the indexdim(int): Vector dimension (max 4096)
Key management
key_path(str): Base directory for key setskey_id(str): ID for a key set underkey_pathmetadata_encryption(bool): Encrypt metadata at rest/in transitseal_mode("none" | "aes"): Seal secret/materialized keys at restseal_kek_path(str): File path to KEK whenseal_mode='aes'
Presets and modes
preset("ip"): Crypto preset (inner-product optimized)eval_mode("rmp" | "mm"): Evaluation mode on server. Usermpfor both plaintext and encrypted queries.mmis advanced and currently does not support encrypted queries (query_encryption="cipher").index_type("flat"): Index structurequery_encryption("plain" | "cipher"): Encrypt queriesindex_encryption("cipher"): Always encrypted storage
See details in:
Index Name and Dimension:
index_name,dim
🔑 Key Management:
key_path,key_id,metadata_encryption,seal_mode,seal_kek_path
🚀 Presets:
preset,eval_mode,index_type,query_encryption,index_encryption
Example: Build and create via class
from pyenvector.index import IndexConfig, Index
from pyenvector.api import Indexer
# Prepare config explicitly
cfg = IndexConfig(
index_name="products",
dim=768,
key_path="./keys",
key_id="my-key",
metadata_encryption=True,
seal_mode="none",
preset="ip",
eval_mode="rmp",
index_type="flat",
query_encryption="cipher",
index_encryption="cipher",
)
# Connect and create
indexer = Indexer.connect(address="localhost:50050")
index = Index.create_index(indexer=indexer, index_config=cfg)Example: Helpers that use IndexConfig under the hood
import pyenvector as ev
ev.init_connect(address="localhost:50050")
ev.init_index_config(
key_path="./keys",
key_id="my-key",
metadata_encryption=True,
preset="ip",
index_type="flat",
query_encryption="cipher",
)
# Pass identity explicitly when creating
index = ev.create_index(index_name="products", dim=768)Clone/adjust safely
from pyenvector.index import IndexConfig
base = IndexConfig(index_name="base", dim=512, key_path="./keys", key_id="main")
# Create a variant with another name / dimension
variant = base.deepcopy(index_name="products", dim=768)Notes
All vectors inserted into an index must match the configured
dim.index_encryptionis always "cipher" in enVector.Max supported dimension is 4096.
Last updated

