vtayyab6/retrieval-augmented-document-qa
0
Retrieval-Augmented Document QA
A Gradio application that lets users upload documents, build a semantic FAISS index, and ask grounded questions answered by Gemini with retrieved context.
Features
Project Structure
retrieval-augmented-document-qa/
├── app.py
├── requirements.txt
├── README.md
└── src/
├── __init__.py
├── config.py
├── document_loader.py
├── chunker.py
├── embeddings.py
├── vector_store.py
├── retriever.py
├── rag_pipeline.py
└── gemini_client.pyHow It Works
- Upload up to 3 files (
.pdf,.txt,.md). - Click Process Documents to build the knowledge base.
- Enter your Gemini API key and question.
- Click Ask Question.
- Review:
- final answer
- retrieved chunks
- sources used
- execution trace
Local Setup
cd retrieval-augmented-document-qa
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python app.pyOpen http://127.0.0.1:7860.
Notes
- This app runs fully on CPU and is designed for Hugging Face Spaces demos.
- Retrieval controls answer grounding; if context is missing, the app prompts Gemini to say so.
