
A simple Next.js chatbot app to demonstrate the use of embedding models for RAG through the Vercel AI Gateway.
Paste any facts or docs into the chat and this app will chunk them, generate embeddings via the Vercel AI Gateway, and store them as vectors in Neon. When you ask a question, your query is embedded and the app performs a cosine-similarity search to pull the most relevant chunks. The model then answers using only the retrieved snippets, demonstrating semantic retrieval (RAG).
pnpm i -g vercel)git clone <repo-url>vc link or vc deployvc env pullpnpm i (or npm i or yarn i)pnpm db:migrate && pnpm db:pushvc dev and open http://localhost:3000 to try the chatbotvc dev, you'll need to run vc env pull to fetch the project's OIDC authentication token locally
vc dev it will auto-refresh the token for you, so you don't need to fetch it manuallyThis repository is maintained by the Vercel team and community contributors.
Contributions are welcome! Feel free to open issues or submit pull requests to enhance functionality or fix bugs.