DEV Community

Cover image for Study Saathi — A Local AI Study Companion Built for a Friend
Nipun Goel
Nipun Goel

Posted on

Study Saathi — A Local AI Study Companion Built for a Friend

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

What I Built

Study Saathi — Local AI Study Assistant

A friend of mine is preparing for university exams. Like many students, they have to go through long PDFs and notes and often struggle with a simple question:

"Where do I even start?"

So I built Study Saathi, a simple local AI-powered study assistant that turns study notes into useful revision material.

The workflow is simple:

Upload Notes → AI Summary → Practice MCQs → Flashcards

Study Saathi currently supports PDF and TXT study material and provides three main features:

  • 📝 AI Summary — Creates a concise, exam-focused summary from the uploaded notes.
  • ❓ 10 Practice MCQs — Generates multiple-choice questions based on the uploaded material.
  • 🃏 10 Flashcards — Converts important concepts into quick revision flashcards.

The AI is instructed to use the uploaded study material as the primary source and avoid introducing unrelated information.

The main goal was not to build a huge AI platform, but to solve a real problem for a real student with a small, useful application.


Demo

🎥 Watch the Study Saathi Demo:

https://drive.google.com/file/d/1zy5ISFlc8K4PAys0SUK0gh9VlSftoCIa/view?usp=sharing

The demo shows the complete workflow:

  1. Uploading a study PDF/TXT file
  2. Generating an AI-powered summary
  3. Generating practice MCQs
  4. Generating flashcards
  5. Using local AI inference through Ollama

The AI inference runs locally on my machine instead of using a cloud AI API.


Code

GitHub Repository:

https://github.com/NipunGoel02/StudySaathi

Important Project Files

StudySaathi/
│
├── backend/
│   ├── main.py
│   ├── ollama_service.py
│   ├── pdf_parser.py
│   └── requirements.txt
│
├── frontend/
│   └── React + Vite application
│
├── sample_notes/
│   ├── Computer_Networks_Notes.pdf
│   └── Operating_Systems_Notes.txt
│
├── README.md
└── start.bat
Enter fullscreen mode Exit fullscreen mode

Main Backend Files

main.py

Contains the FastAPI backend and API endpoints.

ollama_service.py

Handles communication with the local Ollama server and generates summaries, MCQs, and flashcards using the local AI model.

pdf_parser.py

Extracts text from uploaded PDF and TXT study material.


How I Built It

Tech Stack

Component Technology
Frontend React + Vite + Tailwind CSS
Backend Python + FastAPI
PDF Processing PyMuPDF
Local AI Runtime Ollama
AI Model qwen3:1.7b
Database None

The application intentionally has a simple architecture.

There is no RAG pipeline, vector database, authentication system, or cloud AI API in the current version.


Architecture

                    ┌─────────────────────┐
                    │       Student       │
                    └──────────┬──────────┘
                               │
                               ▼
                    ┌─────────────────────┐
                    │    React Frontend   │
                    │    Vite + Tailwind  │
                    └──────────┬──────────┘
                               │
                               ▼
                    ┌─────────────────────┐
                    │    FastAPI Backend  │
                    │      Python         │
                    └──────────┬──────────┘
                               │
                     ┌─────────┴─────────┐
                     │                   │
                     ▼                   ▼
             ┌──────────────┐    ┌──────────────┐
             │ PyMuPDF      │    │ TXT Parser   │
             │ PDF Extract  │    │              │
             └──────┬───────┘    └──────┬───────┘
                    │                   │
                    └─────────┬─────────┘
                              │
                              ▼
                    ┌─────────────────────┐
                    │       Ollama        │
                    │   Local AI Runtime  │
                    └──────────┬──────────┘
                               │
                               ▼
                    ┌─────────────────────┐
                    │     qwen3:1.7b      │
                    │    Local AI Model   │
                    └──────────┬──────────┘
                               │
                 ┌─────────────┼─────────────┐
                 ▼             ▼             ▼
             Summary          MCQs       Flashcards
Enter fullscreen mode Exit fullscreen mode

Local AI

The most important part of Study Saathi is that the AI runs locally.

I used Ollama as the local AI runtime and qwen3:1.7b as the model.

The model is small enough to run efficiently on my NVIDIA RTX 3050 with 4 GB VRAM.

During testing, Ollama reported the model running at 100% GPU on my system.

The application communicates with Ollama locally through:

