Inspiration

Like every BTech student juggling midterm week, we showed up to our Operating Systems midterm with 12 lecture PDFs, a 3-hour YouTube playlist, two slide decks, and a mess of half-remembered Google searches from the night before.

The problem wasn't a lack of study material — it was trust.

When a generic LLM gives an answer, how can a student know whether that answer actually came from their lecture slides, textbook, or some unrelated source?

We wanted to build the study companion we wished we had during that midterm.

That's how we created StudyBuddy AI, a source-grounded AI tutor that answers questions using the student's own course material, provides provenance such as page numbers, slide numbers, and video timestamps, and continuously adapts to the learner's strengths and weaknesses.

Don't just give students an answer. Show them where the answer came from and what they should study next.


What it does

StudyBuddy AI turns a collection of course resources into an interactive, personalized learning environment.

📚 Source-Grounded Chat

Students can upload course materials such as:

  • PDF lecture notes
  • PowerPoint presentations
  • Video/lecture content

The system retrieves relevant course content before generating an answer.

Each source-backed response can provide:

  • PDF page number
  • PowerPoint slide number
  • Video timestamp

This allows students to verify the answer directly against their study material.

🟢 Source-Backed / 🔴 Unsourced Answers

StudyBuddy explicitly distinguishes between information supported by the uploaded course material and information that falls outside the available knowledge base.

This prevents students from confusing general AI knowledge with information actually taught in their course.

🧠 Adaptive Learner Model

Every quiz answer and cited interaction can update topic-level mastery.

Our mastery update uses:

$$ \begin{align*} \alpha &= 0.35 \ B &= 0.18 \ P &= 0.28 \end{align*} $$

For a correct signal:

$$ \hat{p} \leftarrow \min(0.995,\ p + B(1-p)) $$

For a wrong signal:

$$ \hat{p} \leftarrow \max(0.05,\ p - Pp) $$

An exponential moving average is also maintained:

$$ EMA_{new}=(1-\alpha)EMA_{old}+\alpha\cdot score $$

The result is displayed through the learner's mastery dashboard.

📝 Adaptive Quizzes

StudyBuddy generates:

  • Multiple-choice questions
  • Short-answer questions
  • Numerical questions

Questions are grounded in the same cited course material used by the tutor.

Short answers use a combined keyword and ideal-answer similarity score:

$$ score=0.6\cdot keyword_overlap+0.4\cdot ideal_overlap $$

A score of at least $0.50$ is considered correct.

📅 Personalized Study Schedule

Topic mastery determines the recommended review interval:

$$ gap_days= \begin{cases} 1,&\hat{p}<0.40\ 3,&0.40\leq\hat{p}<0.70\ 7,&\hat{p}\geq0.70 \end{cases} $$

$$ next_review = today + gap_days $$

Weak topics are therefore brought back sooner, while stronger topics receive longer review intervals.

🗺️ Course Flow Map

StudyBuddy represents prerequisite relationships between concepts as a visual DAG, helping students understand which concepts should be learned before others.

🔍 Evaluation

We created an Operating Systems gold set containing in-scope and off-topic questions and implemented six RAGAS-style evaluation metrics:

  • Context precision
  • Context recall
  • Answer relevancy
  • Faithfulness
  • Scope accuracy
  • Keyword hit rate

We also simulated beginner, average, and advanced learner profiles across multiple sessions to evaluate mastery gains and question repetition.


How we built it

The backend is built with Python 3.11 and FastAPI.

The document-processing pipeline uses:

  • pdfplumber for PDFs
  • python-pptx for PowerPoint files
  • whisper-timestamped for timestamped speech transcription when available

Course content is divided into retrievable chunks. Each chunk is associated with topics, concepts, prerequisites, and provenance information.

For retrieval, we use:

  • ChromaDB for vector search
  • Sentence Transformers (all-MiniLM-L6-v2) for local embeddings
  • SQLite in WAL mode for structured learner and application data

The chat pipeline follows:

Upload → Parse → Chunk → Embed → Retrieve → Scope Check → Generate Answer → Attach Citations → Update Mastery

The frontend is built with Next.js 14, TypeScript, and Tailwind CSS.

The application includes interfaces for:

  • Uploading course material
  • Grounded chat
  • Adaptive quizzes
  • Learner mastery
  • Study scheduling
  • Flashcards
  • Course prerequisite mapping
  • Evaluation benchmarks
  • Knowledge-base browsing

We also implemented question de-duplication using a normalized question fingerprint:

$$ fingerprint = SHA\text{-}1(qtype\Vert ":"\Vert normalized_question) $$

