How vijaykumar-devcode/llm-question-answering-chatbot works
DocuMind is a Streamlit document-QA app. Users upload PDFs, process them into a locally persisted FAISS index, then ask questions; retrieval supplies document context and conversation history to Gemini, and the UI shows answers with citations. The graph separates ingestion, indexing, retrieval, and answer generation, with utilities as an internal support layer. The README documents the overall pipeline; source excerpts confirm key calls and implementations. Some components are distinct responsibilities within the same module, not separate files.
Main entry points: chatbot.py RAG orchestration · app.py Streamlit app · vector_store.py FAISS index · pdf_loader.py PDF extraction
Components 16
User interface
- Streamlit app
app.py - Chat session
app.py
Document ingestion
- PDF upload
app.py - PDF extraction
pdf_loader.py - Uploaded files
utils.py
Indexing and retrieval
- Text chunking
vector_store.py - HuggingFace embeddings
vector_store.py - FAISS index
vector_store.py - Index persistence
vector_store.py - Similarity retrieval
vector_store.py
Grounded answering
- RAG orchestration
chatbot.py - Grounding prompt
prompt.py - Google Gemini
- Source citations
chatbot.py
Application support
- Environment and validation
utils.py
Other components
- User
Connections 23
- User → PDF upload: selects PDFs
README.md - User → Chat session: asks questions
README.md - PDF upload → Streamlit app: submits files
app.py - Streamlit app → PDF extraction: loads PDFs
app.py - PDF extraction → Uploaded files: saves uploads
pdf_loader.py - PDF extraction → Text chunking: passes pages
README.md - Streamlit app → FAISS index: builds index
app.py - Text chunking → HuggingFace embeddings: creates vectors
README.md - HuggingFace embeddings → FAISS index: indexes vectors
README.md - FAISS index → Index persistence: saves locally
vector_store.py - Index persistence → FAISS index: loads index
vector_store.py - Streamlit app → Index persistence: loads saved index
app.py - Chat session → RAG orchestration: invokes question
app.py - RAG orchestration → Similarity retrieval: retrieves chunks
chatbot.py - Similarity retrieval → FAISS index: searches index
README.md - RAG orchestration → Grounding prompt: formats prompt
chatbot.py - RAG orchestration → Google Gemini: generates answer
README.md - RAG orchestration → Source citations: extracts references
chatbot.py - Source citations → Streamlit app: renders citations
app.py - RAG orchestration → Chat session: returns answer
app.py - PDF extraction → Environment and validation: validates and saves
pdf_loader.py - Streamlit app → Environment and validation: checks configuration
app.py - RAG orchestration → Environment and validation: gets API key
chatbot.py