S3 Vectors: Object Storage Economics for Vector Search
Vector search used to mean running a database. You stood up a cluster, kept it warm, paid for the RAM that held your index, and scaled nodes as your corpus grew.
Busca en todas las páginas de la documentación
Vector search used to mean running a database. You stood up a cluster, kept it warm, paid for the RAM that held your index, and scaled nodes as your corpus grew.
Amazon S3 Vectors proposes a different deal. It stores embeddings inside S3 and searches them there, so the cost model looks like object storage - cheap capacity, pay-per-request - rather than an always-on database. This page explains why that shift matters, what it costs you in return, and when the trade is worth taking.
s3vectors client rather than the normal s3 client.Verify at build time: S3 Vectors is a 2026 API surface. Treat operation names and parameter shapes here as the most likely form and confirm them against the current boto3 /
@aws-sdk/client-s3vectorsdocs.
An embedding is a list of floating-point numbers that represents the meaning of a piece of text, an image, or audio. Similar items produce vectors that sit close together in that numeric space. Vector search is the act of finding the stored vectors nearest to a query vector - the basis of semantic search and Retrieval-Augmented Generation (RAG).
To make that search fast, traditional vector databases build an in-memory index - typically an approximate-nearest-neighbor (ANN) graph like HNSW - and keep it resident in RAM. That is what makes them quick, and also what makes them expensive: you pay for enough memory to hold every vector, all the time, whether or not anyone is querying.
S3 Vectors inverts that. Instead of a cluster, you create a vector bucket - a new bucket type distinct from a normal object bucket. Inside it you create one or more vector indexes. Each index is created with a fixed dimension (the length of every vector, which must match your embedding model - for example 1024 for Amazon Titan Text Embeddings v2) and a distance metric (cosine or euclidean). You then write vectors into the index and query it for the top-k nearest neighbors.
The whole surface is small on purpose: create a bucket, create an index, put vectors, query vectors, get and delete vectors. The mental model is "S3 for embeddings," and the pricing follows that framing.
Here is the shape of the two operations that define the workflow - writing vectors and querying them. Keep them in mind as the concrete anchor for the economics discussion.
# --- Python (boto3) ---
import boto3
# A dedicated client - note this is "s3vectors", not the normal "s3" client.
sv = boto3.client("s3vectors")
# Write one embedding (1024 floats here) with filterable metadata.
sv.put_vectors(
vectorBucketName="my-vectors",
indexName="docs",
vectors=[{
"key": "doc-42",
"data": {"float32": embedding}, # embedding: list[float], len == index dimension
"metadata": {"source": "handbook", "year": 2026},
}],
)
# Query for the 5 nearest neighbors of a query embedding.
res = sv.query_vectors(
vectorBucketName="my-vectors",
indexName="docs",
topK=5,
queryVector={"float32": query_embedding},
returnMetadata=True,
returnDistance=True,
)
for hit in res["vectors"]:
print(hit["key"], hit.get("distance"))
# Verify exact operation and parameter names against current boto3 docs (2026 API surface).// --- TypeScript (AWS SDK v3) ---
import {
S3VectorsClient, PutVectorsCommand, QueryVectorsCommand,
} from "@aws-sdk/client-s3vectors";
const sv = new S3VectorsClient({});
// Write one embedding with filterable metadata.
await sv.send(new PutVectorsCommand({
vectorBucketName: "my-vectors",
indexName: "docs",
vectors: [{
key: "doc-42",
data: { float32: embedding }, // embedding: number[], length === index dimension
metadata: { source: "handbook", year: 2026 },
}],
}));
// Query for the 5 nearest neighbors.
const res = await sv.send(new QueryVectorsCommand({
vectorBucketName: "my-vectors",
indexName: "docs",
topK: 5,
queryVector: { float32: queryEmbedding },
returnMetadata: true,
returnDistance: true,
}));
for (const hit of res.vectors ?? []) console.log(hit.key, hit.distance);
// Verify exact operation and parameter names against current @aws-sdk/client-s3vectors docs (2026 API surface).Now the economics. Because vectors live in S3, you pay three familiar kinds of charge: storage for the bytes at rest, a request charge for writing and querying, and no charge at all for capacity you are not using. There is no cluster humming when traffic is zero. A corpus that is queried twice an hour costs almost nothing between queries, which is exactly the case a rented database punishes you for.
The price of that elasticity is latency. S3 Vectors serves queries from storage, not from a warm in-RAM graph, so a single similarity search typically completes in the tens to low hundreds of milliseconds rather than the single-digit milliseconds a dedicated ANN index can hit. That is fine for a RAG pipeline where the vector search is one step before a multi-second LLM call. It is not fine for an autocomplete box that needs an answer in 5 ms.
Metadata filtering interacts with both cost and quality. Each vector can carry a metadata document, and a query can filter on it (for example, only vectors where year >= 2026). Declaring which metadata keys are filterable at index-creation time lets the service prune candidates during search, so filters are a first-class part of the query, not a post-processing step you pay to run yourself.
The clearest way to place S3 Vectors is on a cost-versus-latency axis against the alternatives.
| Option | Cost model | Typical query latency | Ops burden |
|---|---|---|---|
| S3 Vectors | Object storage + per request | Tens to low hundreds of ms | None - no cluster |
| OpenSearch Serverless | Provisioned compute units | Single-digit to tens of ms | Managed, but you size it |
| Self-hosted pgvector / HNSW | Always-on instance + RAM | Low single-digit ms | You run and scale it |
| Pinecone / managed vector DB | Per-pod or serverless tier | Low single-digit to tens of ms | Vendor-managed |
The pattern that fits S3 Vectors best is a large, latency-tolerant knowledge base. Think a RAG assistant over a company's documents, a legal or research archive, product manuals, or any corpus where the embeddings are numerous, the query rate is modest, and a hundred milliseconds is invisible next to the generation step that follows.
It also shines as a tiering target. You can keep a small hot set in a fast index and let the long tail of rarely queried vectors live in S3 Vectors at a fraction of the cost, the same instinct that sends cold objects to Glacier.
Where it fits poorly: high-QPS, low-latency serving; workloads that need rich hybrid queries beyond top-k plus metadata filters; or anything already bottlenecked on vector-search latency rather than cost. Those still want a purpose-built database.
A first-class use is as the vector store behind an Amazon Bedrock Knowledge Base, an alternative to OpenSearch Serverless that lets a managed RAG pipeline inherit S3 Vectors' economics. That integration gets its own page in this section.
s3vectors API and a real similarity-search engine; you do not GetObject your way through it.The cost of keeping large embedding sets searchable. It removes the always-on cluster and its RAM bill, replacing it with object-storage pricing plus per-request charges, at the cost of higher query latency.
A vector bucket is a separate bucket type with its own s3vectors API. It stores vectors plus metadata and runs similarity search over them, rather than serving opaque objects by key.
Plan for tens to low hundreds of milliseconds per query. That is slower than an in-memory ANN index but usually negligible inside a RAG flow that ends in a multi-second LLM call.
When you need consistently low-single-digit-millisecond queries, very high QPS, or query features beyond top-k with metadata filtering. Those call for a dedicated vector database.
Yes. It can serve as the vector store for a Bedrock Knowledge Base, an alternative to OpenSearch Serverless. See the dedicated integration page in this section.
Match your embedding model's recommendation - cosine is the common default for text embeddings like Titan and Cohere; euclidean suits some other models. The metric is fixed at index creation.
S3 Vectors is a newer, Smithy-modeled service, so its inputs use camelCase (vectorBucketName, indexName) in both boto3 and SDK v3. Confirm the exact names against current docs, since this is a 2026 API.
Separately, before you write them. A common choice is Amazon Bedrock Titan Text Embeddings v2 via invoke_model, then you load the returned float array into S3 Vectors. Embedding generation is covered on the basics and batch-loading pages.
Stack versions: This page was written for boto3 1.43.x (Python 3.10+) and the AWS SDK for JavaScript v3 (Node.js 18+). Amazon S3 Vectors is a fast-moving 2026 API - verify exact operation and parameter names against current docs.
Revisado por Chris St. John·Última actualización: 23 jul 2026