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
import secrets

# Using `threadsafememory` storage for this example
index_location = cyborgdb.DBConfig("threadsafememory") 
config_location = cyborgdb.DBConfig("threadsafememory")

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

# Create a client
client = cyborgdb.Client(
    api_key=api_key, 
    index_location=index_location, 
    config_location=config_location
)

# Provide the index key used when creating the index
index_key = secrets.token_bytes(32)

# Load an encrypted index
index = client.load_index(
    index_name="my_index", 
    index_key=index_key
)
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: