<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Khushighosh</title>
    <description>The latest articles on DEV Community by Khushighosh (@khushighosh).</description>
    <link>https://dev.to/khushighosh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4152360%2F6ac43df7-8b20-4acc-913f-03da2c9dd0ef.jpg</url>
      <title>DEV Community: Khushighosh</title>
      <link>https://dev.to/khushighosh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khushighosh"/>
    <language>en</language>
    <item>
      <title>Study Buddy: an offline GATE study partner for my friend, built with Ollama</title>
      <dc:creator>Khushighosh</dc:creator>
      <pubDate>Sun, 04 Oct 2026 20:47:08 +0000</pubDate>
      <link>https://dev.to/khushighosh/study-buddy-an-offline-gate-study-partner-for-my-friend-built-with-ollama-kd7</link>
      <guid>https://dev.to/khushighosh/study-buddy-an-offline-gate-study-partner-for-my-friend-built-with-ollama-kd7</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Study Buddy&lt;/strong&gt;&lt;/em&gt; is an offline exam study partner I built for my friend &lt;strong&gt;Anushka&lt;/strong&gt;, who is preparing for &lt;strong&gt;GATE&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;GATE has a huge syllabus, and she wanted quick answers and practice questions from her own notes. I also wanted her study material to stay on her laptop and not go to someone else's server.&lt;/p&gt;

&lt;p&gt;You add your notes (PDF, text or markdown) to a folder, and Study Buddy does three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Answers from your notes only.&lt;/strong&gt; Every answer cites its source, like &lt;code&gt;[notes.pdf p.3]&lt;/code&gt;. If the notes don't cover a question, it says so instead of guessing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quizzes you on your own material.&lt;/strong&gt; It writes multiple-choice questions from the notes and explains each answer with a pointer to the source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tracks your weak spots.&lt;/strong&gt; It remembers which topics you get wrong and lets you practice them, so it works like a study partner and not just a chatbot.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything runs on a laptop. After the one-time download of the models, nothing is uploaded anywhere and it works with Wi-Fi off.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/NCX1b1YHz8M" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl7ju6agxmfn1b7eix5bd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl7ju6agxmfn1b7eix5bd.png" alt="Screenshot of Study Buddy in a browser: the Ask tab with a question about the notes and an answer that cites its source file" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Anushka said after using it:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I usually spend a lot of time searching through my GATE notes whenever I get stuck on a topic. With Study Buddy, I can just ask a question and get an answer directly from my own notes, along with the page where it came from.&lt;/p&gt;

&lt;p&gt;The quiz feature is my favorite because it helps me figure out which topics I actually don't understand instead of just rereading everything. And knowing that my notes stay on my laptop makes me much more comfortable putting all my study material into it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Khushighosh" rel="noopener noreferrer"&gt;
        Khushighosh
      &lt;/a&gt; / &lt;a href="https://github.com/Khushighosh/study-buddy" rel="noopener noreferrer"&gt;
        study-buddy
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Offline exam study buddy: ask questions and get quizzes from your own notes, using Ollama, local embeddings and ChromaDB. Nothing leaves your laptop.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Study Buddy&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;An offline exam study partner built for a friend. It answers questions and generates quizzes from their own notes, running entirely on a laptop with open models. Nothing is uploaded anywhere.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Ask questions and get answers with citations to the notes&lt;/li&gt;
&lt;li&gt;Says "This isn't covered in your notes" instead of guessing&lt;/li&gt;
&lt;li&gt;Multiple-choice quizzes generated from the notes&lt;/li&gt;
&lt;li&gt;Tracks weak topics and offers to practice them&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How it works&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;ingest.py&lt;/code&gt; splits your notes into chunks and embeds them with &lt;code&gt;nomic-embed-text&lt;/code&gt; into a local ChromaDB store.&lt;/li&gt;
&lt;li&gt;For each question, the closest chunks are retrieved and passed to &lt;code&gt;qwen2.5:7b&lt;/code&gt; with strict instructions to answer only from them and cite the source.&lt;/li&gt;
&lt;li&gt;Quiz mode asks the model for one multiple-choice question per chunk as JSON, validates it, and logs each result in SQLite so weak topics can be practiced again.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Stack&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Ollama (qwen2.5:7b and nomic-embed-text), ChromaDB, SQLite, FastAPI, plain HTML.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Tested&lt;/h2&gt;…&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Khushighosh/study-buddy" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The whole thing is open-source and local:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ollama&lt;/strong&gt; runs the models on the laptop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;qwen2.5:7b&lt;/strong&gt; (open-weight) writes the answers and quiz questions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;nomic-embed-text&lt;/strong&gt; (open-weight) turns notes into embeddings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ChromaDB&lt;/strong&gt; stores the vectors locally; &lt;strong&gt;SQLite&lt;/strong&gt; stores quiz results.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FastAPI&lt;/strong&gt; serves a small plain-HTML page, so it's used in a browser and not in a terminal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;ingest.py&lt;/code&gt; extracts text from the notes, splits it into overlapping chunks, and stores each chunk with its file name and page number so answers can cite sources.&lt;/li&gt;
&lt;li&gt;For each question, the closest chunks are retrieved and passed to the model with strict instructions: answer only from these notes, cite them, and say so if the answer isn't there.&lt;/li&gt;
&lt;li&gt;For quizzes, the model is asked for one question as JSON (&lt;code&gt;topic&lt;/code&gt;, &lt;code&gt;question&lt;/code&gt;, four options, &lt;code&gt;answer_index&lt;/code&gt;, &lt;code&gt;explanation&lt;/code&gt;). The code validates the JSON and retries once if it's malformed.&lt;/li&gt;
&lt;li&gt;Each answer is logged in SQLite by topic, so "Practice my weak topic" picks the topic with the lowest accuracy.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Tested on:&lt;/strong&gt; a Windows laptop with 16 GB RAM, an Intel Core i7-13620H and no dedicated GPU, so everything runs on the CPU. Timings were about 55 s for the first answer after starting the server (the model has to load), about 42 s for a normal answer, and about 35 s per quiz question. That's slower than a cloud chatbot, but it works on an ordinary laptop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limitations:&lt;/strong&gt; a 7B model can still misread a passage, so every answer shows its source for checking. Answers are slow on a CPU-only laptop, and notes are added through a folder and an indexing command, not an upload button.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; notes never leave the laptop. With a closed API, every question would have sent her study material to a server I don't control. Here I could demo it with Wi-Fi off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; it costs nothing per question, so people can ask as much as they like during revision.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Control:&lt;/strong&gt; the models are open weights, so swapping one is a one-line change (&lt;code&gt;CHAT_MODEL&lt;/code&gt; in &lt;code&gt;rag.py&lt;/code&gt;), which lets someone with a weaker laptop trade answer quality for speed. I also wrote the prompts so the model refuses when the notes don't cover something, which matters for exam prep.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reproducible:&lt;/strong&gt; anyone with a similar laptop can run it from the README. There are no API keys or accounts.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>hf26challenge</category>
      <category>studybuddy</category>
    </item>
  </channel>
</rss>
