How dummycodertech/campusbrain_chatbot works
Campus Brain is a Streamlit PYQ study assistant: students provide a paper by upload or URL, the app extracts and caches its text, then offers revision materials, predictions, and question answering. The graph preserves the README’s major capabilities and the source-indexed call relationships. Some feature internals and app wiring are unsampled; those relationships are shown only where the README or source index supports them.
Main entry points: action_buttons.py Study controls · app.py Streamlit app · cache_store.py SQLite cache · chat_box.py Chat interface
Components 31
App and interface
- Streamlit app
app.py - Study controls
components/action_buttons.py - Chat interface
components/chat_box.py - Theme
components/theme.py - Usage meter
components/usage_meter.py
Paper ingestion
- Ingestion coordinator
ingestion/cache_writer.py - PDF page extraction
ingestion/pdf_to_images.py - OCR and subject tagging
ingestion/ocr_tagger.py - Safe PDF fetch
ingestion/safe_fetch.py - Subject reference
ingestion/subject_reference.py
Study features
- Paper summaries
generation/summary.py - MCQ quizzes
generation/quiz.py - Flashcards
generation/flashcards.py - Answer checker
generation/answer_checker.py - Topic tagging
generation/topic_tagger.py - Question preparation
generation/question_prep.py - Topic heatmap
generation/topic_heatmap.py - Top questions
generation/topic_questions.py - Exam predictor
generation/predictor.py - Mock paper generator
generation/mock_paper.py - Paper and syllabus Q&A
generation/qa.py - Intent router
router/intent_router.py
Retrieval and cache
- Paper lookup
retrieval/paper_lookup.py - Subject lookup
retrieval/subject_lookup.py - SQLite cache
storage/cache_store.py
AI and web services
- Groq model service
services/llm_client.py - Tavily search
services/web_search.py
Other components
- Student
- Embedding host
- PDF source
- Tavily API
Connections 48
- Student → Streamlit app: uses
README.md - Embedding host → Streamlit app: passes paper parameters
README.md - Student → Streamlit app: uploads PDF
README.md - Streamlit app → Ingestion coordinator: starts ingestion
app.py - Streamlit app → Theme: applies theme
app.py - Streamlit app → Study controls: renders controls
app.py - Streamlit app → Chat interface: renders chat
app.py - Streamlit app → Paper lookup: looks up paper
app.py - Streamlit app → SQLite cache: reads paper state
app.py - Streamlit app → Usage meter: shows usage
app.py - Ingestion coordinator → Safe PDF fetch: fetches PDF
ingestion/cache_writer.py - PDF source → Safe PDF fetch: provides bytes
README.md - Ingestion coordinator → PDF page extraction: splits pages
ingestion/cache_writer.py - Ingestion coordinator → OCR and subject tagging: extracts and tags
ingestion/cache_writer.py - Ingestion coordinator → Subject reference: loads subject list
ingestion/cache_writer.py - Ingestion coordinator → SQLite cache: writes page text
ingestion/cache_writer.py - Study controls → Paper summaries: generates
components/action_buttons.py - Study controls → MCQ quizzes: generates
components/action_buttons.py - Study controls → Flashcards: generates
components/action_buttons.py - Study controls → Answer checker: checks answers
components/action_buttons.py - Study controls → Topic tagging: tags topics
components/action_buttons.py - Study controls → Topic heatmap: renders heatmap
components/action_buttons.py - Study controls → Top questions: shows recurring questions
components/action_buttons.py - Study controls → Exam predictor: predicts topics
components/action_buttons.py - Study controls → Mock paper generator: builds mock paper
components/action_buttons.py - Study controls → SQLite cache: loads papers
components/action_buttons.py - Chat interface → Intent router: routes free text
components/chat_box.py - Chat interface → Paper and syllabus Q&A: answers questions
components/chat_box.py - Chat interface → Paper summaries: handles summary intent
components/chat_box.py - Chat interface → MCQ quizzes: handles quiz intent
components/chat_box.py - Chat interface → Flashcards: handles flashcard intent
components/chat_box.py - Topic tagging → Question preparation: prepares questions
generation/topic_tagger.py - Exam predictor → Topic heatmap: uses topic frequencies
generation/predictor.py - Exam predictor → Top questions: uses question history
generation/predictor.py - Paper lookup → SQLite cache: reads papers
retrieval/paper_lookup.py - Subject lookup → SQLite cache: reads subjects
retrieval/subject_lookup.py - Paper summaries → SQLite cache: uses output cache
generation/summary.py - MCQ quizzes → SQLite cache: uses output cache
generation/quiz.py - Flashcards → SQLite cache: uses output cache
generation/flashcards.py - Topic tagging → SQLite cache: reads and saves tags
generation/topic_tagger.py - Paper summaries → Groq model service: generates text
README.md - MCQ quizzes → Groq model service: generates questions
README.md - Flashcards → Groq model service: generates cards
README.md - Answer checker → Groq model service: evaluates answer
generation/answer_checker.py - Topic tagging → Groq model service: assigns topic tags
generation/topic_tagger.py - Paper and syllabus Q&A → Groq model service: answers with model
generation/qa.py - Paper and syllabus Q&A → Tavily search: searches knowledge
generation/qa.py - Tavily search → Tavily API: searches web
services/web_search.py