跳到正文
DEV Community· AR Bird·· 3 小時前AI 評分46

DeepRetain:以遺忘曲線驅動的知識引擎

DeepRetain: The Forgetting-Curve Knowledge Engine

AI 導讀

DeepRetain 以 Gemma 4 將課堂筆記整理成概念卡,並按答題準確度和反應速度安排複習。系統採用五格 Leitner 間隔重複機制,在第 1、4、11 和 25 天安排複習,並將每日複習上限設為 15 張卡。它提供九種學習模式,並可透過 Ollama 本機執行、使用 Google AI Studio 金鑰,或在離線時使用內置評分器。

正文

Cover image for DeepRetain: The Forgetting-Curve Knowledge Engine

AR Bird

AR Bird

Posted on Oct 26 AI-assisted

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 🦥

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

DeepRetain is a "slow and steady" study notebook that does the remembering—and the flashcard-making—so you don't have to.

Most students study like the hare: they ignore their notes for a month, pull an all-nighter before the test, and forget 85% of it a week later. DeepRetain forces you to study like the tortoise:

  • Zero Manual Card Prep 🪄: Drop in raw class notes or a file, and Gemma 4 automatically extracts the core ideas and builds study cards across multiple formats (multiple-choice, fill-in-the-blank, true/false, and open response).
  • 9 Study Modes for Any Energy Level 🛋️: Feeling lazy on the bus? Stick to Tired? Tap. modes (Multiple Choice, True/False, or Flip) or go hands-free with Listen mode. Ready to lock a concept in? Use Fill the Gap, Write, Say It out loud, or Teach It Back in your own words—or let Auto Mode pick for you based on how well you know the card.
  • Latency-Aware Leitner Scheduling ⏱️: Using a 5-box Leitner spaced-repetition system (reviewing at days 1, 4, 11, and 25), DeepRetain measures both accuracy and hesitation. Answer fast and accurately, and the card waits longer. Hesitate or miss, and it comes back sooner with a fresh AI explanation.
  • Enforced Daily Limit (No Cramming Allowed) 🛑: DeepRetain caps your daily reviews at 15 cards a day. Because the 16th card in one sitting does way less for your memory than the 1st card tomorrow, the app stops you once you hit your cap so you can close your laptop and relax.

Demo

https://deepretain.onrender.com

Code

DeepRetain: The Forgetting-Curve Knowledge Engine

Study less. Remember more. A study notebook that turns your notes into a few short reviews a day, and won't let you cram.

DeepRetain splits dense lecture notes into single concepts. A latency-aware Leitner system then decides when you see each one again, based on how accurately and how quickly you recall it. A daily limit stops you before cramming starts. Spacing does the rest.

There are nine ways to study, from one-tap multiple choice on a tired evening to explaining an idea out loud. Every answer feeds a Stats tab with the numbers worth looking at. Your settings, devices and progress follow your Auth0 account, so you can start on your phone and finish on your laptop.

Built for the Hacktoberfest 2026 Open-Source AI Challenge, Week 3: "Slow and Steady".

How this entry fits Week 3

Open-weight AI at the core. Everything that…

How I Built It

DeepRetain is built around Gemma 4 (Google's open-weight model under the Apache 2.0 license) paired with a modern full-stack web architecture:

  • Open-Weight AI Core (Gemma 4 + Ollama) 🤖:
    • Note Ingestion: Takes messy study notes and turns them into structured concept cards, generating distractors for multiple-choice, clozes for fill-in-the-gap, and true/false statements automatically.
    • Semantic Grading: Instead of failing you for a typo or a synonym, Gemma grades written, spoken, and "teach-it-back" answers based on meaning rather than exact wording. Only answers verified by Gemma can graduate a card into the final mastery box (Box 5).
    • Socratic Re-Explanation: When a card keeps slipping, Gemma breaks the concept down from a brand-new angle.
    • 3-Tier Inference Engine: Runs locally on your machine via Ollama, in the cloud with a free Google AI Studio key, or falls back to a built-in offline grader if you have no internet connection.
  • Frontend & Analytics 📊: Built with Next.js, TypeScript, and Tailwind CSS, featuring exponential forgetting-curve modeling ($R = e^{-t/S}$) that visualizes your current recall, slipping cards, response speed, and how many total reviews the spacing schedule has saved you.
  • Data Layer (MongoDB Atlas) 🍃: Stores user decks, Leitner box states (Boxes 1–5), stability scores, and full review/latency logs so every session picks up right where you left off.
  • Identity & Security (Auth0) 🔐: Handles cross-device login, syncs study preferences and device progress summaries, and stores encrypted user AI keys safely so you can start a 3-minute session on your phone and finish on your laptop.
  • Cloud Hosting (Render) ☁️: Hosts the full-stack Next.js application and API routes with zero-friction deployment.

Why Does Open Innovation Matter?

Building a daily study habit takes months or years—which is exactly why closed, pay-per-token APIs are a terrible fit for a personal study tool:

  1. Zero Ongoing Cost for Students 💸: A student using a flashcard app every day from September to AP Exams in May will run thousands of grading and card-generation prompts. Because Gemma 4 is open-weight (Apache 2.0), anyone can run it locally via Ollama for $0 forever, or bring their own free-tier key without getting locked into a subscription.
  2. Offline & Local Privacy 🔒: Study notes often include personal drafts, class materials, or private writings. Running Gemma locally through Ollama means your notes and spoken answers never have to leave your laptop—and you can study on a train or plane with no Wi-Fi.
  3. No Vendor Lock-In 🔧: Open weights and an MIT-licensed codebase mean the grading rubric, latency thresholds, and prompts are completely transparent and customizable. If a faster open model drops next month, you can swap it in with a single config change.

The Lazy Payoff

The math behind the Exponential Forgetting Curve ($R = e^{-t/S}$) shows why the tortoise beats the hare every time:

  • The Crammer (The Hare) 🐇: Studies for hours the night before a class test (Day 28) and crams again before the final (Day 40). Crammed memories have roughly 2 days of stability—by exam morning, recall drops back down to ~15%, despite hours of stressful late-night studying.
  • DeepRetain (The Tortoise) 🐢: Drops raw notes into DeepRetain in 30 seconds (saving 1–2 hours of manual flashcard formatting per chapter) and does just 4 spaced micro-reviews (Days 1, 4, 11, and 25). Each spaced review makes the memory 2.5x more stable, keeping exam-day recall above 71% in a fraction of the total study time.

I used DeepRetain this week to review AP Biology concepts like cellular respiration and glycolysis—spending less than 4 minutes a day answering quick prompts instead of re-reading pages of textbook notes.

Prize Categories

  • Best Use of Gemma (Uses Google's open-weight Gemma 4 model via Ollama and Google AI Studio for note-to-card generation, multi-mode question creation, semantic answer grading, and concept re-explanations)
  • Best Use of Render (Deployed and hosted live as a full-stack web service on Render)
  • Best Use of MongoDB Atlas (Uses MongoDB Atlas as the persistent data layer for concept cards, Leitner box states, forgetting-curve stability metrics, and review history)
  • Best Use of Auth0 for AI Agents (Uses Auth0 for cross-device authentication, syncing user study metadata/progress, and securing encrypted user AI keys)

來源:DEV Community · dev.to