DEV Community

StudyBuddy: an AI study companion for my friend, built on Llama 3.2

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend*

What I Built

Ajay is a university student who often struggles to consolidate lecture notes into actionable study material. Before every exam, they spend hours just trying to come up with potential practice questions, instead of actually learning the concepts.

StudyBuddy AI solves this problem. Itโ€™s a clean, phone-friendly web app where they can upload their course notes and instantly get a set of targeted exam questions sorted by difficulty (2-mark short answers, 5-mark detailed explanations, and Viva/Interview style questions).

Each generated question comes with a hidden suggested answer that they can reveal to test their knowledge. There's also an AI chat feature for instant tutoring on difficult topics, and a flashcard generator to help memorize key definitions.

Demo

Live / Video: Run in your local system as Llama 3.2 does all the heavy lifting. It reads the uploaded text and runs locally through Ollama. Nothing leaves the laptop: no API key, no cloud, no cost.

Here's an example of real output from StudyBuddy AI when notes on "Operating Systems" are uploaded:

๐Ÿ“˜ Q1. What is the difference between a process and a thread? (2 Marks) (Hover to reveal) A process is an independent program in execution with its own memory space, while a thread is a lightweight unit of execution within a process that shares the same memory space.

๐Ÿ“™ Q2. Explain the concept of Virtual Memory and its advantages. (5 Marks) (Hover to reveal) Virtual Memory is a memory management technique that creates the illusion of a large contiguous memory for users, hiding the physical memory limitations. It works by mapping virtual addresses to physical addresses using a page table. Advantages include running programs larger than physical memory, higher degree of multiprogramming, and less I/O for swapping.

Code

StudyBuddy AI

This project was built for the Hacktoberfest Weekend Challenge: Build for a Friend

What I Built

I built StudyBuddy AI, a local, privacy-first AI study companion designed to help my friend prepare for their upcoming university exams.

My friend often struggles to find good practice questions or consolidate their lecture notes into actionable study material. They spend hours just trying to come up with potential exam questions instead of actually studying the concepts. StudyBuddy AI solves this by allowing them to upload their course notes and automatically generating targeted exam questions (short 2-mark questions, detailed 5-mark questions, and even Viva/Interview style questions). It also includes an AI chat feature for instant tutoring on difficult topics, and a flashcard generator to help memorize key definitions.

How I Built It

The project is a modern web application built with:

  • Frontend: Next.js (React) and Tailwind CSS for a sleek, responsiveโ€ฆ

StudyBuddy AI ๐Ÿ“š Upload your notes, and StudyBuddy generates your exam paper. It also acts as an on-demand tutor.

Llama 3.2 does all the heavy lifting. It reads the uploaded text and runs locally through Ollama. Nothing leaves the laptop: no API key, no cloud, no cost.

Run it (2 commands)

bash
ollama run llama3.2
npm run dev
Then open http://localhost:3000.

How I Built It

Llama 3.2 runs the show. Locally, itโ€™s Llama 3.2 running through Ollama. The model handles all the reasoning, question generation, and tutoring. Because it's a local model, there's no fear of rate limits or API bills, which is perfect for a student budget.

Streaming the JSON. Generating detailed 5-mark exam questions takes time. Waiting 20 seconds for a blank screen to load is a bad user experience. To fix this, I implemented an NDJSON streaming parser in Next.js. The server streams chunks from Ollama in real-time, extracts completed JSON objects using regex, and streams the UI components back to the browser progressively. The question cards pop onto the screen one by one as they are generated.

Next.js & Tailwind. The frontend is built on Next.js (App Router) and styled with Tailwind CSS to give it a sleek, modern, "dark mode" aesthetic that's easy on the eyes during late-night study sessions.

Why Does Open Innovation Matter?

Their study material stays with them. Course notes, personal study flaws, and academic weaknesses shouldn't necessarily be shipped off to a third-party server to be used as training data. With an open-weight model running locally, it never leaves the laptop. There's no vendor, no retention policy to read, and no account to make.

It's completely free to run. Locally there's no API key and no per-request bill, so my friend can generate as many practice tests as they want without thinking about it.

I control the whole pipeline. Because I own the inference call, I could tweak the prompts to strictly return JSON without markdown, and enforce my own deterministic streaming parser to handle the UI. A closed chatbot gives you an answer on their UI terms; open weights let you build the exact experience you want.

Prize Categories

Local AI Hero
Open Source Innovator

Top comments (0)