How g-sri-harshit/ai-pdf-chatbot works
This is a PDF RAG chatbot with a Streamlit upload-and-question workflow and a separate command-line workflow. Documents are extracted into text, table rows, and OCR text; the app chunks applicable content, embeds it, stores vectors, retrieves context for a question, and asks a local Ollama model for an answer. The graph includes the documented OCR and table capabilities. Source excerpts show the main calls; the CLI workflow is represented from its excerpt, while external model services are shown only where their use is explicit.
Main entry points: app.py Streamlit workflow · main.py CLI workflow · pdf_reader.py PDF extraction · query.py Prompt and response
Components 11
User workflows
- Streamlit workflow
app.py - CLI workflow
main.py
PDF processing
- PDF extraction
pdf_reader.py - Table extraction
pdf_reader.py - Image OCR
pdf_reader.py - Text chunking
chunking.py
Embedding and retrieval
- Text embeddings
embedding.py - Vector store
vector_store.py
Answer generation
- Prompt and response
query.py
Other components
- PDF user
- Ollama service
Connections 16
- PDF user → Streamlit workflow: uploads PDF
README.md - Streamlit workflow → PDF extraction: extracts content
app.py - PDF extraction → Table extraction: extracts tables
pdf_reader.py - PDF extraction → Image OCR: runs OCR
pdf_reader.py - Streamlit workflow → Text chunking: chunks text
app.py - Streamlit workflow → Text embeddings: embeds text
app.py - Streamlit workflow → Vector store: adds vectors
app.py - Streamlit workflow → Text embeddings: embeds question
app.py - Streamlit workflow → Vector store: searches vectors
app.py - Streamlit workflow → Prompt and response: requests answer
app.py - Prompt and response → Ollama service: posts prompt
query.py - CLI workflow → PDF extraction: extracts content
main.py - CLI workflow → Text chunking: chunks text
main.py - CLI workflow → Text embeddings: embeds text
main.py - CLI workflow → Vector store: adds and searches
main.py - CLI workflow → Prompt and response: requests answer
main.py