Name: Lavya Tanotra Roll No: 24BCS10124
An intelligent document Q&A system built on Retrieval-Augmented Generation — upload any document and have an AI-powered conversation with it.
The application follows a four-stage RAG pipeline:
- Ingest — User selects a file (PDF, TXT, or CSV) for upload
- Parse & Chunk — The document is broken into page-level segments using LangChain's document loaders (one chunk per page)
- Embed & Store — Each chunk is converted into a vector using Gemini's embedding model and stored in a Qdrant collection
- Retrieve & Answer — The user's query is embedded, the top 5 closest chunks are fetched, and Gemini generates an answer strictly from that context
Documents are split at the page boundary. Each page becomes an independent chunk, which preserves the natural layout of the source material, keeps related content together, and makes it straightforward to trace answers back to their page of origin.
- Node.js 18 or higher
- A running Qdrant instance (local or hosted)
- Google Gemini API key
npm installCreate a .env file in the root:
GEMINI_API_KEY=your_key_here
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=your_qdrant_key
docker run -p 6333:6333 qdrant/qdrantnpm startVisit http://localhost:3000 in your browser.
| Layer | Technology |
|---|---|
| Backend | Express.js (Node.js) |
| Embeddings | Gemini embedding-001 |
| Vector Store | Qdrant |
| LLM | Gemini 2.5 Flash Lite |
| Frontend | HTML / CSS / Vanilla JS |