<?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: Tharusha Inuwara</title>
    <description>The latest articles on DEV Community by Tharusha Inuwara (@projects_only_48b9d3271bb).</description>
    <link>https://dev.to/projects_only_48b9d3271bb</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%2F4156067%2F0fbd9f4a-0f81-4ce4-bef4-04899f199141.png</url>
      <title>DEV Community: Tharusha Inuwara</title>
      <link>https://dev.to/projects_only_48b9d3271bb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/projects_only_48b9d3271bb"/>
    <language>en</language>
    <item>
      <title>Offline Study Buddy</title>
      <dc:creator>Tharusha Inuwara</dc:creator>
      <pubDate>Fri, 02 Oct 2026 05:16:57 +0000</pubDate>
      <link>https://dev.to/projects_only_48b9d3271bb/offline-study-buddy-1nk</link>
      <guid>https://dev.to/projects_only_48b9d3271bb/offline-study-buddy-1nk</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;I built an Offline Study Buddy for Lecture Slides for my batchmate studying Computer Engineering at the University of Peradeniya.&lt;/p&gt;

&lt;p&gt;Like many engineering students, my friend relies heavily on lecture slides for revision. However, studying from dense slides on a laptop with patchy Wi-Fi and limited mobile data is frustrating. Lecture slides are designed for classroom presentation—not for fast exam revision or self-assessment. They needed a fast way to query complex lecture topics and test their knowledge without relying on a cloud connection.&lt;/p&gt;

&lt;p&gt;The Offline Study Buddy solves both problems right on a laptop with zero internet required:&lt;/p&gt;

&lt;p&gt;💡 Explain Mode: Ask any question about a course or topic. The system retrieves relevant slide excerpts and generates a clear, concise explanation grounded entirely in the lecture slides, complete with explicit slide citations (e.g., [Slide 5]).&lt;br&gt;
📝 Quiz Mode: Pick a specific topic or slide range (e.g., Slides 1–15). The system generates multiple-choice questions (MCQs) directly from the slide content, scores your choices interactively, and explains the correct answers.&lt;/p&gt;

&lt;p&gt;Everything runs 100% locally on a laptop—with no internet connection, no user accounts, and zero API costs.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;




