InspirationIn math- and theory-heavy courses like Linear Algebra and Discrete Mathematics, cramming across long slide decks and 600-page textbooks makes it hard to tell what we actually know. General chatbots don't know our syllabus, can hallucinate, and forget our weak areas—so we built StudyBuddy AI, a grounded study assistant that answers from our files with citations, generates deduplicated notes and shuffled quizzes, tracks weak spots, and builds an exam revision plan.How We Built ItWe built the app with Python, Streamlit, SQLite, and LLMs (Google Gemini and Groq):Ingestion & Topic Curation (ingest.py, topics.py): We parse PDFs, slides, and Word docs into passages (up to 1,400 chars), group example/exercise slides under preceding concepts, and use the LLM (with deterministic fallbacks) to filter out front/back matter and organize topics.Grounded Q&A, Notes & Quizzes (retrieval.py, features.py): We use scikit-learn TF-IDF and cosine similarity to pull top passages with inline citations (or abstain when relevance is low), track bold terms to avoid repeated definitions across combined notes, validate quiz JSON, and shuffle answer choices.Mastery & Exam Planner (store.py): We track progress in SQLite using recency weights $w = 0.5^{\frac{\Delta t}{7}}$, Laplace-smoothed mastery $\text{Mastery} = \frac{\sum w_i c_i + 1}{\sum w_i + 2}$, and weakness $\text{Weakness} = (1 - \text{Mastery}) + 0.04 \cdot \min(n_{\text{confused}}, 5)$, allocating study days by $(\text{Weakness} + 0.1)^2$ with a final mock quiz day.Challenges & What We LearnedTesting on real materials—a 63-slide deck on relations plus Linear Algebra and Discrete Math textbooks—exposed us to noisy topics, inconsistent LaTeX/citation formatting (mathfmt.py), repeated notes, and free-tier rate limits, which we solved with pacing, caching, fallback models, and an offline demo mode. We learned that combining deterministic Python with targeted LLMs is far more reliable than pure LLM workflows. Together, Hasan, Saad, Irtaza, Umar, and Abdur Rehman collaborated closely, contributed across the build, and had a great time bringing it to life.

Built With

  • claude
  • friends
  • python
  • studio
  • visual
Share this project:

Updates

Submission history