Amazon S3 Vectors

2026/09/30 - Amazon S3 Vectors - 2 new 3 updated api methods

Changes  Amazon S3 Vectors now supports metadata prefiltering, providing higher recall on filtered queries.

PutVectorBucketDefaultIndexMode (new) Link ¶

Updates the default index mode for a vector bucket. The updated default applies to vector indexes that you create after the request succeeds. The operation doesn't change existing vector indexes. To specify the vector bucket, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN).

Permissions

You must have the s3vectors:PutVectorBucketDefaultIndexMode permission to use this operation.

See also: AWS API Documentation

Request Syntax

client.put_vector_bucket_default_index_mode(
    vectorBucketName='string',
    vectorBucketArn='string',
    defaultIndexMode='CLASSIC'|'ENHANCED'
)
type vectorBucketName:

string

param vectorBucketName:

The name of the vector bucket to update.

type vectorBucketArn:

string

param vectorBucketArn:

The Amazon Resource Name (ARN) of the vector bucket to update.

type defaultIndexMode:

string

param defaultIndexMode:

[REQUIRED]

The default mode to assign to new vector indexes in the vector bucket. This change doesn't affect existing vector indexes.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

UpdateIndexMode (new) Link ¶

Updates the mode for an existing vector index. You can set the mode to ENHANCED for any vector index. You can set the mode to CLASSIC only for a vector index in a vector bucket created before September 30, 2026. This operation doesn't change the default index mode of the vector bucket or the mode of other vector indexes. Specify the vector index by using its Amazon Resource Name (ARN) or both the vector bucket name and vector index name.

Permissions

You must have the s3vectors:UpdateIndexMode permission to use this operation.

See also: AWS API Documentation

Request Syntax

client.update_index_mode(
    vectorBucketName='string',
    indexName='string',
    indexArn='string',
    indexMode='CLASSIC'|'ENHANCED'
)
type vectorBucketName:

string

param vectorBucketName:

The name of the vector bucket that contains the vector index.

type indexName:

string

param indexName:

The name of the vector index to update.

type indexArn:

string

param indexArn:

The Amazon Resource Name (ARN) of the vector index to update.

type indexMode:

string

param indexMode:

[REQUIRED]

The new mode for the vector index.

Valid values:

  • CLASSIC - Applies metadata filters during the vector search. You can specify CLASSIC only for a vector index in a vector bucket created before September 30, 2026.

  • ENHANCED - Applies metadata filters before the vector search.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

GetIndex (updated) Link ¶
Changes (response)
{'index': {'indexMode': 'CLASSIC | ENHANCED'}}

Returns vector index attributes. To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN).

Permissions

You must have the s3vectors:GetIndex permission to use this operation.

See also: AWS API Documentation

Request Syntax

client.get_index(
    vectorBucketName='string',
    indexName='string',
    indexArn='string'
)
type vectorBucketName:

string

param vectorBucketName:

The name of the vector bucket that contains the vector index.

type indexName:

string

param indexName:

The name of the vector index.

type indexArn:

string

param indexArn:

The ARN of the vector index.

rtype:

dict

returns:

Response Syntax

{
    'index': {
        'vectorBucketName': 'string',
        'indexName': 'string',
        'indexArn': 'string',
        'creationTime': datetime(2015, 1, 1),
        'dataType': 'float32',
        'dimension': 123,
        'distanceMetric': 'euclidean'|'cosine',
        'metadataConfiguration': {
            'nonFilterableMetadataKeys': [
                'string',
            ]
        },
        'encryptionConfiguration': {
            'sseType': 'AES256'|'aws:kms',
            'kmsKeyArn': 'string'
        },
        'indexMode': 'CLASSIC'|'ENHANCED'
    }
}

