Prisma Blog
Read post

You Don't Need a Vector Database, Postgres Already Has pgvector

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

pgvector is a Postgres extension that adds a vector column type and cosine similarity operators, enabling semantic search directly in Postgres without a dedicated vector database like Pinecone or Weaviate. The post walks through building a semantic search demo using Prisma Next and its @prisma-next/extension-pgvector pack, which provides type-safe vector operations, a Vector<N> type tied to declared dimensions, and automatic extension migration. The tutorial covers spawning a temporary Prisma Postgres database, declaring a schema with a vector column, inserting embeddings, and querying by cosine similarity — all with compile-time type checking. A comparison table outlines when pgvector is sufficient (up to a few million vectors, apps already on Postgres) versus when a dedicated vector engine is warranted (billion-scale ANN, hybrid search features).

    #postgresql#vector-search#prisma#pgvector
Jul 17•11m read time•From prisma.io
Post cover image
Table of contents
What an embedding isWhat cosine similarity measuresWhat pgvector isVectors with a type systemBuild the demoWhat the compiler catchesSwap in real embeddingsPostgres with pgvector vs. a dedicated vector databaseWhen to use itWhen not to use itFrequently asked questionsRecap
241 Impressions
Prisma Blog's image
Prisma Blog

13 Followers

•

88 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard