How krishna-118/document_reader works
This is a Streamlit academic textbook assistant: users upload PDFs, process them into a searchable vector store, then ask questions answered from retrieved textbook context. PDF extraction, chunking, embedding, and indexing form the ingestion stage; query handling uses chat history, retrieval, and a context-constrained answer chain before displaying the answer and source metadata. The graph reflects the shown calls; framework-internal behavior is represented only where the app configures or invokes it.
Main entry points: app.py Query Orchestration · utils.py PDF Processing
Components 13
User Interface
- Streamlit App
app.py - Answer and Sources
app.py
PDF Ingestion
- PDF Processing
utils.py - PDF Loader
utils.py - Text Splitter
utils.py - Text Embeddings
utils.py - FAISS Index
utils.py
Question Answering
- Query Orchestration
app.py - Chat History
app.py - History-Aware Retriever
app.py - Answer Chain
app.py
Other components
- User
- Groq LLM
Connections 14
- User → Streamlit App: uploads or asks
app.py - Streamlit App → PDF Processing: calls processing
app.py - PDF Processing → PDF Loader: loads PDFs
utils.py - PDF Processing → Text Splitter: splits documents
utils.py - PDF Processing → Text Embeddings: creates embeddings
utils.py - PDF Processing → FAISS Index: indexes chunks
utils.py - Streamlit App → Query Orchestration: handles query
app.py - Query Orchestration → Chat History: reads and updates
app.py - Query Orchestration → FAISS Index: creates retriever
app.py - Query Orchestration → History-Aware Retriever: configures and invokes
app.py - Query Orchestration → Answer Chain: configures and invokes
app.py - Query Orchestration → Groq LLM: configures model
app.py - Query Orchestration → Answer and Sources: displays result
app.py - History-Aware Retriever → Answer Chain: supplies context
app.py