Deleting vectors from a vector index - Amazon Simple Storage Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Deleting vectors from a vector index

You can delete specific vectors from a vector index by specifying their vector keys using the DeleteVectors API. This operation is useful for removing outdated or incorrect data while preserving the rest of your vector data.

To delete vectors, use the following example commands. Replace the user input placeholders with your own information.

aws s3vectors delete-vectors \ --vector-bucket-name "amzn-s3-demo-vector-bucket" \ --index-name "idx" \ --keys '["vec2","vec3"]'
SDK for Python
import boto3 # Create a S3 Vectors client in the AWS Region of your choice. s3vectors = boto3.client("s3vectors", region_name="us-west-2") #Delete vectors in a vector index response = s3vectors.delete_vectors( vectorBucketName="media-embeddings", indexName="movies", keys=["Star Wars", "Finding Nemo"])