Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ids | string[] | - | Array of vector IDs to retrieve from the index |
include | string[] | ["vector", "contents", "metadata"] | (Optional) Fields to include in the response. Valid options: "vector", "contents", "metadata" |
Returns
Promise<Array<object>>: A Promise that resolves to an array of retrieved vector items, each containing the requested fields based on the include parameter.
Exceptions
Error
Error
- Throws if the API request fails due to network connectivity issues.
- Throws if authentication fails (invalid API key).
- Throws if the encryption key is invalid for the specified index.
- Throws if there are internal server errors preventing the retrieval.
Validation Errors
Validation Errors
- Throws if the
idsparameter is null, undefined, or empty. - Throws if the
includeparameter contains invalid field names.
Example Usage
Response Format
The method returns an array of objects with the following structure:The
contents field is always returned as a Buffer (bytes), regardless of whether it was originally stored as a string or Buffer. All contents are encoded to bytes and encrypted before storage.Response Item Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the vector (always included) |
vector | number[] | The vector data (included if "vector" in include array) |
contents | Buffer | The content data as Buffer (bytes), always returned as bytes (included if "contents" in include array) |
metadata | any | Associated metadata object (included if "metadata" in include array) |