Skip to main content
Retrieves vectors from the encrypted index by their IDs, with options to specify which fields to include in the results.
index.get(ids, include=["vector", "contents", "metadata"])

Parameters

ParameterTypeDefaultDescription
idsList[str]-List of vector IDs to retrieve
includeList[str]["vector", "contents", "metadata"]Fields to include in the response

Returns

List[Dict] - List of dictionaries containing the requested vector data.
[
  {
    "id": str, # Vector identifier (always included)
    "vector": List[float], # Vector data (if included)
    "contents": bytes, # Vector contents as bytes (if included, always returned as bytes)
    "metadata": Dict # Vector metadata (if included)
  },
  ...
]
The contents field is always returned as bytes, regardless of whether it was originally stored as a string or bytes. All contents are encoded to bytes and encrypted before storage.

Exceptions

  • 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.
  • Throws if the ids parameter is null, undefined, or empty.
  • Throws if the include parameter contains invalid field names.

Example Usage

# Get vectors with all data
vector_ids = ['doc1', 'doc2', 'doc3']
results = index.get(vector_ids)

for item in results:
    print(f"ID: {item['id']}")
    print(f"Vector: {item['vector'][:5]}...")  # Show first 5 dimensions
    print(f"Content: {item.get('contents', 'N/A')}")
    print("---")