StudyBuddy AI: Transforming Messy Lecture Notes into Interactive Quizzes with Local Gemma Models

# devchallenge# weekendchallenge# hf26challenge# gemma
StudyBuddy AI: Transforming Messy Lecture Notes into Interactive Quizzes with Local Gemma ModelsBabin Bid

πŸ’‘ The Inspiration & Weekend Theme ("Build for a Friend") As computer science students,...

πŸ’‘ The Inspiration & Weekend Theme ("Build for a Friend")

As computer science students, my friends and I often find ourselves overwhelmed before semester exams and viva voce evaluations. We spend hours reading lengthy PDFs, scattered Markdown summaries, and messy lecture slidesβ€”wishing we had a dedicated tutor to quiz us, point out missing details, and conduct practice mock vivas.

Existing cloud-based AI tools can generate quizzes, but they come with significant drawbacks for students:

  1. API Costs & Rate Limits: Most freemium AI tools quickly hit token limits or require recurring monthly subscriptions.
  2. Privacy Concerns: Class notes, proprietary course slides, and personal summaries get uploaded to centralized servers.
  3. Connectivity Issues: Campus Wi-Fi and hostel networks can be notoriously spotty, rendering web-based AI tools unusable right when you need to cram before an exam.

This weekend, I built StudyBuddy AI for my friends and classmates to solve this exact problem: a 100% local, offline-first study companion that turns any lecture note into interactive practice quizzes, 3D flashcards, and mock viva sessions using open-weight Gemma models.


πŸ› οΈ What I Built: StudyBuddy AI

StudyBuddy AI is a full-stack, local-first web application designed to run seamlessly on a student's laptop without sending a single byte of data to the cloud.

🌟 Key Features

  • 🎯 Interactive Quiz Mode: Automatically extracts key concepts from notes to generate multiple-choice questions (MCQs) with instant visual feedback, step-by-step hints, and explanations.
  • πŸƒ 3D Flashcard Deck: Interactive term/definition cards with smooth 3D flip animations powered by Framer Motion for rapid retention review.
  • πŸŽ“ Mock Viva Practice: Open-ended conceptual prompts where students can practice answering viva questions and evaluate their responses against model answers.
  • πŸ“‚ Multi-Format Ingestion: Drag-and-drop parsing for PDF documents, Markdown files, and plain text notes.
  • πŸ”’ Zero-Cloud & Offline-First: Powered locally by Ollama running open-weight Gemma models (gemma:2b, gemma2:2b, or gemma:7b).

πŸ’» Tech Stack & Architecture

  • Frontend: React 19, Vite, Tailwind CSS v4, Framer Motion, Lucide Icons
  • Backend: Node.js, Express.js (custom file stream parsers & JSON repair middleware)
  • Local AI Inference: Ollama orchestrating Google's Gemma open-weight models

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ πŸ“„ Upload Notes β”‚ ────> β”‚ πŸ” Node Parser  β”‚ ────> β”‚ πŸ€– Ollama / Gemma β”‚
β”‚ (PDF / MD / TXT)β”‚       β”‚ & Text Cleaner  β”‚       β”‚   (Local Engine) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                              β”‚
                                                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ πŸ“Š Interactive  β”‚ <──── β”‚ πŸ”§ Robust JSON  β”‚ <β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚   React 19 UI   β”‚       β”‚   Repair Layer  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

🌍 Why Open Innovation Matters for StudyBuddy AI

Building StudyBuddy AI on open-source foundations wasn't just a technical choiceβ€”it was essential to fulfilling the project's purpose:

  1. Zero Financial Barriers for Students: By leveraging Google's open-weight Gemma models running via Ollama, StudyBuddy AI delivers AI inference without requiring expensive API keys or recurring subscription fees. Any student with a compatible laptop can run smaller Gemma models locally.

  2. Total Data Privacy: Personal class notes, assignment solutions, and university materials can remain entirely on the user's local machine. No cloud-based AI service is required for inference.

  3. True Offline Resilience: University hostels, libraries, and remote areas often lack stable internet access. Because StudyBuddy AI executes inference locally through Ollama, students can study without depending on a continuous internet connection.

  4. Resilience via Open Ecosystems: If a proprietary AI API changes pricing, availability, or access requirements, cloud-dependent applications can be affected. Open-weight models give developers greater control over the AI layer of their applications.


πŸ† Prize Category Opt-In

Best Use of Gemma ($200)

StudyBuddy AI relies on Google's Gemma family of open-weight models (gemma:2b, gemma2:2b, and gemma:7b) served locally via Ollama.

It uses structured prompts and JSON-oriented generation to transform unstructured student notes into:

  • Interactive quiz decks
  • Multiple-choice questions
  • Flashcards
  • Viva questions
  • Model answers
  • Explanations
  • Hints

A JSON repair layer helps make model-generated responses more robust before they are consumed by the frontend.


πŸ“‚ Code Repository & Demo


πŸš€ Quick Start Guide

