Vector Operations
API operations
Section titled “API operations”Five API calls power this demo. The Ingest Lambda
AWS Lambda — serverless compute. This project uses two functions: ingest (RSS → embed → store) and query (search → answer). writes and maintains vectors; the Query Lambda searches them. Both share GetVectors and ListIndexes.

PutVectors
Section titled “PutVectors”Store one or more vectors with metadata:
s3vectors.put_vectors( vectorBucketName=config.vector_bucket, indexName=config.vector_index, vectors=[ { "key": "article-a1b2c3d4-chunk-000", "data": {"float32": embedding}, # 1024 floats "metadata": { "source": "aws-whats-new-a1b2c3d4.txt", "title": "Amazon S3 Vectors is now GA", "url": "https://aws.amazon.com/...", "published": "2025-06-01T12:00:00Z", "feed": "aws-whats-new", "chunk": "0", }, } ],)Key points:
- key must be unique within the index (used for upsert and retrieval)
- data must match the index dimension exactly (1024 floats)
- metadata is arbitrary — store whatever you’ll need at search time
QueryVectors
Section titled “QueryVectors”Find the most similar vectors to a query:
response = s3vectors.query_vectors( vectorBucketName=config.vector_bucket, indexName=config.vector_index, queryVector={"float32": query_embedding}, topK=15, returnMetadata=True,)
for vector in response.get("vectors", []): key = vector["key"] similarity = vector.get("similarity", 0.0) metadata = vector.get("metadata", {}) title = metadata.get("title", "")Key points:
- queryVector is the embedded question (same model, same dimension)
- topK controls how many results to return
- returnMetadata=True includes stored metadata in results
- Results are sorted by similarity score (highest first)
GetVectors
Section titled “GetVectors”Retrieve specific vectors by their keys:
response = s3vectors.get_vectors( vectorBucketName=config.vector_bucket, indexName=config.vector_index, keys=["article-a1b2c3d4-chunk-000"], returnMetadata=True,)Boto3 client
Section titled “Boto3 client”The S3 Vectors service has its own boto3 client:
import boto3
s3vectors = boto3.client("s3vectors", region_name="ap-southeast-2")