This project is a RAG-based chatbot built with Next.js, OpenAI, Qdrant, and Postgres.
It allows users to upload documents (PDF, CSV, DOC), provide a website URL, or enter raw text, and then chat with them in natural language.
Live URL: https://notebook-llm-rag.vercel.app/
- Users upload files, enter text, or provide a website URL.
- The content is chunked and converted into vector embeddings using OpenAI.
- Embeddings are stored in Qdrant Vector DB for semantic search.
- Metadata and chat history are stored in Postgres DB.
- On each query, relevant chunks are retrieved from Qdrant and passed to OpenAI, which generates accurate and context-aware responses.
- Upload files (
.pdf,.csv,.doc) - Add website URLs or paste raw text
- Store embeddings in Qdrant DB
- Persist metadata & chat history in Postgres DB
- Chat with your custom knowledge base in real time
- Built on Next.js App Router
Create a .env.local file in the root of your project with the following variables:
# OpenAI
OPENAI_API_KEY=your_openai_api_key
# Qdrant configuration
QDRANT_URL=your_qdrant_instance_url # e.g., http://localhost:6333 or cloud URL
QDRANT_API_KEY=your_qdrant_api_key # if authentication is enabled
# Postgres database
DATABASE_URL=postgresql://user:password@localhost:5432/yourdbThis is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.