How somyajangir/paperqa-tutor-page-wise-research-assistant works
PaperQA Section Tutor is a Streamlit application for studying uploaded research-paper PDFs. The principal workflow runs from PDF upload and page navigation to page explanations, page-scoped questions, and quizzes with feedback; a separate document-wide RAG chat returns evidence with citations. A fine-tuned local Gemma summarizer and text-to-speech are additional learning capabilities. The graph preserves the README’s major features; some UI-to-agent wiring is only partially excerpted, so uncertain connections are omitted or marked unverified.
Main entry points: app.py Streamlit tutor · indexer.py Document RAG index · page_qa.py Page-scoped Q&A · ingestor.py PDF page extraction
Components 17
Tutor interface
- Streamlit tutor
ui/app.py
Paper processing
- PDF page extraction
agent/ingestor.py - Page text
Retrieval and QA
- Document RAG index
agent/indexer.py - Embedding model
agent/embeddings.py - FAISS search index
- Page-scoped Q&A
agent/page_qa.py
Learning features
- Page explainer
agent/explainer.py - Quiz generation
agent/qg_generator.py - Quiz grading
agent/evaluator.py - Local summarizer
agent/summarizer.py - Speech playback
ui/app.py
Models and logging
- Merged Gemma model
merged_full_model - Interaction logging
agent/logger.py
Other components
- Learner
- Uploaded PDF
- Gemini API
Connections 21
- Learner → Streamlit tutor: uses
README.md - Uploaded PDF → Streamlit tutor: uploads
README.md - Streamlit tutor → PDF page extraction: ingests PDF
ui/app.py - PDF page extraction → Page text: extracts pages
agent/ingestor.py - Streamlit tutor → Document RAG index: builds retrieval
ui/app.py - Document RAG index → Embedding model: encodes chunks
agent/indexer.py - Document RAG index → FAISS search index: stores vectors
agent/indexer.py - Streamlit tutor → Page-scoped Q&A: asks page questions
ui/app.py - Page-scoped Q&A → Embedding model: encodes chunks
agent/page_qa.py - Page-scoped Q&A → Gemini API: synthesizes answers
agent/page_qa.py - Streamlit tutor → Page explainer: requests explanations
ui/app.py - Page explainer → Gemini API: generates explanation
agent/explainer.py - Streamlit tutor → Quiz generation: generates quiz
ui/app.py - Quiz generation → Gemini API: generates questions
agent/qg_generator.py - Streamlit tutor → Quiz grading: submits answers
ui/app.py - Quiz grading → Gemini API: grades answers
agent/evaluator.py - Streamlit tutor → Local summarizer: requests summary
ui/app.py - Local summarizer → Merged Gemma model: loads weights
agent/summarizer.py - Streamlit tutor → Speech playback: plays speech
README.md - Streamlit tutor → Interaction logging: logs interactions
ui/app.py - Streamlit tutor → Learner: shows citations
README.md