http://localhost:11434
Enter fullscreen mode Exit fullscreen mode

The default model is:

DEFAULT_MODEL = "qwen3:1.7b"
Enter fullscreen mode Exit fullscreen mode

AI Generation

Study Saathi has separate generation logic for:

  • Summary
  • MCQs
  • Flashcards

For structured content such as MCQs and flashcards, the backend asks the model to return structured JSON so that the frontend can reliably display the generated content.

For example, an MCQ is represented as:

{
  "q": "What is the role of the OS scheduler?",
  "a": "Manages process execution order",
  "b": "Handles file storage",
  "c": "Controls network packets",
  "d": "Manages GPU memory",
  "answer": "A"
}
Enter fullscreen mode Exit fullscreen mode

The backend also includes parsing and retry handling for generated content.


API Endpoints

The backend exposes the following endpoints:

GET  /health
POST /upload
POST /summary
POST /mcqs
POST /flashcards
Enter fullscreen mode Exit fullscreen mode

The basic flow is:

Upload Notes
     ↓
Extract Text
     ↓
Send Text + Prompt to Ollama
     ↓
qwen3:1.7b Generates Content
     ↓
Backend Parses Response
     ↓
React Displays Result
Enter fullscreen mode Exit fullscreen mode

Why Does Open Innovation Matter?

For this project, open innovation is important because it makes local AI practical for everyday users.

1. Privacy

Study material can be processed locally through Ollama instead of being sent to a third-party AI API.

This is especially useful for students who may have personal notes, assignments, or other private documents.

2. No Cloud AI API Required

Study Saathi does not require an OpenAI, Gemini, or other cloud AI API key for its core AI functionality.

The model runs directly on the user's machine.

3. No Per-Request AI Cost

After downloading the model, local inference does not involve paying for every AI request.

4. Runs on Personal Hardware

A relatively small open-weight model such as qwen3:1.7b can run locally on consumer hardware.

In my setup, it runs fully on the NVIDIA RTX 3050 GPU.

5. Model Flexibility

Using Ollama as the runtime makes it easier to experiment with different compatible local models without redesigning the entire application.

This means the application is not tightly dependent on a single cloud AI provider.


Why I Chose Local AI

The goal of Study Saathi was to make a useful tool for a student, not to build another application that requires:

Account
   ↓
API Key
   ↓
Cloud Request
   ↓
Usage Limits
   ↓
API Cost
Enter fullscreen mode Exit fullscreen mode

Instead, the workflow can be:

Install Ollama
      ↓
Download Local Model
      ↓
Run Study Saathi
      ↓
Upload Notes
      ↓
Study
Enter fullscreen mode Exit fullscreen mode

That simplicity is what I wanted to demonstrate with this project.


What I Learned

Building Study Saathi helped me understand that local AI does not always require a complicated architecture.

For a focused use case, a small local model combined with a simple backend can already provide a useful AI experience.

I also learned how to:

  • Run an open-weight model locally using Ollama
  • Connect a FastAPI backend to a local AI model
  • Process PDFs using PyMuPDF
  • Generate structured JSON from an LLM
  • Handle malformed model responses
  • Build a React interface around local AI
  • Design an AI application around an actual user's problem

Future Improvements

There are several things I would like to add in future versions:

  • RAG for larger documents
  • Persistent study history
  • Quiz performance tracking
  • Spaced-repetition flashcards
  • More local model options
  • Better document chunking
  • Personalized study plans
  • Support for multiple subjects

These features are planned improvements and are not part of the current implementation.

Prize Categories

Ollama

Study Saathi uses Ollama as the local AI runtime for running the model directly on the user's machine.

Open Source AI

The project uses an open-weight AI model together with open-source technologies to build a practical local AI application.


Final Thoughts

Study Saathi started with a simple problem:

My friend had notes, but didn't know how to efficiently revise them.

Instead of building a complicated platform, I built a small local AI tool that turns those notes into:

Summary + MCQs + Flashcards

The project demonstrates how open-weight AI and local inference can be used to build useful applications for real people without requiring a cloud AI API.

Built for a friend. Built locally. Built with open AI technology.


Links

🎥 Demo:

https://drive.google.com/file/d/1zy5ISFlc8K4PAys0SUK0gh9VlSftoCIa/view?usp=sharing

💻 GitHub:

https://github.com/NipunGoel02/StudySaathi

Top comments (0)