One-Click RAG: A self-hosted RAG that runs on Vercel + Postgres

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!

Demo

https://mada-vector.vercel.app/

How to Install

One-click Deploy with:

Deploy with Vercel

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

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.

Local Installation

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