# RAG-Based Chatbot
A minimal RAG (Retrieval-Augmented Generation) chatbot that answers questions based on PDF documents using semantic search and a Groq-hosted LLM.
Setup
-
Clone the repository
-
Create virtual environment and install dependencies:```bash
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txt
3. Add your API key to `.env`:```env
GROQ_API_KEY="your-groq-api-key"
-
Add your PDF files to
rag/books/folder -
Index the documents:```bash
cd rag
python vector_store.py
cd ..
6. Run the chatbot:```bash
python rag/reteriver.py
Usage
Type your questions and the bot will answer based on the indexed PDF documents. Type exit or quit to stop.
Project Structure```text
├── rag/
│ ├── books/ # Place your PDF files here
│ ├── loader.py # PDF loading
│ ├── chunker.py # Text chunking
│ ├── embedder.py # Embedding utilities
│ ├── vector_store.py # Document indexing
│ ├── model_config.py # LLM provider/model settings
│ └── reteriver.py # Chatbot interface
├── requirements.txt
└── README.md
```
Notes
- The
qdrant_data/folder is created automatically when you runvector_store.py - You need to re-run
vector_store.pywhenever you add new PDFs - On a new device, add your PDFs to
rag/books/and run the indexing step
