Encrypted Index
Train Index
POST
Train Index
Train an index for efficient querying. Required before optimal performance.
You can get an API key from the CyborgDB Admin Dashboard. For more info, follow this guide.
Training Failed:
Custom Training Parameters:
Authentication
Required - API key viaX-API-Key header:
Request Body
Response
Training Completed:This endpoint blocks until training completes. It will return
"success" when training finishes normally, or "error" if training fails.Exceptions
401: Authentication failed (invalid API key) or wrongindex_keyon SDK-supplied indexes — see error model404: Index not found422: Invalid request parameters or insufficient vectors500: Internal server error
Example Usage
Basic Training:Training Requirements
- Minimum vectors: At least
2 × n_listsvectors must be present in the index - Memory: Training may require significant memory depending on
batch_sizeand dataset size - Time: Training duration varies based on dataset size and convergence parameters
Use Cases
- Performance optimization: Enable fast approximate nearest neighbor search
- Production preparation: Train indexes before deploying to production
- Batch processing: Train indexes after bulk data ingestion
- Index maintenance: Retrain indexes after significant data updates