Response Structure

  • (dict) --

    • index (dict) --

      The attributes of the vector index.

      • vectorBucketName (string) --

        The name of the vector bucket that contains the vector index.

      • indexName (string) --

        The name of the vector index.

      • indexArn (string) --

        The Amazon Resource Name (ARN) of the vector index.

      • creationTime (datetime) --

        Date and time when the vector index was created.

      • dataType (string) --

        The data type of the vectors inserted into the vector index.

      • dimension (integer) --

        The number of values in the vectors that are inserted into the vector index.

      • distanceMetric (string) --

        The distance metric to be used for similarity search.

      • metadataConfiguration (dict) --

        The metadata configuration for the vector index.

        • nonFilterableMetadataKeys (list) --

          Non-filterable metadata keys allow you to enrich vectors with additional context during storage and retrieval. Unlike default metadata keys, these keys can’t be used as query filters. Non-filterable metadata keys can be retrieved but can’t be searched, queried, or filtered. You can access non-filterable metadata keys of your vectors after finding the vectors. For more information about non-filterable metadata keys, see Vectors and Limitations and restrictions in the Amazon S3 User Guide.

          • (string) --

      • encryptionConfiguration (dict) --

        The encryption configuration for a vector index. By default, if you don't specify, all new vectors in the vector index will use the encryption configuration of the vector bucket.

        • sseType (string) --

          The server-side encryption type to use for the encryption configuration of the vector bucket. By default, if you don't specify, all new vectors in Amazon S3 vector buckets use server-side encryption with Amazon S3 managed keys (SSE-S3), specifically AES256.

        • kmsKeyArn (string) --

          Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the encryption configuration. This parameter is allowed if and only if sseType is set to aws:kms.

          To specify the KMS key, you must use the format of the KMS key Amazon Resource Name (ARN).

          For example, specify Key ARN in the following format: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

      • indexMode (string) --

        The mode that determines how the vector index processes queries.

        Valid values:

        • CLASSIC - Applies metadata filters during the vector search.

        • ENHANCED - Applies metadata filters before the vector search.

GetVectorBucket (updated) Link ¶
Changes (response)
{'vectorBucket': {'defaultIndexMode': 'CLASSIC | ENHANCED'}}

Returns vector bucket attributes. To specify the bucket, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN).

Permissions

You must have the s3vectors:GetVectorBucket permission to use this operation.

See also: AWS API Documentation

Request Syntax

client.get_vector_bucket(
    vectorBucketName='string',
    vectorBucketArn='string'
)
type vectorBucketName:

string

param vectorBucketName:

The name of the vector bucket to retrieve information about.

type vectorBucketArn:

string

param vectorBucketArn:

The ARN of the vector bucket to retrieve information about.

rtype:

dict

returns:

Response Syntax

{
    'vectorBucket': {
        'vectorBucketName': 'string',
        'vectorBucketArn': 'string',
        'creationTime': datetime(2015, 1, 1),
        'encryptionConfiguration': {
            'sseType': 'AES256'|'aws:kms',
            'kmsKeyArn': 'string'
        },
        'defaultIndexMode': 'CLASSIC'|'ENHANCED'
    }
}

Response Structure

  • (dict) --

    • vectorBucket (dict) --

      The attributes of the vector bucket.

      • vectorBucketName (string) --

        The name of the vector bucket.

      • vectorBucketArn (string) --

        The Amazon Resource Name (ARN) of the vector bucket.

      • creationTime (datetime) --

        Date and time when the vector bucket was created.

      • encryptionConfiguration (dict) --

        The encryption configuration for the vector bucket.

        • sseType (string) --

          The server-side encryption type to use for the encryption configuration of the vector bucket. By default, if you don't specify, all new vectors in Amazon S3 vector buckets use server-side encryption with Amazon S3 managed keys (SSE-S3), specifically AES256.

        • kmsKeyArn (string) --

          Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the encryption configuration. This parameter is allowed if and only if sseType is set to aws:kms.

          To specify the KMS key, you must use the format of the KMS key Amazon Resource Name (ARN).

          For example, specify Key ARN in the following format: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

      • defaultIndexMode (string) --

        The mode that is automatically assigned to new vector indexes in the vector bucket. Changing the default index mode doesn't affect existing vector indexes.

