Amazon S3 Vectors is a vector store built into S3. You create a vector bucket and an index, write float32 embeddings with put_vectors, and search them with query_vectors. There are no clusters to size, and you pay for storage, writes and queries. It has been generally available since December 2, 2025. AWS states sub-second latency for infrequent queries and as low as 100 ms for frequent ones. Since November 16, 2026, it also runs full-text and hybrid search in the same index. This tutorial builds a working boto3 pipeline with Bedrock Titan Text Embeddings V2, metadata filters and hybrid queries, then shows where S3 Vectors fits next to pgvector, OpenSearch and dedicated vector databases.

What S3 Vectors is (and what changed in 2026)

S3 Vectors introduces a new bucket type with its own API namespace, s3vectors, separate from regular S3 buckets. A vector bucket holds up to 10,000 vector indexes. Each index has a fixed dimension, a distance metric (cosine or euclidean) and up to 2 billion vectors. Writes are strongly consistent, so a vector you just put is immediately queryable, according to the S3 Vectors user guide.

The service has changed a lot since the July 2025 preview. Older tutorials are wrong on several points:

Date Change
Dec 2, 2025 GA: 2 billion vectors per index (up from 50 million), up to 100 results per query, Bedrock Knowledge Bases and OpenSearch integrations GA
Jun 2026 Up to 10,000 results per query via pagination. Lower query charges for indexes over 10 million vectors
Sep 30, 2026 Metadata pre-filtering: new buckets create ENHANCED indexes that filter before the vector search
Nov 16, 2026 Hybrid search: BM25 full-text search on metadata fields, fused with vector results using Reciprocal Rank Fusion

The index mode matters most. Buckets created before September 30, 2026 have CLASSIC indexes. These evaluate filters during the search and "may return fewer than top K results" when few vectors match. Buckets created on or after that date get ENHANCED indexes, which pre-filter. Full-text and hybrid search only work on ENHANCED indexes. You can upgrade an old index with update_index_mode(indexMode="ENHANCED").

Limits you will hit first

From the limitations page, as of November 2026:

Limit Value
Dimensions per vector 1 to 4,096 (float32 only)
Vectors per index Up to 2 billion
Indexes per bucket / buckets per Region 10,000 / 10,000
Total metadata per vector 100 KB (ENHANCED), 40 KB (CLASSIC)
Filterable metadata per vector 2 KB
Metadata keys per vector 50
Non-filterable keys per index 10 (set at index creation, immutable)
Vectors per PutVectors call 500
Write rate per index 1,000 Put/Delete requests/s, 2,500 vectors/s
Top-K per query 10,000 (100 per page)
Filter constraints per query (ENHANCED) 100

Two of these limits shape your schema. Filterable metadata gets only 2 KB per vector, so your chunk text must go in a non-filterable key. And the non-filterable key list can't change after the index exists, so decide on it before you create the index.

Prerequisites

  • An AWS account in a Region that offers S3 Vectors, with Bedrock access to amazon.titan-embed-text-v2:0 in the same Region.
  • Python 3.10+ with boto3>=1.44.4 and numpy. Version 1.44.4 (November 16, 2026) is the first release whose s3vectors model includes queryTexts. Older versions run vector queries fine but reject hybrid parameters during client-side validation.
  • IAM permissions. QueryVectors alone returns keys and distances only. If you use a filter, returnMetadata=True or queryTexts, you also need s3vectors:GetVectors, or the call fails with AccessDeniedException.
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3vectors:CreateVectorBucket",
        "s3vectors:CreateIndex",
        "s3vectors:GetIndex",
        "s3vectors:PutVectors",
        "s3vectors:GetVectors",
        "s3vectors:QueryVectors"
      ],
      "Resource": "arn:aws:s3vectors:us-east-1:123456789012:bucket/acme-docs-vectors*"
    },
    {
      "Effect": "Allow",
      "Action": "bedrock:InvokeModel",
      "Resource": "arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0"
    }
  ]
}

