# pgvector or S3 Vectors?

> Where should my embeddings live? Not competitors. pgvector when a user is waiting and results depend on your data. S3 Vectors when the collection is huge, cold or per client.

- A decision guide from The Stack by Nicolas Dao (Cloudless Labs, Sydney)
- Web page: https://cloudlesslabs.com/stack/guides/vectors/. The whole stack in one file: https://cloudlesslabs.com/stack/brief.md
- Tools: [pgvector](https://cloudlesslabs.com/stack/pgvector/index.md) (My default), [Amazon S3 Vectors](https://cloudlesslabs.com/stack/aws-s3-vectors/index.md) (Use when it fits), [Neon (serverless Postgres)](https://cloudlesslabs.com/stack/neon/index.md) (My default)

## Use pgvector when the vectors belong to your app's data and a user is waiting

- Product or document search in an app.
- A support chatbot over a client's knowledge base.
- "Similar items" recommendations, duplicate detection.

You're in pgvector territory when results are filtered by permissions, client, status or dates through SQL joins and row-level security; when you need keyword and semantic search together; when answers must come back in milliseconds (about 3–9 ms); when the collection is a few million vectors at most; and when it runs on a database you already pay for (about $5 a month for 1M vectors on Neon).

## Use S3 Vectors when the collection is huge, cold or split per client

- Searching 10 years of contracts or call transcripts.
- RAG over a document archive.
- Long-term memory for one AI agent per customer.
- A separate index for every client, almost free while idle.

You're in S3 Vectors territory with tens to hundreds of millions of vectors, occasional queries, about 100 ms being fine, and no wish to size or run a server. 100M vectors cost about $76–473 a month there, against $2,000–12,000 to hold them in Postgres RAM. Bedrock Knowledge Bases can use it directly.

## Use both

Keep recent, relational data in pgvector next to the app, send the long tail to S3 Vectors, search both and merge the results (Reciprocal Rank Fusion). Watch Neon's Lakebase Search, which keeps the index on disk and could push pgvector much further.

## Related

- [Semantic search and RAG](https://cloudlesslabs.com/stack/use-cases/search.md): the use case this guide works through
- [pgvector](https://cloudlesslabs.com/stack/pgvector/index.md): the full entry (verdict, pricing, gotchas)
- [Amazon S3 Vectors](https://cloudlesslabs.com/stack/aws-s3-vectors/index.md): the full entry (verdict, pricing, gotchas)
- [Neon (serverless Postgres)](https://cloudlesslabs.com/stack/neon/index.md): the full entry (verdict, pricing, gotchas)
- [Every decision guide](https://cloudlesslabs.com/stack/brief.md): listed at the end of the brief
- [Map of every Markdown file on cloudlesslabs.com, with what each one answers](https://ask.cloudlesslabs.com)