Want to run StudyBuddy AI locally on your machine?

1. Install & Run Gemma via Ollama

Ensure Ollama is installed, then pull your preferred Gemma model.

For standard laptops, a smaller model such as gemma2:2b can be used:

ollama pull gemma2:2b
Enter fullscreen mode Exit fullscreen mode

You can also use:

ollama pull gemma:2b
Enter fullscreen mode Exit fullscreen mode

or:

ollama pull gemma:7b
Enter fullscreen mode Exit fullscreen mode

Start the Ollama local server:

ollama serve
Enter fullscreen mode Exit fullscreen mode

2. Clone & Install StudyBuddy AI

Clone the repository:

git clone https://github.com/Babin123456/StudyBuddy_AI.git
cd StudyBuddy_AI
Enter fullscreen mode Exit fullscreen mode

Install the frontend dependencies:

npm install
Enter fullscreen mode Exit fullscreen mode

Install the backend dependencies:

cd backend
npm install
cd ..
Enter fullscreen mode Exit fullscreen mode

3. Launch the Application

Open two terminal windows.

Terminal 1 β€” Backend

cd backend
npm run dev
Enter fullscreen mode Exit fullscreen mode

Terminal 2 β€” Frontend

npm run dev
Enter fullscreen mode Exit fullscreen mode

4. Open the Application

Navigate to:

http://localhost:5173

in your browser.

Drag and drop your lecture notes and start preparing for your exams locally.


πŸ”„ How StudyBuddy AI Works

The complete workflow looks like this:

πŸ“„ Lecture Notes
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PDF / Markdown / TXT β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β–Ό
   πŸ” Text Extraction
           β”‚
           β–Ό
   🧹 Text Cleaning
           β”‚
           β–Ό
   🧠 Structured Prompt
           β”‚
           β–Ό
   πŸ€– Gemma via Ollama
           β”‚
           β–Ό
   πŸ”§ JSON Repair Layer
           β”‚
           β–Ό
   πŸ“Š React 19 Interface
           β”‚
     β”Œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”
     β–Ό     β–Ό     β–Ό
   Quiz  Cards  Viva
Enter fullscreen mode Exit fullscreen mode

🎯 The Learning Experience

Instead of simply reading notes repeatedly:

Read β†’ Highlight β†’ Read Again β†’ Forget β†’ Panic
Enter fullscreen mode Exit fullscreen mode

StudyBuddy AI turns the same material into an active learning workflow:

Upload Notes
     ↓
Extract Concepts
     ↓
Generate Questions
     ↓
Practice
     ↓
Identify Weak Areas
     ↓
Review
     ↓
Practice Again
Enter fullscreen mode Exit fullscreen mode

The goal is not to replace studying.

The goal is to make the material students already have more interactive and useful for active recall.


πŸ”’ Privacy-First Design

StudyBuddy AI is designed around a local-first architecture.

The intended processing pipeline is:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Student's Computer         β”‚
β”‚                                     β”‚
β”‚   πŸ“„ Lecture Notes                  β”‚
β”‚          β”‚                          β”‚
β”‚          β–Ό                          β”‚
β”‚   πŸ” Node.js Parser                 β”‚
β”‚          β”‚                          β”‚
β”‚          β–Ό                          β”‚
β”‚   🧹 Text Cleaner                   β”‚
β”‚          β”‚                          β”‚
β”‚          β–Ό                          β”‚
β”‚   πŸ€– Ollama + Gemma                 β”‚
β”‚          β”‚                          β”‚
β”‚          β–Ό                          β”‚
β”‚   πŸ”§ JSON Repair                    β”‚
β”‚          β”‚                          β”‚
β”‚          β–Ό                          β”‚
β”‚   πŸ“Š React Interface                β”‚
β”‚                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

          No required
        cloud AI inference
Enter fullscreen mode Exit fullscreen mode

This means the application can be used without sending lecture notes to a remote AI provider for inference.


🧠 Why Local AI?

Local AI provides several practical advantages for a student-focused application.

Privacy

Study materials can contain:

  • University lecture slides
  • Assignment solutions
  • Personal notes
  • Research material
  • Course-specific documents

Keeping inference local reduces the need to upload these materials to third-party AI services.

Cost

Running an open-weight model locally eliminates the need for a paid AI API for the core inference workflow.

Availability

Once the required software, dependencies, and models are installed, the application can continue operating without requiring a continuous internet connection.

Control

The developer controls:

  • The AI runtime
  • The model selection
  • The prompts
  • The application logic
  • The document-processing pipeline

🧩 Supported Study Modes

🎯 Interactive Quiz Mode

StudyBuddy AI can transform lecture material into multiple-choice questions.

Each question can include:

  • Question
  • Multiple options
  • Correct answer
  • Explanation
  • Hint

This allows students to immediately test their understanding.


πŸƒ 3D Flashcards

Important concepts can be converted into interactive flashcards.

The interface uses smooth 3D animations to create a more engaging revision experience.