Step 1: Create the vector bucket and index

The index dimension must match your embedding model. Titan Text Embeddings V2 outputs 1024 dimensions by default, with 512 and 256 as options, and it normalizes vectors unless you tell it not to. Cosine distance is the natural match.

import json

import boto3
import numpy as np

REGION = "us-east-1"
BUCKET = "acme-docs-vectors"
INDEX = "runbooks-titan-v2-1024"
MODEL_ID = "amazon.titan-embed-text-v2:0"
DIM = 1024

s3v = boto3.client("s3vectors", region_name=REGION)
bedrock = boto3.client("bedrock-runtime", region_name=REGION)

s3v.create_vector_bucket(vectorBucketName=BUCKET)

s3v.create_index(
    vectorBucketName=BUCKET,
    indexName=INDEX,
    dataType="float32",
    dimension=DIM,
    distanceMetric="cosine",
    metadataConfiguration={
        # Large text: returned with results and BM25-searchable, but not filterable
        "nonFilterableMetadataKeys": ["chunk_text"],
        "textSearchConfigurations": [
            {"metadataKey": "chunk_text", "language": "en"},
        ],
    },
)

Put the model name and dimension in the index name. When you switch embedding models later, you create a new index and backfill it. Mixing vectors from two models in one index produces silently bad results.

A key can be non-filterable and full-text searchable at the same time. That suits chunk text: you never filter on it, but you want exact-term matches on error codes, SKUs and product names. Omit language to get the standard analyzer (lowercasing, word-boundary splitting). Set "en" to add stemming and stopword removal. Once a field is configured, you can't change its analyzer.

Step 2: Generate embeddings with Bedrock

def embed(text: str) -> list[float]:
    resp = bedrock.invoke_model(
        modelId=MODEL_ID,
        body=json.dumps({"inputText": text, "dimensions": DIM, "normalize": True}),
        contentType="application/json",
        accept="application/json",
    )
    vec = json.loads(resp["body"].read())["embedding"]
    return np.asarray(vec, dtype=np.float32).tolist()

S3 Vectors stores float32 only. The API docs warn that SDKs may default to wider numeric types, and higher-precision values are converted on write. The explicit cast keeps what you send identical to what you get back from get_vectors. For model choices beyond Titan, see our embedding models comparison.

Step 3: Write vectors with metadata

chunks = [
    {
        "key": "kafka-kraft-runbook#0",
        "text": "Before finalizing, confirm ZkMigrationState is 3 and MigratingZkBrokerCount is 0.",
        "meta": {"source": "runbooks", "team": "platform", "year": 2026, "tags": ["kafka", "kraft"]},
    },
    {
        "key": "postgres-failover#0",
        "text": "Promote the replica with pg_ctl promote, then repoint PgBouncer.",
        "meta": {"source": "runbooks", "team": "data", "year": 2025, "tags": ["postgres"]},
    },
]

def put_chunks(items, batch_size=500):
    for i in range(0, len(items), batch_size):
        batch = items[i : i + batch_size]
        s3v.put_vectors(
            vectorBucketName=BUCKET,
            indexName=INDEX,
            vectors=[
                {
                    "key": c["key"],
                    "data": {"float32": embed(c["text"])},
                    "metadata": {**c["meta"], "chunk_text": c["text"]},
                }
                for c in batch
            ],
        )

put_chunks(chunks)

Some notes for production:

  • Keys are your upsert handle. Writing an existing key replaces that vector, so use deterministic keys such as doc-id#chunk-n. Re-ingesting a document then overwrites its chunks instead of duplicating them.
  • Batch to the 500 limit. Pricing applies a 128 KB minimum charge per PUT, so single-vector writes cost more than batched ones.
  • Handle throttling. A PutVectors request that exceeds current capacity returns ServiceUnavailableException. Use exponential backoff, and stay under roughly 1,000 write requests per second per index.
  • Metadata types. String, number, boolean and lists are filterable. A list matches $eq if any element matches.

