Skip to main content
If you’ve previously created an encrypted index, you can connect to it to add, query or delete data from it. You will need to know the index’s name as well as its key to do so:
import cyborgdb_core as cyborgdb

# Get your API key
api_key = "your_api_key_here"  # Replace with your CyborgDB API key

# Create a client (use the same backing store the index was created with)
client = cyborgdb.Client(api_key, cyborgdb.StorageConfig.disk("/tmp/cyborgdb"))

# Provide the SAME 32-byte key used when the index was created.
# Retrieve it from your KMS/secret store — a fresh random key here would fail the load.
index_key = bytes.fromhex("...")  # the 64-char hex of your existing 32-byte index key

# Load an encrypted index
index = client.load_index("my_index", index_key)
For role-based access control (RBAC), a per-user load passes the user’s 16-byte identifier: load_index("my_index", user_kek, user_id=user_id) in Python, or client.LoadIndex("my_index", user_kek, nullptr, user_id) in C++. The supplied key then acts as that user’s key-encryption key, and per-operation permissions are enforced.
You will need to replace index_key with your own index encryption key. For production use, we recommend that you use an HSM or KMS solution. For more details, see Managing Encryption Keys.

API Reference

For more information on loading an encrypted index, refer to the API reference:

Python API Reference

API reference for load_index() in Python

C++ API Reference

API reference for LoadIndex() in C++