A typical card contains:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         β”‚
β”‚       QUESTION          β”‚
β”‚                         β”‚
β”‚   What is a process?    β”‚
β”‚                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

            ↓ Flip

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         β”‚
β”‚         ANSWER          β”‚
β”‚                         β”‚
β”‚ A program in execution. β”‚
β”‚                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

πŸŽ“ Mock Viva Practice

Students can practice open-ended questions similar to those they might encounter during a viva.

The workflow is:

Viva Question
     ↓
Student's Answer
     ↓
Model Answer
     ↓
Comparison
     ↓
Identify Missing Concepts
Enter fullscreen mode Exit fullscreen mode

This encourages students to practice explaining concepts rather than simply recognizing correct answers.


πŸ› οΈ Technology Stack

Layer Technology
Frontend React 19
Build Tool Vite
Styling Tailwind CSS v4
Animation Framer Motion
Icons Lucide Icons
Backend Node.js
API Framework Express.js
AI Runtime Ollama
AI Model Google Gemma
Document Inputs PDF, Markdown, TXT
Architecture Local-first / Offline-first

🌟 What Makes StudyBuddy AI Different?

Traditional Cloud AI Workflow StudyBuddy AI
Cloud AI service Local AI inference
Internet dependency Offline-first design
API keys may be required No AI API key required
Recurring API costs may apply Local model usage
Notes may be uploaded Local processing
General-purpose AI Study-focused workflow
Generic interaction Quiz, flashcards & viva

πŸ”­ Future Roadmap

Future versions of StudyBuddy AI could include:

  • πŸ“ˆ Personalized learning progress
  • 🧠 Adaptive question difficulty
  • 🎯 Weak-topic detection
  • πŸ“š Subject-wise study libraries
  • πŸ“ Advanced document parsing
  • 🎀 Voice-based mock viva
  • πŸ—£οΈ Speech-to-text answers
  • πŸ“Š Detailed performance analytics
  • 🧩 Additional open-weight models
  • πŸ’Ύ Persistent local study history
  • πŸ“΄ Improved offline application packaging
  • πŸ–₯️ Desktop application support

The long-term goal is to evolve StudyBuddy AI into a complete private local AI study environment.


πŸ’­ Why I Built It

The idea came from a simple observation:

Students already have the study material. What they often lack is an interactive way to practice it.

Instead of requiring students to upload their notes to another company's servers, StudyBuddy AI brings the AI directly to the student's machine.

That makes the project particularly useful for students who value:

  • Privacy
  • Accessibility
  • Offline availability
  • Low cost
  • Data ownership
  • Open-source technology

πŸ—οΈ Project Philosophy

StudyBuddy AI follows three simple principles:

1. AI Should Be Accessible

Students shouldn't need expensive subscriptions to experiment with AI-powered learning.

2. Privacy Should Be Built In

A student's lecture notes shouldn't need to leave their computer simply to generate a quiz.

3. Open Technology Creates More Possibilities

Open-weight models such as Gemma allow developers to experiment, build, modify, and integrate AI into applications without depending entirely on proprietary APIs.


πŸ“Š Project Summary

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 STUDYBUDDY AI                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                               β”‚
β”‚  πŸ“„ Input                                     β”‚
β”‚  PDF / Markdown / TXT                         β”‚
β”‚                                               β”‚
β”‚                  ↓                            β”‚
β”‚                                               β”‚
β”‚  πŸ” Processing                                β”‚
β”‚  Node.js + Express                            β”‚
β”‚                                               β”‚
β”‚                  ↓                            β”‚
β”‚                                               β”‚
β”‚  πŸ€– Intelligence                              β”‚
β”‚  Ollama + Gemma                               β”‚
β”‚                                               β”‚
β”‚                  ↓                            β”‚
β”‚                                               β”‚
β”‚  πŸ”§ Structured Output                         β”‚
β”‚  JSON Repair / Validation                     β”‚
β”‚                                               β”‚
β”‚                  ↓                            β”‚
β”‚                                               β”‚
β”‚  πŸ“š Learning                                  β”‚
β”‚  Quiz + Flashcards + Viva                     β”‚
β”‚                                               β”‚
β”‚                  ↓                            β”‚
β”‚                                               β”‚
β”‚  🧠 Active Revision                            β”‚
β”‚                                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

🏁 Final Thoughts

StudyBuddy AI started with a simple weekend challenge:

What if a student could have an AI study companion without sending their notes anywhere?

The result is a local-first learning platform powered by open-weight Gemma models and Ollama.

It combines:

Open AI Models + Local Inference + Student Notes + Interactive Learning

into one privacy-focused study workflow.

The bigger idea is simple:

AI should not always require the cloud.

For students, developers, and privacy-conscious users, local AI can provide a practical alternative to cloud-only applications.


πŸ”— Links


❀️ Built for Students

Built with passion by Babin Bid for the Hacktoberfest 2026 Weekend Challenge.

Because every student deserves a private, offline, and accessible AI study companion.