Step 4: Query with metadata filters

q = embed("what do I check before removing ZooKeeper?")

resp = s3v.query_vectors(
    vectorBucketName=BUCKET,
    indexName=INDEX,
    topK=5,
    queryVector={"float32": q},
    filter={"$and": [{"team": {"$eq": "platform"}}, {"year": {"$gte": 2025}}]},
    returnMetadata=True,
    returnDistance=True,
)

for v in resp["vectors"]:
    print(v["key"], round(v["distance"], 4), v["metadata"]["source"])

With cosine, a lower distance means more similar. Results come back as keys only unless you ask for returnMetadata and returnDistance. The filter language is MongoDB-style:

Operator Types Example
implicit $eq string, number, bool {"team": "platform"}
$ne string, number, bool {"status": {"$ne": "archived"}}
$gt, $gte, $lt, $lte number {"year": {"$gte": 2025}}
$in, $nin non-empty array {"tags": {"$in": ["kafka", "zookeeper"]}}
$exists boolean {"owner": {"$exists": true}}
$startsWith string, ENHANCED only {"path": {"$startsWith": "/runbooks/"}}
$and, $or array of filters {"$or": [{...}, {...}]}

On ENHANCED indexes, each value counts toward the 100-constraint limit. A three-element $in counts as three. Store dates as numbers (epoch seconds or YYYYMMDD) so range operators work on them, since $gt and its relatives only accept numbers.

To fetch more than 100 results, page through with nextToken:

def query_all(query_vec, top_k=1000, flt=None):
    results, token = [], None
    while True:
        kwargs = {
            "vectorBucketName": BUCKET,
            "indexName": INDEX,
            "topK": top_k,
            "queryVector": {"float32": query_vec},
            "returnDistance": True,
        }
        if flt:
            kwargs["filter"] = flt
        if token:
            kwargs["nextToken"] = token
        resp = s3v.query_vectors(**kwargs)
        results.extend(resp["vectors"])
        token = resp.get("nextToken")
        if not token:
            return results

Step 5: Hybrid search (vector plus BM25)

Pure vector search is weak on exact identifiers such as ZkMigrationState, E1234 or a ticker. Hybrid search runs BM25 on the text field and a vector search, then fuses both rankings with Reciprocal Rank Fusion:

resp = s3v.query_vectors(
    vectorBucketName=BUCKET,
    indexName=INDEX,
    topK=10,
    queryVector={"float32": embed("how do I finalize the migration?")},
    queryTexts=[{"text": "ZkMigrationState", "metadataKey": "chunk_text"}],
    filter={"tags": {"$in": ["kafka", "zookeeper"]}},
    returnMetadata=True,
    returnScores=True,
)

for v in resp["vectors"]:
    print(v["key"], v.get("scores", {}).get("fused"))

Leave out queryVector to run a BM25-only search. To search up to 10 fields, pass one queryTexts entry per field. If you add a text-search field to an index that already holds data, call update_metadata_configuration. The field shows BUILDING in get_index until the backfill finishes, and queries against it are rejected until it becomes ACTIVE.

Note that, as of today, the Bedrock Knowledge Bases integration page still lists "semantic search only" for S3 Vectors-backed knowledge bases. Use the S3 Vectors API directly if you want hybrid search.

Bedrock Knowledge Bases and OpenSearch integrations

Bedrock Knowledge Bases. You can let Bedrock own the pipeline: choose "S3 vector bucket" as the vector store, and Bedrock chunks, embeds and writes into an index it creates, or into one you created. Knowledge-base limits are tighter than the raw API. You get 1 KB of custom metadata and 35 metadata keys per vector, and float vectors only. Hierarchical chunking with large chunks can overflow the metadata limits, because parent-chunk context is stored as non-filterable metadata.

