upsert_binary is the low-level, high-throughput upsert path. Vectors are sent as base64-encoded binary instead of JSON arrays, which is significantly faster for large batches. Unlike the two-arg form of upsert(), this method also accepts parallel metadata and contents lists.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ids | List[str] | - | Unique identifier for each vector. Length must match vectors.shape[0]. |
vectors | np.ndarray (shape (n, dim)) | - | Vector data as a 2D numpy array. The SDK casts to little-endian float32 if needed. |
metadata | List[Optional[Dict]] | None | (Optional) Per-vector metadata. Same length as ids. Use None for entries without metadata. |
contents | List[Optional[str | bytes]] | None | (Optional) Per-vector contents. Same length as ids. Bytes are base64-encoded, strings are passed through; all contents are encrypted before storage. Use None for entries without contents. |
Returns
None
Exceptions
Error
Error
TypeError:vectorsis not a numpy array.ValueError:vectors.ndim != 2, orlen(ids) != vectors.shape[0], or the server rejects the upsert.