GenRAG is an AI-powered document intelligence system that implements Retrieval-Augmented Generation (RAG) from scratch. Built without high-level frameworks like LangChain or vector databases, it features a modern GUI, semantic search through 1,400+ text chunks, and AI-powered responses. The system processes PDFs, generates embeddings, and provides instant answers to questions about document content with sub-millisecond search speeds.
- 🎨 Modern GUI: GitHub-inspired dark theme interface
- 📄 PDF Processing: Automatic text extraction and chunking
- 🧠 Smart Embeddings: Sentence-BERT powered semantic search
- ⚡ Fast Search: Sub-millisecond query processing
- 🤖 AI Responses: Google Gemini API integration
- 💾 Lightweight: CSV-based storage (no vector database needed)
- 🔧 Python 3.8+ Compatible: Works on older Python versions
-
Clone the repository:
git clone https://github.com/AkprasadoP/GenRAG.git cd GenRAG -
Create and activate a virtual environment:
python -m venv env call env\Scripts\activate # On Windows # source env/bin/activate # On Linux/Mac
-
Install compatible dependencies:
pip install -r requirements_minimal.txt
-
Generate Embeddings (The PDF is already included):
python create_embeddings_auto.py
This will process "The Intelligent Investor" PDF and create embeddings.
-
Configure Gemini API (Optional for enhanced responses):
- Edit
.envfile and add your API key:GEMINI_API_KEY=your_actual_api_key_here
- Edit
python app.pyOr simply double-click run.bat
python main.pypython test_rag.pyYou can use both a local LLM or an LLM from an API like Gemini for generating responses.
-
Local LLM: If you have the capability to run a local LLM, you can use it for generating responses. Cause mine is too slow :(
-
LLM from API: If your system is not powerful enough for local inference, you can use an API like Gemini. To do this, create a
.envfile and pass the Gemini API key.
- Get your API key from Google AI Studio
- Edit the existing
.envfile:GEMINI_API_KEY=your_actual_api_key_here
- Restart the application to use enhanced AI responses
Note: The system works perfectly with fallback responses even without the API key.
Ashish Prasad - @AkprasadoP
This project is developed and maintained by Ashish Prasad.
Special thanks to the following YouTube channels and research papers for their invaluable resources and insights:
- Patrick Lewis ., "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks" arXiv:2005.11401
- Vaswani et al., "Attention is All You Need" arXiv:1706.03762
- Reimers et al., "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks" arXiv:1908.10084
This project is licensed under the MIT License - see the LICENSE file for details.