DEV Community

Akash
Akash

Posted on

YaadDost: flashcards from your own notes, checked by a second Gemma pass

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 YaadDost for my best friend. Every student knows the night before an exam: a pile of notes pasted from everywhere, no time to turn them into something you can actually test yourself with, and flashcard tools that ask you to write every card by hand. I wanted something where you paste the notes you already have and get cards back, in the way we really talk, Hinglish. And because AI tools can make things up, I wanted every card checked against what the notes actually say before it reaches you.

You paste your notes. Gemma turns them into flashcards in Hinglish or English, then a second Gemma pass checks every card against your notes and throws out anything they don't support. A spaced-repetition scheduler (SM-2) brings each card back just before you'd forget it. A small timeline at the top shows every card as a dot on the day it's due, and a card's dot hops to its new day when you grade it. The grades are Hinglish too: Bhool gaya, Mushkil, Yaad tha, Aasaan.

Demo

Live app: https://yaaddost.onrender.com

The live link runs in offline mode (simple rule-based cards), because my Gemma server is a free Colab session that I don't leave running. With Gemma connected, the cards are written and checked by the model, as described below.

Code

YaadDost

Flashcards from your own notes, in Hinglish or English, that come back just before you'd forget them Built for the Hacktoberfest Weekend Challenge: Build for a Friend.

Paste your notes. An open-weight Gemma model writes the flashcards, a second Gemma pass checks every card against your notes and throws out anything they don't support, and an SM-2 scheduler tells you when to revise each card. Your notes only ever reach a Gemma server that you run yourself.

Live demo: add the Render URL here

How it works

 your notes ──► Generator (Gemma) ──► Verifier (Gemma) ──► cards you keep
                  writes cards         checks each answer     + a list of what was
                  (Hinglish/English)   against the notes      removed, and why
                                                                   β”‚
                                  SM-2 scheduler  ◄──── you review (Again / Hard / Good / Easy)
  • Generator: asks Gemma for flashcards as schema-constrained JSON. Rules in the prompt: facts from the notes only…

How I Built It

  • Model: open-weight Gemma 4 (gemma4:e4b) served by Ollama on a free Colab T4, reached through a tunnel.
  • Agent: two Gemma calls in a row. The Generator writes cards as schema-constrained JSON (facts from the notes only, one card per fact). The Verifier acts as a strict fact-checker: translations and paraphrases pass, but a claim that isn't in the notes fails, even if it's true in the real world. If the check can't run, the cards are shown as "not checked" instead of being lost.
  • Scheduler: plain SM-2, no model involved, so it's deterministic and tested.
  • App: FastAPI backend and a plain HTML, CSS and JavaScript frontend with no build step. Light and dark themes, works from 320px wide, keyboard shortcuts, no third-party requests. Hosted on Render.
  • Tested: 170 automated tests, including property-based tests, browser tests in a real Chromium, and measured contrast for every colour pair in both themes.

Why Does Open Innovation Matter?

A student's notes are private, and a revision tool only works if you can use it every day for free. Running an open-weight model means no per-request cost, no account, and the notes only go to a server I control. It also let me build the Verifier myself and measure it, which I couldn't do with a closed API.

What it can and can't do:

  • On a planted-error test (12 cards: 6 good, 6 deliberately wrong, including a true-but-not-in-the-notes fact), the Verifier made 0 false accepts and 0 false rejects in 3 runs. That's a small test I wrote myself, so it's not proof it works on every kind of note.
  • On four sets of real notes, in Hinglish and English, the Verifier removed nothing: the Generator's cards were already faithful. So I can't claim it catches errors in practice, only that it caught every planted one.
  • Making cards takes about 30 to 45 seconds, because it's two model calls.
  • The Gemma tunnel was unreliable in my tests, so the live demo doesn't depend on it.

Prize Categories

  • Best Use of Gemma: Gemma 4 writes the cards, checks them, and explains concepts.
  • Best Use of Render: the app is hosted on Render.

Top comments (0)