How gauravk221b/pdf-rag-assistant works
PDF RAG Assistant lets a user upload a text-based PDF, ask a question, and see an answer with the retrieved passages, page references, similarity scores, and provider. The main flow runs through the Streamlit UI into PDF processing and indexing, then query retrieval and LLM generation before results are displayed. Gemini is attempted first, with Groq as fallback. The README documents the retrieval and attribution capabilities; the graph’s implementation links are based on the shown app.py and rag.py excerpts.
Main entry points: rag.py Pipeline builder · app.py Streamlit interface
Components 12
User Interface
- Streamlit interface
app.py
PDF Retrieval
- Pipeline builder
rag.py - PDF extraction
rag.py - Text chunking
rag.py - Embedding generation
rag.py - FAISS index
rag.py - Semantic search
rag.py
Answer Generation
- Answer orchestration
rag.py - LLM fallback dispatcher
rag.py - Gemini API
- Groq API
Other components
- PDF user
Connections 14
- PDF user → Streamlit interface: uploads / asks
README.md - Streamlit interface → Pipeline builder: processes PDF
app.py - Pipeline builder → PDF extraction: extracts pages
rag.py - PDF extraction → Text chunking: chunks text
rag.py - Pipeline builder → Embedding generation: creates embeddings
rag.py - Pipeline builder → FAISS index: builds index
rag.py - Streamlit interface → Answer orchestration: submits question
app.py - Answer orchestration → Semantic search: retrieves top 3
rag.py - Semantic search → FAISS index: searches
rag.py - Semantic search → Embedding generation: encodes query
rag.py - Answer orchestration → LLM fallback dispatcher: sends prompt
rag.py - LLM fallback dispatcher → Gemini API: tries first
rag.py - LLM fallback dispatcher → Groq API: falls back
rag.py - Answer orchestration → Streamlit interface: returns answer and sources
app.py