How jakkenasrikar/rag-document-qa-chatbot works
This is a Streamlit PDF question-answering application. Users upload PDFs for extraction, traceable chunking, embedding, and persistent indexing; questions are retrieved against those chunks and answered by a configurable, grounded LLM, with page-level citations shown in the UI. The app also supports document deletion, database reset, provider selection, and session chat history. The graph follows sampled calls and README-documented capabilities; some app wiring and feature details are documented but not present in the excerpts.
Main entry points: app.py Streamlit App · chain.py RAG Chain · components.py UI Components · chroma_store.py Vector Store Manager
Components 16
User Interface
- Streamlit App
app.py - UI Components
ui/components.py - Chat Session
app.py
Document Ingestion
- PDF Extraction
ingestion/pdf_loader.py - Text Chunking
ingestion/text_splitter.py
Retrieval and Storage
- Embedding Factory
embeddings/embedding_model.py - Vector Store Manager
vectorstore/chroma_store.py - Persistent ChromaDB
data/chroma - Document Retriever
retrieval/retriever.py
Answer Generation
- RAG Chain
rag/chain.py - LLM Factory
generation/llm.py - Grounded Answer and Citations
rag/chain.py
Other components
- User
- Settings
config/settings.py - Embedding Service
- LLM Service
Connections 21
- User → Streamlit App: uploads or asks
- Streamlit App → UI Components: renders controls
- Streamlit App → Settings: reads configuration
- Streamlit App → Chat Session: maintains history
- Streamlit App → PDF Extraction: extracts uploads
- PDF Extraction → Text Chunking: page documents
- Streamlit App → Text Chunking: chunks pages
- Streamlit App → Embedding Factory: selects embeddings
- Embedding Factory → Embedding Service: creates provider
- Streamlit App → Vector Store Manager: checks, indexes, manages
- Vector Store Manager → Persistent ChromaDB: reads and writes
- Streamlit App → Document Retriever: creates retriever
- Document Retriever → Vector Store Manager: searches chunks
- Streamlit App → LLM Factory: selects model
- LLM Factory → LLM Service: creates provider
- Streamlit App → RAG Chain: requests answer
- RAG Chain → Document Retriever: retrieves scored chunks
- RAG Chain → LLM Service: generates grounded answer
- RAG Chain → Grounded Answer and Citations: returns answer and sources
- Streamlit App → UI Components: displays citations
- UI Components → User: shows response