DEV Community

Cover image for StudyForge - A Local AI Study Partner Built for a Friend
Sumeet Choudhary
Sumeet Choudhary

Posted on

StudyForge - A Local AI Study Partner Built for a Friend

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🀝

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

What I Built

I built StudyForge, a local-first AI study partner for my friend Piyush, a Class 10 student preparing for his board exams.

The problem was simple: having notes does not always mean understanding them.

While studying, Piyush can have the textbook or class notes right in front of him and still get stuck on one particular concept. At that point, a general-purpose AI chatbot can give him an answer, but I wanted to build something more focused:

Start with his own notes, find the part that matters, and help him understand that specific concept.

That became StudyForge.

A student pastes their class notes and asks a focused question, such as:

β€œHow do the light-dependent reactions help the Calvin cycle make sugar?”

StudyForge then:

  1. Breaks the notes into passages.
  2. Ranks the passages against the student's question using local keyword-based retrieval.
  3. Selects up to five relevant passages.
  4. Sends only those selected excerpts to a locally running AI model.
  5. Generates a short explanation, an example, a quick-check question, and a sample answer.
  6. Shows the source passages used to create the response.

If the question has no matching terms in the notes, StudyForge does not simply invent a study guide. It asks the student to rephrase the question using words that actually appear in their material.

The goal is not to replace studying.

It is to make the confusing part easier to understand.

Demo

StudyForgeDemo

Code

GitHub logo sumeet156 / StudyForge-Local-AI-Study-Partner

A private, local-first study partner that uses Gemma 3 and your class notes to explain confusing topics and generate practice questions.

StudyForge

StudyForge is a local-first AI study partner. Paste in class notes, name a topic that feels confusing, and get a short study guide with a plain-language explanation, an example, a quick-check question, a sample answer, and the note passages used to make the guide.

The project was built for the Hacktoberfest 2026 β€œBuild for a Friend” theme: make a practical study aid that can help someone learn from their own class notes.

What it does

  1. Accepts up to 30,000 characters of notes and a topic or question of up to 200 characters.
  2. Splits the notes into passages and ranks them against the topic using local keyword scoring.
  3. Selects up to five matching passages and sends those excerpts to a locally running Ollama model.
  4. Asks the model to return a focused guide grounded in those excerpts.
  5. Shows the explanation, example, quick check, sample answer, and source passages in the browser.

…

The repository is open source and includes the React frontend, FastAPI backend, retrieval logic, Ollama integration, and backend tests.

How I Built It

The core of StudyForge is built around open-weight AI running locally.

The default model is Google's Gemma 3 4B, served locally through Ollama.

The architecture is intentionally small:

React + TypeScript + Vite
β†’ FastAPI backend
β†’ local passage retrieval
β†’ Ollama
β†’ Gemma 3 4B

The browser sends the student's notes and question to the local StudyForge API. Before the model sees anything, the backend splits the notes into passages and ranks them using keyword overlap with a TF-IDF-style scoring approach.

Only the highest-ranked passages are included in the model request.

The model is also instructed to use only those supplied excerpts and to say when the excerpts do not contain enough information rather than confidently filling the gap with outside knowledge.

The application then returns structured JSON containing:

  • a simple explanation
  • an example
  • a quick-check question
  • a sample answer

StudyForge also returns the actual source passages selected by the retrieval layer, rather than asking the model to invent citations.

There is no hosted AI endpoint in the application, no account system, and no database storing the student's notes. The notes remain in the page while the application is open, and the selected excerpts are sent to the locally running Ollama service.

After the required model and dependencies have been downloaded, generation can run without an internet connection.

Why Does Open Innovation Matter?

This project is probably the clearest example I've had of why open AI matters at the application level.

I could have connected StudyForge to a hosted closed AI API and had a working prototype quickly.

But for this particular problem, local inference changes what is possible.

A student is putting their own study material into the application. I did not want the core experience to depend on sending that material to a third-party AI service by default.

With an open-weight model running through Ollama, I can build the application around:

Privacy:
The AI inference can happen on the student's own computer instead of requiring a hosted AI endpoint.

Control:
I can change the model and experiment with different local models without redesigning the application.

Transparency:
The application can show the passages retrieved from the student's notes alongside the generated explanation.

Offline potential:
Once the model is downloaded, the core generation workflow does not require a continuous internet connection.

Most importantly, open innovation let me design the AI around the actual problem instead of designing the problem around an API.

StudyForge is intentionally small. But that is exactly why I wanted to build it this way: the open model is not just an interchangeable backend. Local inference is part of the product's purpose.

Prize Categories

Best Use of Gemma β€” StudyForge uses Google's open-weight Gemma 3 4B as its default local AI model through Ollama.

Final Thoughts

The best part of this project was not getting an AI model to generate text.

It was starting with one person.

I built StudyForge because my friend had a real problem: sometimes the notes are already there, but the concept still does not click.

That made the design decisions much easier.

I did not need a giant AI system.

I needed a focused study partner that could take his notes, find the relevant part, explain it simply, and show him where that explanation came from.

That is StudyForge.

Top comments (0)