OpenSearch. There are two patterns. You can export a point-in-time snapshot of an index to OpenSearch Serverless for high-QPS, low-latency serving. The export is one-time and does not stay in sync, and you pay for both services. Or you can use S3 Vectors as the vector engine of an OpenSearch managed domain, keeping OpenSearch's query DSL, aggregations and faceting while the vectors live in S3 Vectors. The OpenSearch integration guide covers both. If you're weighing OpenSearch itself, see Elasticsearch vs OpenSearch.

Pricing

As of November 2026, the S3 pricing page (S3 Vectors tab) uses these US East (N. Virginia) rates in its worked examples: storage at $0.06 per GB-month of logical vector, metadata and key size; PUT at $0.20 per GB uploaded, with a 128 KB minimum per request; and $2.50 per million query requests. On top of those come a query data-processed charge that is tiered by index size and drops for indexes above 10 million vectors, and a per-GB charge for data returned. Run your own numbers through the page's examples. Your dimensions, metadata size and top-K drive the bill far more than vector count does.

When to use S3 Vectors vs pgvector, OpenSearch or a vector database

Need Best fit Why
Large, mostly cold corpus (archives, agent memory, long-tail RAG) with occasional queries S3 Vectors No idle compute; you pay per GB and per query
Vectors that must join transactionally with relational data pgvector One database, SQL joins, ACID. See LanceDB vs pgvector
Sustained high QPS with tight, predictable p99 latency Dedicated vector DB (Qdrant, Milvus, Pinecone) or OpenSearch Always-warm in-memory indexes, tunable HNSW parameters and quantization. See Qdrant vs Pinecone
Faceted search, aggregations, complex relevance tuning OpenSearch (optionally on the S3 Vectors engine) Full search engine features that S3 Vectors does not have
Managed RAG with minimal code on AWS Bedrock KB + S3 Vectors Ingestion, chunking and retrieval handled for you
Index tuning (HNSW ef, quantization, multi-vector) Dedicated vector DB S3 Vectors exposes no index parameters

AWS's own wording is that S3 Vectors "is ideal for workloads where queries are less frequent." The common production pattern is tiered: keep everything in S3 Vectors, and promote a hot subset to OpenSearch or a dedicated engine when latency or QPS requires it.

Frequently Asked Questions

Is Amazon S3 Vectors generally available?

Yes. It entered preview in July 2025 and became generally available on December 2, 2025. Since then it has added 10,000-result paginated queries, metadata pre-filtering (ENHANCED index mode, September 30, 2026) and hybrid search (November 16, 2026).

How fast are S3 Vectors queries?

AWS states sub-second latency for infrequent (cold) queries and as low as 100 milliseconds for frequent (warm) queries. It also states 90%+ average recall for vector search on most datasets. Neither is an SLA, so test with your own data, dimensions and filters, because filter selectivity affects latency on ENHANCED indexes.

What embedding dimensions does S3 Vectors support?

Each index takes a fixed dimension from 1 to 4,096, in float32. That covers common models such as Titan Text Embeddings V2 (1024, 512 or 256) and most open-source embedders. Binary embeddings are not supported.

Can S3 Vectors replace OpenSearch or a vector database?

For low-to-moderate query rates over large datasets, often yes, and it is usually cheaper. For sustained high QPS, strict p99 targets, aggregations or custom index tuning, keep OpenSearch or a dedicated engine. AWS's own integrations assume that tiered setup.

Why does my filtered query return fewer than topK results?

Your index is probably in CLASSIC mode, which applies filters during the vector search and can come up short when few vectors match. Indexes in buckets created before September 30, 2026 default to CLASSIC. Run update_index_mode with indexMode="ENHANCED" to get pre-filtering.

Conclusion

S3 Vectors turns vector storage into a bucket-and-API problem. Create an index whose dimension matches your model, keep chunk text in a non-filterable key, batch writes to 500, filter on small metadata, and use hybrid queries when exact terms matter. Use it as the system of record for large, cold or bursty vector workloads. When you need sustained high QPS and low tail latency, put pgvector, OpenSearch or a dedicated vector database in front of it. If you're debugging filter documents or API responses as you build this, the JSON formatter helps.