If ~/.cyborgdb/index_key exists and holds exactly 32 bytes, that key is returned and no new key is generated.
Otherwise a new key is generated, written to that file, and returned.
The file is not encrypted, and the SDK logs a warning each time it’s used. Use save=True for local development only; in production, store keys in a secrets manager or use a KMS-backed index. See Managing Encryption Keys.
An index created with an SDK-supplied key can only be opened with that exact key. If the key is lost, the index’s data can’t be decrypted.
from cyborgdb import Clientclient = Client(base_url='http://localhost:8000', api_key='your-api-key')index_key = Client.generate_key()print(len(index_key))# Output: 32index = client.create_index('my-secure-index', index_key)# Keep the key somewhere safe, e.g. as hex in a secrets managerkey_hex = index_key.hex()