QueryVectors (updated) Link ¶
Changes (request)
{'queryMode': 'CLASSIC | ENHANCED'}

Performs an approximate nearest neighbor search query in a vector index using a query vector. By default, it returns the keys of approximate nearest neighbors. You can optionally include the computed distance (between the query vector and each vector in the response) and metadata of each vector in the response.

To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN).

Permissions

You must have the s3vectors:QueryVectors permission to use this operation. Additional permissions are required based on the request parameters you specify:

  • With only s3vectors:QueryVectors permission, you can retrieve vector keys of approximate nearest neighbors and computed distances between these vectors. This permission is sufficient only when you don't set any metadata filters and don't request metadata (by keeping the returnMetadata parameter set to false or not specified).

  • If you specify a metadata filter or set returnMetadata to true, you must have both s3vectors:QueryVectors and s3vectors:GetVectors permissions. The request fails with a 403 Forbidden error if you request metadata filtering or metadata without the s3vectors:GetVectors permission.

See also: AWS API Documentation

Request Syntax

client.query_vectors(
    vectorBucketName='string',
    indexName='string',
    indexArn='string',
    topK=123,
    queryVector={
        'float32': [
            ...,
        ]
    },
    filter={...}|[...]|123|123.4|'string'|True|None,
    queryMode='CLASSIC'|'ENHANCED',
    returnMetadata=True|False,
    returnDistance=True|False,
    nextToken='string'
)
type vectorBucketName:

string

param vectorBucketName:

The name of the vector bucket that contains the vector index.

type indexName:

string

param indexName:

The name of the vector index that you want to query.

type indexArn:

string

param indexArn:

The ARN of the vector index that you want to query.

type topK:

integer

param topK:

[REQUIRED]

The number of results to return for each query.

type queryVector:

dict

param queryVector:

[REQUIRED]

The query vector. Ensure that the query vector has the same dimension as the dimension of the vector index that's being queried. For example, if your vector index contains vectors with 384 dimensions, your query vector must also have 384 dimensions.

  • float32 (list) --

    The vector data as 32-bit floating point numbers. The number of elements in this array must exactly match the dimension of the vector index where the operation is being performed.

    • (float) --

type filter:

:ref:`document<document>`

param filter:

Metadata filter to apply during the query. For more information about metadata keys, see Metadata filtering in the Amazon S3 User Guide.

type queryMode:

string

param queryMode:

The mode to use to process the query. If you don't specify a query mode, the operation uses the mode that's currently configured for the vector index.

Valid values:

  • CLASSIC - Applies metadata filters during the vector search. You can't specify CLASSIC for an ENHANCED index.

  • ENHANCED - Applies metadata filters before the vector search.

type returnMetadata:

boolean

param returnMetadata:

Indicates whether to include metadata in the response. The default value is false.

type returnDistance:

boolean

param returnDistance:

Indicates whether to include the computed distance in the response. The default value is false.

type nextToken:

string

param nextToken:

Pagination token from a previous request. The value of this field is empty for an initial request.

rtype:

dict

returns:

Response Syntax

{
    'vectors': [
        {
            'distance': ...,
            'key': 'string',
            'metadata': {...}|[...]|123|123.4|'string'|True|None
        },
    ],
    'distanceMetric': 'euclidean'|'cosine',
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • vectors (list) --

      The vectors in the approximate nearest neighbor search.

      • (dict) --

        The attributes of a vector in the approximate nearest neighbor search.

        • distance (float) --

          The measure of similarity between the vector in the response and the query vector.

        • key (string) --

          The key of the vector in the approximate nearest neighbor search.

        • metadata (:ref:`document<document>`) --

          The metadata associated with the vector, if requested.

    • distanceMetric (string) --

      The distance metric that was used for the similarity search calculation. This is the same distance metric that was configured for the vector index when it was created.

    • nextToken (string) --

      Pagination token to be used in the subsequent page request. The field is empty if no further pagination is required.