The cyborg::Client class manages storage configurations and acts as a factory for creating or loading encrypted indexes.

Constructor

cyborg::Client(const std::string& api_key,
               const DBConfig& index_location,
               const DBConfig& config_location,
               const DBConfig& items_location,
               const int cpu_threads,
               const bool gpu_accelerate);
Initializes a new instance of Client.

Parameters

ParameterTypeDescription
api_keystd::stringAPI key for your CyborgDB account.
index_locationDBConfigConfiguration for index storage location.
config_locationDBConfigConfiguration for index metadata storage.
items_locationDBConfigConfiguration intended to be used in a future release. Pass in a DBConfig with a Location of ‘None’.
cpu_threadsintNumber of CPU threads to use (e.g., 0 to use all available cores).
gpu_accelerateboolWhether to enable GPU acceleration (requires CUDA).

Exceptions

Example Usage

#include "cyborgdb_core/client.hpp"

std::string api_key = "your_api_key_here";
cyborg::DBConfig index_location(Location::kMemory);
cyborg::DBConfig config_location(Location::kRedis, "index_metadata", "redis://localhost");
cyborg::DBConfig items_location(Location::kNone); // No item storage
int cpu_threads = 4;
bool use_gpu = true;

cyborg::Client client(api_key, index_location, config_location, items_location, cpu_threads, use_gpu);