At the end of this tutorial, you should be able to set up your own vector search with text embeddings in a Next.js app. This is a tutorial that mostly consists of coding samples taken directly from the Sanity codebase.
You can see the results right here on Sanity. The related posts section underneath each post is generated with pgvector. So is the search.
The stack I used:
This step is needed to get Prisma to cooperate with Next.js.
// Setting up prisma