Skip to main content
Trains the encrypted index to optimize it for efficient similarity search queries. Training is essential for IVF-based indexes to achieve optimal query performance and accuracy.
In CyborgDB Service, training is typically handled automatically by the service. However, you can explicitly trigger training once enough vectors have been added.

Parameters

TrainParams Fields

Training is a compute-intensive operation that may take several seconds to minutes depending on the index size and configuration.

Returns

  • error: Any error encountered during training, or nil if successful

Error Handling

  • Returns error if the API request fails due to network connectivity issues
  • Returns error if authentication fails (invalid API key)
  • Returns error if the encryption key is invalid for the specified index
  • Returns error if there are internal server errors during training
  • Returns error if the index has insufficient data for training
  • Returns error if training parameters are invalid or out of range
  • Returns error if training fails due to memory constraints

Example Usage

Training with Custom Parameters