DEV Community

Samreena Yousaf
Samreena Yousaf

Posted on

StudyLens: I Built an AI That Learns What My Friend Doesn’t Understand

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🤝

StudyLens: A Private Local-AI Learning Loop Built for a Friend

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

What I Built

I built StudyLens, a private, local-AI adaptive learning tool for my friend Beenish, a student learning Software Engineering.

StudyLens Dashboard showing concept mastery and learning progress

The problem was simple: when Beenish gets an answer wrong, seeing the correct answer does not always tell her which concept she misunderstood.

StudyLens is designed around that gap.

Instead of simply marking an answer right or wrong, it analyzes the student's response locally, extracts evidence about their understanding, estimates concept-level weaknesses, updates a deterministic mastery profile, and can give them a targeted retest on the same concept.

The goal is not to replace a teacher or claim that AI can perfectly understand a learner. StudyLens instead uses answer patterns to estimate recurring concept-level weaknesses and adapt subsequent assessments.

The core loop is:

Answer → Local AI analysis → Concept/misconception evidence → Mastery update → Targeted retest → New answer → Updated mastery

A weak answer analyzed locally, with the detected concept weakness and targeted retest decision.

Demo

Here is a short walkthrough showing the adaptive learning flow:

Watch the StudyLens demo

The demo shows a student answering a question, receiving local AI analysis, seeing their mastery update, receiving a targeted retest after a weak answer, and then continuing the learning loop.

Code

The complete project is open source:

GitHub: https://github.com/samreenayousaf/StudyLens-Hacktoberfest

The repository includes the application source code, tests, evaluation cases, documentation, contribution guidelines, and license information.

How I Built It

StudyLens uses:

  • Gemma 3:1B for local answer analysis
  • Ollama to run the model locally
  • Python + FastAPI for the backend
  • SQLite + SQLAlchemy for learning data
  • React + Vite for the frontend
  • Vanilla CSS for the interface
  • Pytest for automated backend testing

The most important architectural decision was separating AI interpretation from learning decisions.

Gemma analyzes the student's answer and returns structured information such as:

  • understanding score
  • detected concepts
  • possible misconceptions
  • supporting evidence

The deterministic backend then handles the authoritative learning logic.

For example, mastery is updated using a deterministic weighted calculation:

new mastery = previous mastery × 0.70 + current understanding × 0.30

The backend also determines whether a retest is required and selects another active question from the same concept.

This means the language model does not directly decide the student's final mastery level or secretly control the learning flow.

The Adaptive Retest

One of the core features is the targeted retest.

For example, if a student gives a weak answer about Coupling, StudyLens can identify evidence of misunderstanding and request another Coupling question rather than randomly switching to a different topic.

The student can then answer the new question and see how their estimated mastery changes.

This creates a small but explicit learning loop instead of a conventional question-and-answer chatbot.

StudyLens showing a strong answer with AI analysis and updated mastery

Why Does Open Innovation Matter?

This project is specifically built around local inference.

Gemma 3:1B runs through Ollama on the student's own machine rather than sending their answers to a hosted closed AI API.

That matters for a learning tool because student answers can contain personal academic information.

With the local approach:

  • answers stay on the local machine during analysis
  • the project does not require a paid AI API
  • the model can be replaced or experimented with
  • inference can work without depending on a remote AI service
  • the AI component remains inspectable and reproducible

The project also demonstrates that useful AI-assisted learning experiments do not necessarily require a large cloud model.

The tradeoff is latency: on my laptop, local CPU inference is noticeably slower than a typical hosted API.

Validation

I did not want the project to stop at a working UI.

The backend currently has 52 automated tests passing with 0 failures.

I also tested the complete learning flow with real local Gemma inference.

The validation covered:

  • correct and incorrect Agile answers
  • correct and incorrect Scrum answers
  • correct and incorrect Waterfall answers
  • correct and incorrect Coupling answers
  • Functional vs Non-functional Requirements
  • misconception extraction
  • concept filtering
  • mastery updates
  • targeted retest decisions
  • same-concept question selection
  • duplicate submission protection
  • API behavior

I also manually tested the application through the browser, including a weak answer followed by a targeted retest and a subsequent correct answer.

Progress view showing updated concept mastery after repeated attempts.

Open Source

StudyLens is released under the MIT License.

The application is built around an open-weight Gemma model, with the model run locally through Ollama.

The repository also includes:

  • CONTRIBUTING.md
  • CODE_OF_CONDUCT.md
  • automated tests
  • evaluation cases
  • project documentation
  • Hacktoberfest-specific audit and submission documentation

Limitations

StudyLens is a prototype, not a finished educational assessment system.

The current implementation has a relatively small Software Engineering question set and uses a small local model. A 1B parameter model can sometimes produce over-inclusive misconception descriptions, which is why the application applies deterministic validation and filtering around the AI output.

Local CPU inference is also slower than cloud inference.

Most importantly, the system should be understood as estimating concept-level weaknesses from answer evidence, not as perfectly measuring what a student understands.

Why I Built It for a Friend

The starting point was not "What AI app can I build?"

It was a much smaller question:

What could I build that would actually help one person I know?

For Beenish, the useful part was not another chatbot that could explain Software Engineering concepts.

It was the loop after getting something wrong:

What did I misunderstand? → What should I practice next? → Did I improve?

That became the reason for building StudyLens.

Prize Category

Best Use of Gemma

StudyLens uses Google's open-weight Gemma 3:1B as a core part of its learning-analysis pipeline and runs the model locally through Ollama.

Links

🎥 Demo: https://youtu.be/fmw0NHtx7vI

💻 GitHub: https://github.com/samreenayousaf/StudyLens-Hacktoberfest


Built for a friend, powered locally, and released openly.

Top comments (0)