DEV Community

Cover image for A Personalized AI Learning Companion Powered by Gemma
Sanoj Ahamed
Sanoj Ahamed

Posted on

A Personalized AI Learning Companion Powered by Gemma

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 Study Buddy, a personalized AI learning companion for a friend who is learning programming.

The idea was to create something more useful than simply asking an AI chatbot questions. Study Buddy combines human-written learning material with an open-weight AI model to provide a structured learning experience.

The current study room covers beginner topics in:

  • (Vue)JavaScript
  • HTML
  • CSS

For each topic, the learner gets simple explanations, practical analogies, code examples, and a five-question multiple-choice quiz.

Gemma then uses the selected lesson as context to:

  • Explain concepts in a personalized way
  • Give feedback on quiz answers
  • Create small practice exercises
  • Adapt responses to the learner's selected name

Learning progress is saved locally in the browser, so the learner can continue from the same device.

Demo

Watch the demo on YouTube

Code

View the GitHub repository

How I Built It

The frontend is built with Vue 3, while the backend uses Node.js and Express.

The AI layer uses Google's Gemma 3 4B IT, an open-weight model, through Hugging Face Inference Providers.

The basic flow is:

Learner → Vue Study Room → Express API → Hugging Face → Gemma → Personalized Response

The lesson content is written and maintained in the application. When the learner selects a topic and learning mode, the Express server sends the relevant lesson context to Gemma along with the learner's request.

I also kept the Hugging Face API token on the server instead of exposing it to the browser. The frontend communicates only with my Express API.

The project also includes:

  • Vite for the frontend development and build process
  • Browser local storage for learner progress
  • Environment variables for AI configuration
  • API rate limiting to help protect the tutor endpoint
  • A production setup where Express can serve the built Vue application

The model can also be changed through the HF_MODEL environment variable, making the AI component replaceable rather than tightly coupled to a single model.

Why Does Open Innovation Matter?

Open innovation makes it possible to experiment with this project at a much deeper level.

Instead of building the application around a closed AI API that is difficult to replace, Study Buddy uses an open-weight model through an inference provider. This gives the project flexibility to experiment with different models and inference setups as the application grows.

It also makes the AI layer a replaceable part of the architecture. The learning experience, lesson content, and frontend do not have to be completely redesigned if the underlying model changes.

For a learning project like this, that flexibility is important because it allows me to learn not only how to use AI, but also how AI models fit into a real software application.

Top comments (0)