The fingerprint is stored with a UNIQUE constraint in SQLite to prevent repeated questions across assessments.


Challenges we ran into

1. Maintaining provenance across different file types

PDFs naturally provide page numbers, PowerPoint files provide slide numbers, and Whisper provides video timestamps.

However, a single retrieved chunk can span multiple pages, slides, or video segments.

We solved this by making page, slide, and video timing information optional but consistently available whenever applicable.

2. Preventing repeated questions

LLMs can generate multiple versions of essentially the same question.

For example:

"What is a process?"

and

"Define a process."

can test exactly the same knowledge.

We normalized question text and generated a SHA-1 fingerprint before storing questions. This substantially reduced duplicate questions.

3. Prioritizing meaningful weak topics

Initially, topics that a student had never attempted could appear above topics the student had repeatedly answered incorrectly.

We changed the prioritization logic to consider both mastery and attempt history, allowing the system to identify topics the learner repeatedly struggles with.

4. Building evaluation without depending completely on large frameworks

RAG evaluation frameworks can introduce additional dependencies and network requirements.

For our prototype, we implemented lightweight RAGAS-style metrics using reproducible token-level calculations. This made the evaluation pipeline easier to run offline and understand.

5. Cold-start mastery

A new learner initially has very little information in the mastery model.

We addressed this with a diagnostic quiz covering multiple topics. A short initial assessment creates useful mastery estimates that immediately populate the study schedule, dashboard, and weak-topic recommendations.

6. Hackathon network reliability

We wanted the demo to remain functional even when network connectivity was unreliable.

Our prototype therefore supports local embeddings and deterministic fallback behavior for several AI-dependent components.


Accomplishments that we're proud of

  • Built an end-to-end source-grounded AI tutor rather than a generic chatbot.
  • Added page, slide, and timestamp-level provenance to learning responses.
  • Connected tutoring, assessment, mastery tracking, and study scheduling into one learning loop.
  • Implemented an adaptive learner model that updates after both chat interactions and quiz answers.
  • Built a prerequisite-based course flow visualization.
  • Added question de-duplication across assessments.
  • Created an offline-capable demonstration mode for hackathon reliability.
  • Built our own lightweight evaluation pipeline with six RAGAS-style metrics.
  • Simulated different learner profiles to study mastery progression and question repetition.
  • Combined multimodal course ingestion, retrieval, tutoring, assessment, and learner modeling in a single application.

What we learned

1. Provenance matters more than simply producing a good answer

A correct answer without a citation doesn't necessarily help a student learn how to verify information.

Showing where an answer came from teaches students to connect their answers with the actual course material.

2. Scope discipline builds trust

Students need to know when an answer comes from their course material and when it does not.

The distinction between [SOURCE-BACKED] and [UNSOURCED] responses became an important part of the user experience.

3. A learner model is more than a database counter

Updating a mastery probability takes only a small amount of code.

The difficult part is turning that signal into useful experiences:

Mastery → Weak Topics → Quiz → Study Schedule → Review → Updated Mastery

That loop is what makes the learner model useful.

4. Evaluation should be understandable

Our lightweight evaluation implementation helped us understand exactly why a retrieval result received a particular score instead of treating evaluation as a black box.

5. Cold-start design matters

A personalized system is not very useful if the dashboard starts completely empty.

A small diagnostic assessment can provide enough initial information to make the rest of the system useful immediately.


What's next for StudyBuddy

Our next steps are focused on improving grounding, personalization, and interoperability.

🎥 Exact video clickback

Currently, video citations can display timestamps such as ▶ 02:15. We want those citations to directly seek the HTML5 video player to the cited location.

🧩 Semantic question de-duplication

The current fingerprint catches normalized textual duplicates.

We plan to replace or supplement it with Sentence-BERT similarity so that highly similar reworded questions can also be detected.

🎓 LMS integration

We want to export per-topic mastery data through LTI 1.3 outcomes, allowing instructors to integrate learner insights with LMS platforms such as Moodle, Blackboard, and Canvas.

🌐 Multilingual learning

We plan to extend the existing Hindi mixed-language capability to additional Indian languages such as Bengali, Tamil, and Telugu.

🎯 Word-level provenance

Instead of citing only a video segment, we want to use Whisper's word-level timestamps so students can jump directly to the exact portion of a lecture supporting an answer.

Our long-term vision is to make StudyBuddy a trusted learning layer between students and their course material — one that doesn't simply answer questions, but helps students understand, verify, practice, and improve.

Built With

Share this project:

Updates

Submission history