&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://drive.google.com/file/d/1zj3T2H8vdapSvaVrQeLnWhhiq71h86Ro/view?usp=sharing" rel="noopener noreferrer" class="c-link"&gt;
            Recording 2026-10-02 104929.mp4 - Google Drive
          &lt;/a&gt;
        &lt;/h2&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fssl.gstatic.com%2Fdocs%2Fdoclist%2Fimages%2Fdrive_favicon_2026_32dp.png" width="32" height="32"&gt;
          drive.google.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&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/tharu200304" rel="noopener noreferrer"&gt;
        tharu200304
      &lt;/a&gt; / &lt;a href="https://github.com/tharu200304/Offline-Study-Buddy" rel="noopener noreferrer"&gt;
        Offline-Study-Buddy
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &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;🎓 Offline Study Buddy for Lecture Slides&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;An offline, local-first RAG (Retrieval-Augmented Generation) application designed for Computer Engineering undergraduates at the University of Peradeniya. It transforms dense, raw lecture slides (PDFs &amp;amp; PPTXs) into an interactive study &amp;amp; revision assistant.&lt;/p&gt;
&lt;p&gt;Everything runs 100% locally on a laptop—&lt;strong&gt;no internet connection, no external API keys, no cloud data transmission, and zero cost&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🌟 Key Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;💡 Explain Mode (Grounded Q&amp;amp;A with Slide Citations)&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ask any question about a course or specific topic.&lt;/li&gt;
&lt;li&gt;Searches local ChromaDB vector store for relevant slide excerpts.&lt;/li&gt;
&lt;li&gt;Generates clear, student-friendly revision summaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grounded &amp;amp; Cited&lt;/strong&gt;: Every fact explicitly references its source slide (e.g., &lt;code&gt;[Slide 5]&lt;/code&gt; or &lt;code&gt;[Operating_Systems.pdf, Slide 12]&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;If the uploaded slides do not cover the question, the system clearly informs you rather than hallucinating.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;📝 Quiz Mode (Interactive MCQs with Strict JSON Parsing)&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select a topic or slide range (e.g., Slides 1–15).&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tharu200304/Offline-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;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Lecture slides (PDF/PPTX)
        │
        ▼
Text extraction (PyMuPDF / python-pptx), keeping file + slide number
        │
        ▼
Chunking + local embeddings (nomic-embed-text via Ollama)
        │
        ▼
ChromaDB (local vector store)
        │
   ┌────┴─────────────────────────────┐
   ▼                                  ▼
Explain mode                       Quiz mode
(retrieve slides →                 (slides → MCQs as strict JSON →
 simple explanation                 scoring + short explanation)
 with slide cites)                    │
        │                             │
        └───────────────┬─────────────┘
                        ▼
       Ollama (local open-weight LLM) → Gradio UI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🛠️ Tech Stack&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Model Runtime: Ollama running open-weight local models (Gemma 2 for grounded explanations &amp;amp; Qwen 2.5 for strict JSON quiz generation)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Embeddings: nomic-embed-text via Ollama (with fallback embedding support)&lt;br&gt;
Vector Store: ChromaDB (persistent local folder)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Document Extraction: PyMuPDF (fitz) for PDF slides &amp;amp; python-pptx for PowerPoint presentations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;UI Framework: Gradio (with custom high-contrast CSS and responsive theme layout)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔬 Model Selection &amp;amp; Evaluation&lt;/p&gt;

&lt;p&gt;I didn't assume one open-weight model would fit all tasks. I built a built-in benchmarking tool (benchmark.py) to test candidate models on identical test questions extracted from real computer engineering slides.&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%2Fs1j4hrnm0eyhluy3n5oz.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%2Fs1j4hrnm0eyhluy3n5oz.png" alt=" " width="762" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Takeaway: Gemma 2 won for clear, concise explanations and citation adherence, while Qwen 2.5 excelled at reliably producing valid JSON arrays for quizzes without syntax errors.&lt;/p&gt;

&lt;p&gt;🎯 Keeping Answers Grounded&lt;/p&gt;

&lt;p&gt;To ensure the assistant never hallucinates outside course materials, the model only receives retrieved slide chunks and is enforced by a strict system prompt:&lt;/p&gt;

&lt;p&gt;1.Strict Context Boundary: Base answers only on the provided slide excerpts.&lt;br&gt;
2.Explicit Citations: Every fact must cite its source slide (e.g., [Slide 7]).&lt;br&gt;
3.Graceful Fallback: If the uploaded slides do not contain the answer, the model explicitly states: "The provided lecture slides do not contain information on this topic."&lt;/p&gt;

&lt;p&gt;📝 Robust Quiz Generation&lt;/p&gt;

&lt;p&gt;Generating structured quizzes requires the local LLM to output valid JSON (question, options, answer_idx, explanation, slide_citation).&lt;/p&gt;

&lt;p&gt;To handle occasional markdown wrapping or minor syntax quirks from local models, I built a custom JSON repair engine (repair_and_parse_json in ollama_client.py) that extracts JSON arrays inside markdown blocks, cleans trailing commas, and falls back to regex extraction if needed.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;100% Offline Capability: Students in areas with patchy connectivity and expensive mobile data can study without interruption. Cloud APIs would fail them when they need it most during exam prep.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Privacy &amp;amp; Security: Sensitive course materials, lecture slides, and study logs never leave the student's laptop.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Zero Operating Cost: No per-token charges or subscription fees—my friend can run unlimited quizzes and explanations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Model Choice &amp;amp; Control: Being able to benchmark multiple open-weight models side-by-side enabled me to select the exact model that fit the laptop's RAM and task requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Custom-Tailored Behavior: Prompts and MCQ schemas are tuned specifically for engineering lecture revision rather than generic chat.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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