DEV Community

RUDRARAJSINH RANA
RUDRARAJSINH RANA

Posted on

StudyMate Offline: A Privacy-First AI Study Companion That Works Without Internet ๐ŸŽ“

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

StudyMate Offline: A Privacy-First AI Study Companion That Works Without Internet ๐ŸŽ“

What I Built

I built StudyMate Offline, a privacy-first AI study companion, designed specifically for a college friend who has a daily two-hour commute with dead cell service and frequently studies in our campus library's basement where Wi-Fi drops out.

Like many students, they faced three major barriers with existing AI study tools:

  • Connectivity barriers: Cloud study tools break down the second you lose Wi-Fi on a train, flight, or in a basement study room.
  • Academic privacy risks: Discomfort with uploading private lecture materials, draft assignments, and thesis research to third-party commercial AI clouds where data can be logged or scraped.
  • Access costs: Expensive \$20โ€“\$40/month subscriptions that students simply cannot afford.

StudyMate Offline addresses these challenges by bringing AI-powered study assistance directly to the student's personal computer.

It allows students to:

  • Upload and organize lecture notes (PDF and text files).
  • Search documents using semantic similarity powered by local vector embeddings.
  • Ask questions and receive explanations strictly grounded in their course notes.
  • Inspect verifiable source citations ([Source 1]) linked directly to exact text snippets.
  • Generate practice MCQs with instant grading and explanatory rationales.
  • Create personalized study plans calibrated to exam dates and available daily hours.

Its core mode runs 100% locally via Ollama using lightweight open-weight models (llama3.2:3b and nomic-embed-text). After downloading the models once, the entire study experience operates with airplane mode enabledโ€”zero internet required.

The philosophy is simple: Your study materials should remain yours, and learning should never stop when the Wi-Fi does.


Demo

(Note: The hosted Render preview features an automatic cloud AI fallback so judges can test it online 24/7. The full, 100% offline, zero-data-transmission experience is demonstrated through the local setup guide).


Code

GitHub logo rudrarajsinh920 / studymate-offline

A privacy-first, locally runnable AI study companion for students (100% offline RAG with Ollama)

StudyMate Offline ๐ŸŽ“

A privacy-first, locally runnable AI study companion for students.
Grounded document Q&A with source citations, semantic vector search, practice quiz generation, and adaptive study planning powered entirely by local open-source models (Ollama).
100% offline. Zero cloud data transmission. Zero subscription fees.

License: MIT TypeScript React Ollama SQLite Hacktoberfest Audit


๐Ÿ“‘ Table of Contents

  1. Problem Statement
  2. Solution & Target Users
  3. Key Features
  4. Technology Stack
  5. Architecture Overview & Mermaid Diagram
  6. How Local AI & Offline Functionality Work
  7. Supported Document Formats
  8. Prerequisites & System Requirements
  9. Fresh Local Setup & Installation Commands
  10. How to Run Frontend, Backend, and Ollama
  11. Automated Verification & Testing
  12. Privacy Guarantees & Technical Limitations
  13. Deployment Feasibility Assessment
  14. Hackathon Judging & Demonstration Resources
  15. License

๐Ÿšจ Problem Statement

Modern students and researchers rely heavily on digital learning aids, but current AI study assistants suffer from severe structural flaws:

  1. Academic Surveillance & Privacy Insecurity: Commercial cloud LLMs retain, inspect, and train on uploaded user documents. Students uploading proprietaryโ€ฆ

How I Built It

StudyMate Offline is engineered for edge execution on consumer-grade laptops without discrete GPUs:

AI Models & Runtime

  • Meta's Llama 3.2 (3B): Run via Ollama for conceptual explanations, study planning, and quiz generation.
  • Nomic Embed Text: Generates 768-dimensional embeddings for high-precision semantic document retrieval.

Technology Stack

  • Frontend: React 18, TypeScript, Vite, Tailwind CSS, Lucide React
  • Backend: Node.js, Express, TypeScript, Multer, pdf-parse
  • Database: SQLite (WAL mode) for document chunks, binary vector BLOB caching, chat sessions, and quiz attempts
  • AI Runtime: Ollama (Local) with optional Gemini Flash fallback for 24/7 cloud hosting

Key Engineering Features

  • Grounded Retrieval-Augmented Generation (RAG): The system retrieves relevant document excerpts and strictly constrains model context before generating answers.
  • Source Transparency: Answers feature inline [Source N] citations that allow students to verify the exact source passage in their notes.
  • Honest Refusal Guardrails: When relevant evidence is missing from the uploaded notes, the tutor explicitly declines to answer (insufficientEvidence: true) instead of hallucinating false facts.
  • Context & Token Budgeting: Enforces concise response budgets (256โ€“512 tokens) and top-$k$ filtering to keep CPU inference times under ~30 seconds on standard laptops.
  • 100% Test Coverage: Verified with 18/18 milestone integration tests and 10/10 automated system audit workflows passing.

Why Does Open Innovation Matter?

Open innovation made the core concept of StudyMate Offline possible:

  1. Privacy & Data Ownership: Students process personal academic materials locally instead of surrendering their data to commercial AI providers.
  2. Accessibility & Equity: Open-weight models democratize AI education, eliminating the need for expensive monthly subscriptions.
  3. Uninterrupted Learning: Learning shouldn't depend on network stability or cloud server uptime.
  4. Freedom to Customize: Open model ecosystems allow developers to tailor inference and prompts directly to student needs and laptop hardware.
  5. Trust Through Transparency: Verifiable citations prevent students from blindly trusting generic AI outputs during high-stakes exam prep.

Open innovation is not just about free softwareโ€”it enables developers to build technology around the real-world constraints of everyday students.


Prize Categories

  • Best Overall "Build for a Friend" Project
  • Best Use of Open-Source / Open-Weight AI

Top comments (0)