An AI-powered Retrieval-Augmented Generation (RAG) Document Assistant that allows users to upload PDF, DOCX, and TXT files and ask questions in natural language. The application retrieves relevant document content using semantic search and generates accurate answers with Google Gemini AI while displaying reference sources.
🌐 Live Application: https://ragdoc-assistant.onrender.com/
- 📄 Upload PDF, DOCX and TXT documents
- 🤖 AI-powered question answering using Google Gemini
- 🔍 Semantic search with vector embeddings
- 🧠 Retrieval-Augmented Generation (RAG)
- ☁️ Supabase Vector Database integration
- 📚 Automatic document chunking
- 📌 Source references with page numbers
- 🗑️ Clear indexed documents
- 🎨 Modern and responsive user interface
- HTML5
- CSS3
- JavaScript
- Python
- Flask
- Google Gemini 2.5 Flash
- Gemini Embedding Model
- LangChain
- Supabase
- pgvector
- PyPDF
- python-docx
RAGDoc_Assistant/
│
├── app.py
├── requirements.txt
├── README.md
├── .gitignore
│
├── data/
├── static/
├── templates/
│
├── landing-page.png
├── main-ui.png
│
└── .env
git clone https://github.com/yourusername/RAGDoc-Assistant.git
cd RAGDoc-Assistantpython -m venv .venvActivate
Windows
.venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the project root.
GEMINI_API_KEY=YOUR_GEMINI_API_KEY
SUPABASE_URL=YOUR_SUPABASE_URL
SUPABASE_KEY=YOUR_SUPABASE_KEY
LLM_PROVIDER=gemini
GEMINI_QA_MODEL=models/gemini-2.5-flash
GEMINI_EMBEDDING_MODEL=models/gemini-embedding-2
FLASK_SECRET_KEY=your_secret_keypython app.pyOpen your browser and visit:
http://127.0.0.1:5000
Upload Document
│
▼
Extract Text
│
▼
Text Chunking
│
▼
Gemini Embeddings
│
▼
Supabase Vector Database
│
▼
User Question
│
▼
Similarity Search
│
▼
Relevant Context
│
▼
Gemini LLM
│
▼
Final Answer with Source References
- Flask
- LangChain
- Google Generative AI
- Supabase
- PyPDF
- python-docx
- Environment variables are stored in a
.envfile. - API keys are never committed to GitHub.
.envis ignored using.gitignore.
- Multiple document collections
- OCR support for scanned PDFs
- User authentication
- Chat history
- Dark mode
- Cloud deployment improvements
- Mobile responsive enhancements
If you found this project helpful, please consider giving it a ⭐ Star on GitHub!# RAGDoc_Assistant

