A Next.js template that uses Vercel Postgres as the database, Prisma as the ORM with pgvector to enable vector similarity search, and OpenAI's text-embedding-ada-002
model for embeddings,
Llamaindex for indexing pages.
If you like this tool and starter kit, add a star on GitHub and follow me on X @madarco!
https://mada-vector.vercel.app/
One-click Deploy with:
You'll only need to set 3 variables:
- OPENAI_API_KEY: obtain this from your OpenAI console
- ADMIN_USER: pick a username to use to login to the admin area
- ADMIN_PASSWORD: pick a password to use for the admin area
To index new pages, simply add them in the admin area in /admin. To login use your ADMIN_USER and ADMIN_PASSWORD credentials that you previously defined in the env variables.
Use create-next-app
with pnpm to bootstrap the example:
pnpm create next-app --example https://github.com/madarco/mada-vector
Once that's done, copy the .env.example file in this directory to .env.local (which will be ignored by Git):
cp .env.example .env.local
Then open .env.local
and set the environment variables to match the ones in your Vercel Storage Dashboard or run:
vercel env pull
Next, run Next.js in development mode:
pnpm dev
Made by Marco D'Alia @madarco