How srivatsav-k/rag-chat-pgvector works
Project type and purpose
• This is a full‑stack RAG (Retrieval‑Augmented Generation) chatbot starter built on Next.js 14 (App Router).
• It uses the Vercel AI SDK and OpenAI for LLM calls, Drizzle ORM with Postgres+pgvector for embedding storage, and shadcn‑ui/TailwindCSS for styling.
File structure
• app/: Next.js App Router entrypoints
• app/page.tsx, app/layout.tsx, app/globals.css – your React UI and global styles
• app/api/chat/route.ts – serverless API endpoint for chat functionality
• components/: UI primitives (button.tsx, input.tsx, label.tsx) used by pages
• lib/: core business logic
• lib/ai/embedding.ts – embedding utilities
• lib/actions/resources.ts – load/store resource texts and embeddings
• lib/db/** – Drizzle ORM setup, migrations, schema definitions
• lib/utils.ts – shared helpers
• drizzle.config.ts, next.config.mjs, tailwind.config.ts, tsconfig.json – build/config files
• public/ – static assets
README for additional insights
• Confirms the use of Next.js App Router, Vercel AI SDK, OpenAI, Drizzle ORM, Postgres+pgvector, and shadcn‑ui/TailwindCSS.
• Describes a chatbot that “will only respond with information in its knowledge base,” implying a RAG flow: ingest → embed → store → retrieve → generate.