How aliraza-amjad-shaikh/rag-document-qa works
This is a Streamlit RAG document Q&A app. Users provide an OpenAI key, upload PDFs or images, and ask questions to receive cited, confidence-scored answers or a low-confidence fallback. The documented workflow routes overview questions to stored summaries and specific questions through retrieval. The README supplies several workflow details not visible in the partial excerpts; unsampled implementation links are therefore limited to those explicitly documented.
Main entry points: app.py Streamlit interface · ingestion.py Ingestion orchestration · retrieval.py Vector retrieval · config.py App configuration
Components 15
App and access
- Streamlit interface
app.py - Key validation
auth.py
Document ingestion
- Ingestion orchestration
ingestion.py - PDF extraction
ingestion.py - Image analysis
ingestion.py - Semantic chunking
ingestion.py - Document summaries
ingestion.py
Question answering
- Vector retrieval
retrieval.py - FAISS index
retrieval.py - Query routing
retrieval.py - Answer generation
generation.py
Document state
- Summary store
document_store.py
Runtime configuration
- App configuration
config.py
Other components
- User
- OpenAI API
Connections 24
- User → Streamlit interface: uses
README.md - Streamlit interface → Key validation: validates key
app.py - Key validation → OpenAI API: tests key
auth.py - Streamlit interface → Ingestion orchestration: starts ingestion
app.py - Ingestion orchestration → PDF extraction: routes PDFs
README.md - Ingestion orchestration → Image analysis: routes images
README.md - PDF extraction → Semantic chunking: supplies text
README.md - Image analysis → Semantic chunking: supplies text
README.md - Semantic chunking → Vector retrieval: indexes chunks
README.md - Ingestion orchestration → Document summaries: creates summaries
README.md - Document summaries → Summary store: stores summary
ingestion.py - Streamlit interface → Query routing: classifies question
app.py - Query routing → Summary store: routes overview
README.md - Streamlit interface → Vector retrieval: requests chunks
app.py - Vector retrieval → FAISS index: searches index
retrieval.py - Vector retrieval → OpenAI API: embeds query
retrieval.py - Streamlit interface → Answer generation: generates response
app.py - Answer generation → Summary store: reads summaries
generation.py - Answer generation → OpenAI API: requests answer
generation.py - Streamlit interface → App configuration: uses settings
app.py - Key validation → App configuration: uses model setting
auth.py - Ingestion orchestration → App configuration: uses ingestion settings
ingestion.py - Vector retrieval → App configuration: uses retrieval settings
retrieval.py - Answer generation → App configuration: uses model setting
generation.py