How do I store and search vectors directly in S3?
A plain S3 bucket stores files and has no similarity search, so you need something that keeps its vectors and index in object storage and runs the search for you. There are three ways to do it in 2026:
1. Amazon S3 Vectors. AWS's own vector bucket type. Create a vector bucket and an index, write embeddings with
put_vectors, and search with query_vectors. Nothing to run, AWS only.
2. LanceDB on an S3 path. An open-source library that writes Lance tables to
s3://your-bucket/path and runs the search inside your own process. Your bucket, your compute.
3. A storage-first vector database. A managed service, such as the Mixpeek Vector Store (MVS),
that keeps its write-ahead log, segments and snapshots in object storage and puts a cache in
front for warm queries. You get hybrid search, filters and an API, and don't run any servers.Pick S3 Vectors when you are on AWS and query occasionally, LanceDB when you want the data in your bucket and are happy to run the query compute, and a storage-first database when you need hybrid search, higher query rates or one API across text, images and video. The code for each is below.
What do I need before I start?
Option 1: How do I use Amazon S3 Vectors?
S3 Vectors adds a bucket type that holds vector indexes. Each index has a fixed dimension and a distance metric (cosine or Euclidean). With boto3:
import boto3
s3v = boto3.client("s3vectors", region_name="us-east-1")
# 1. A vector bucket and an index. Dimension and metric are fixed for the index's lifetime.
s3v.create_vector_bucket(vectorBucketName="docs-vectors")
s3v.create_index(
vectorBucketName="docs-vectors",
indexName="articles-v1",
dataType="float32",
dimension=1024,
distanceMetric="cosine",
metadataConfiguration={"nonFilterableMetadataKeys": ["chunk_text"]},
)
# 2. Write vectors in batches of up to 500, each with a key and metadata.
s3v.put_vectors(
vectorBucketName="docs-vectors",
indexName="articles-v1",
vectors=[{
"key": "doc-001#0",
"data": {"float32": embedding}, # 1,024 floats from your model
"metadata": {"tenant": "acme", "lang": "en", "chunk_text": "First paragraph..."},
}],
)
# 3. Search with a query embedding and an optional metadata filter.
res = s3v.query_vectors(
vectorBucketName="docs-vectors",
indexName="articles-v1",
queryVector={"float32": query_embedding},
topK=10,
filter={"tenant": "acme"},
returnDistance=True,
returnMetadata=True,
)
for hit in res["vectors"]:
print(hit["key"], hit["distance"])chunk_text as non-filterable metadata: filterable metadata is capped at
2 KB per vector, out of 40 KB in total. Writes are strongly consistent, so a vector can be queried
as soon as put_vectors returns. The limits that matter most in production are hundreds of queries
a second per index and 2,500 vectors a second of writes per index. The full list, prices and a
worked 10M-vector cost example are in
Is Amazon S3 Vectors good enough for production?Option 2: How do I keep vectors in my own S3 bucket with LanceDB?
LanceDB writes its tables as Lance files under any
s3://, gs:// or az:// path and runs
queries in your application's process. AWS credentials come from the usual credential chain.import lancedb
db = lancedb.connect("s3://my-bucket/lancedb")
table = db.create_table("articles", data=[
{"id": "doc-001#0", "vector": embedding, "tenant": "acme", "text": "First paragraph..."},
])
hits = (
table.search(query_embedding)
.where("tenant = 'acme'")
.limit(10)
.to_list()
)table.create_index(...)). Concurrent writers from several machines
need coordination, which the LanceDB docs cover.Option 3: How do I use a storage-first vector database?
A storage-first database keeps the durable copy of every vector in object storage and serves queries from a fleet with a local cache. You call an API, it handles segments, compaction and caching. With Mixpeek's vector store, you create a namespace, upsert documents with your own vectors, and query through a retriever:
# 1. A namespace for your vectors. Dimensions are inferred on the first write.
curl -X POST "https://api.mixpeek.com/v1/namespaces/standalone" \
-H "Authorization: Bearer $MIXPEEK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"namespace_id": "articles"}'
# 2. Upsert documents with your vectors and any payload fields.
curl -X POST "https://api.mixpeek.com/v1/namespaces/articles/documents/upsert" \
-H "Authorization: Bearer $MIXPEEK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"documents": [{
"document_id": "doc-001",
"vectors": {"articles_e5_v1": [0.12, -0.34, 0.56]},
"payload": {"tenant": "acme", "lang": "en"}
}]}'feature_search stage on articles_e5_v1 and a
pre_filters condition on tenant, and execute it with the query embedding. The
vector store quickstart has the full request, plus sparse, BM25 and
hybrid search over the same documents.On the managed service the vectors sit in object storage that Mixpeek runs. On a dedicated or self-hosted deployment you can point the store at your own S3, GCS, R2 or other S3-compatible bucket (bring your own object storage).
How do the three options compare?
| Amazon S3 Vectors | LanceDB on S3 | Storage-first database (MVS) | |
|---|---|---|---|
| Where vectors live | AWS vector bucket | Your bucket | Object storage (yours on dedicated or self-hosted) |
| Who runs the search | AWS | Your process | The service |
| Clouds | AWS | Any object store | AWS, GCP and S3-compatible stores |
| Search types | Similarity with metadata filters | Vector, full-text and hybrid | Dense, sparse, BM25 and hybrid |
| Query rate | Hundreds of queries a second per index | Limited by your compute | Scales with the serving fleet |
| Changing embedding models | New index and full reload | New column or table | New vector name in the same namespace |
| Pricing | Storage, writes and data processed per query | Your S3 and compute bills | Plan based, see pricing |
| Best for | AWS teams with occasional queries and many tenants | Pipelines and apps that want full control | Products with steady query traffic or multimodal data |
Why is my first query slow?
Every option here reads from object storage on a cold query, and each read is a network round trip. Expect high hundreds of milliseconds when nothing is cached and around 100 ms once the data is warm. Keep an index warm with a periodic query, or split data so each query touches a small index. Why is the first vector search query on S3 slow? measures cold, warm and cached latency.
What about the files the vectors came from?
The vectors are only half of it. If your source is images, video, audio or PDFs in S3, something has to read each file, cut it into pieces, embed every piece and keep the vector linked to the file and the timestamp it came from. You can write that pipeline yourself around any of the three options. Mixpeek does it as a managed step: it reads objects from your bucket, runs extractors for text, images, video and audio, and writes the vectors into the store above. See how to make files searchable as soon as they land in S3 and the broader explainer, Can you run a vector database on S3?
Frequently asked questions
Can I store embeddings in a normal S3 bucket?
Yes, as files such as Parquet, NumPy arrays or Lance tables, but a normal bucket cannot search them. A library like LanceDB reads those files and runs the search in your process, or you use an S3 Vectors vector bucket, which is a separate bucket type with its own query API.
How many vectors can Amazon S3 Vectors hold?
Up to 2 billion vectors per index and 10,000 indexes per vector bucket, with 1 to 4,096 dimensions per vector, per AWS's documented limits. Each
query_vectors call returns up to 100 results per
page.Is searching vectors in S3 cheaper than a vector database?
Usually, for storage. S3 Vectors charges $0.06 per GB-month in US East, against memory-resident databases that hold every vector in RAM around the clock. Query cost is the part to model: S3 Vectors bills each query on the size of the index it searches, so a busy, large index can cost more than a fixed-price cluster.
Can I do hybrid keyword and vector search on S3?
With LanceDB, yes, through its full-text index. With a storage-first database such as Mixpeek's, yes, with BM25 and dense vectors in one query. For S3 Vectors, AWS documents similarity search with metadata filters, and its pricing page lists full-text and hybrid query charges, so check what your Region supports.
How do I delete a vector from S3 Vectors?
Call
delete_vectors with the vector bucket, the index and the list of keys. Deletes count
against the same 1,000 write or delete requests a second per index as writes.