Smart Document Q&A with Retrieval-Augmented Generation (RAG)
This project allows you to upload large PDF documents (300+ pages) and ask questions in plain English.
It uses Retrieval-Augmented Generation (RAG) to provide accurate, context-aware answers.
- π Students β Query textbooks, syllabi, research papers
- π¨βπΌ Professionals β Analyze contracts and reports
- π¬ Researchers β Search academic documents
- π Teachers β Build interactive Q&A systems
- π Supports large PDFs (300+ pages)
- π Semantic search using embeddings
- π§ Efficient RAG pipeline
- β‘ Ultra-fast inference with Groq
- π¬ Clean and responsive UI
- π API key stays local (secure)
PDF β Chunking β Embeddings β FAISS Index
β
User Query β Embedding β Top-K Retrieval β Groq LLM β Answer
| Technology | Purpose |
|---|---|
| Flask | Backend framework |
| Groq API | LLM inference |
| Sentence Transformers | Text embeddings |
| FAISS | Vector search |
| PyPDF2 / pdfplumber | PDF extraction |
- Python 3.8+
- Git
- Groq API Key
git clone https://github.com/ysujith728/groq-chatbot-rag.git cd groq-chatbot-rag
# Create virtual environment python -m venv venv # Activate (Windows) venv\Scripts\activate # Activate (Mac/Linux) source venv/bin/activate
pip install -r requirements.txt
# Create .env file GROQ_API_KEY=your_api_key_here
python app.py
Open: http://localhost:5000
- What are the course outcomes?
- List all programming languages taught
- What is the credit distribution?
- Summarize the objectives
- What AI electives are available?
| Metric | Value |
|---|---|
| Max PDF Size | 100MB |
| Pages | ~500 |
| Chunk Size | 1500 chars |
| Response Time | 2β5 sec |
| Embedding Model | all-MiniLM-L6-v2 |
groq-chatbot-rag/
β
βββ app.py
βββ requirements.txt
βββ .env.example
βββ README.md
βββ LICENSE
β
βββ templates/
β βββ index.html
β
βββ uploads/ (ignored)
βββ chunks/ (ignored)
βββ screenshots/
βββ demo.png
RAG not working
pip install sentence-transformers faiss-cpu numpy
API Key issue
GROQ_API_KEY=your_key
PDF issue
- Ensure PDF has selectable text (not scanned)
- Fork the repo
- Create branch:
feature/your-feature - Commit changes
- Push and open PR
MIT License
- β Star the repo
- π Share it
- π€ Contribute
Groqβs ultra-fast inference engine
