Cheating the forgetting curve
A śloka you learn today is mostly gone by next week — that is not a failure of willpower, it is a law of memory first measured in 1885. Shlokas does not fight the curve; it schedules around it, with two small schedulers and a fifty-year-old algorithm.
You sit down, you learn a verse. Dharma-kṣetre kuru-kṣetre… — by the evening it is solid, you can say it with your eyes closed. Three days later you reach for it and find a hole where the third line used to be. A week later the whole thing is a fog with two familiar words floating in it.
This is the most ordinary experience in the world, and it is also one of the few things about memory that was measured precisely, a very long time ago. It is not a defect in you. It is the shape of the problem any memorization app is actually up against — and the entire design of Shlokas is an answer to it.
The curve, and the man who drew it
In 1885 Hermann Ebbinghaus published Über das Gedächtnis — Memory: A Contribution to Experimental Psychology. He had no subjects but himself and no material he could already know, so he invented thousands of nonsense syllables — WID, ZOF, consonant-vowel-consonant scraps with no meaning to lean on — and memorized lists of them, then tested himself at growing intervals and wrote down how much survived. Out of that tedium came the forgetting curve: a steep drop right after learning that levels into a long shallow tail. In the modern shorthand,
where R is retrievability — how easily a memory comes back — t is the time since you learned it, and S is the memory’s stability, how slowly R decays when you leave it alone. The exact heights of the curve are argued over — a 2015 replication by Murre and Dros reproduced Ebbinghaus’s shape more than a century later, while the popular “you forget 80% in a day” figures are not really traceable to him and we don’t repeat them. The honest version is plainer and still brutal: without review, a fresh memory tends to halve in a matter of days. For a Sanskrit verse — no native meaning to grip, exact word order required — the tail is shorter still.
You cannot argue with this. But you can read the equation for a loophole, and there is one hiding in S.
The loophole: each recall raises the stability
The curve describes a memory left alone. Touch it — actually retrieve it, not just re-read it — just before it would have faded, and two things happen: R snaps back to the top, and S, the stability, increases. The next decay is slower. Do it again at the new, later moment of near-forgetting, and it slows again. This is the spacing effect, and it is the single most replicated result in the study of human memory. The whole game of spaced repetition is to catch each verse at the last cheap moment — late enough that the recall is real work (easy reviews teach nothing), early enough that you haven’t actually lost it.
That timing — when to show each card — is the only thing a scheduler does. The rest of the app is in service of it.
Two schedulers, because there are two problems
A verse you have never met and a verse you have known for a month are not the same problem, so Shlokas does not use one scheduler for both. The learning flow has three stages — memorize, recall, review — and a deliberate split underneath them.
stateDiagram-v2
[*] --> Memorize: new verse
Memorize --> Memorize: round, good
Memorize --> Recall: graduated after 4 rounds
Recall --> Review: learning step passed
Review --> Review: good or hard
Review --> Relearning: forgot
Relearning --> Review: recovered
Memorization is the first scheduler, and it is almost not a scheduler at all.
A new verse just needs exposure, repeated across a few days, before it is worth
testing. So it runs a simple round-based loop — Leitner in spirit — closer to a
flashcard box than to any equation: each good swipe advances one round, the
card comes back the next day, and after roundsRequired rounds (four by default,
and you can change it) it graduates. There is only one grade here. You are
not being measured yet; you are being introduced.
The moment a card graduates, it seeds the second world.
The second scheduler: a trimmed SM-2
Once a verse is known, the question becomes the interesting one — how many days until you’ll be on the edge of forgetting? — and here Shlokas uses the algorithm that has answered it for nearly forty years. Its lineage runs from Sebastian Leitner’s 1973 card boxes to Piotr Woźniak’s SuperMemo SM-2 (1987), the ancestor of essentially every spaced-repetition tool that followed, Anki included. Each card carries an ease factor; every interval is the previous interval times that ease, so intervals expand — 1 day, then a few, then a week, then a fortnight — and the ease itself drifts with your performance.
Ours is SM-2 with the corners deliberately rounded off, and it is small enough to
read in one sitting. Stamped into the code as sm2-v1, the defaults are:
recall: {
learningStepsMinutes: [10], // a brief in-session step before "review"
graduatingIntervalDays: 1, // first real interval: tomorrow
startingEase: 2.0, // SM-2 ships 2.5; we start gentler
minimumEase: 1.3, // the classic floor — nothing drops below it
easeDeltaGood: 0.05, // a confident recall slowly earns ease back
easeDeltaHard: -0.15, // "that was hard" — shrink the next jump
easeDeltaForgot: -0.2, // a lapse costs the most
hardIntervalMultiplier: 1.2, // "hard" still grows, just barely
maxIntervalDays: 180, // never vanish for longer than half a year
enabledGrades: ['forgot', 'hard', 'good'],
}
A few of those numbers are choices worth naming. We start the ease at 2.0,
not SuperMemo’s 2.5 — verses are harder than trivia and we would rather the early
intervals be a touch conservative than have a card balloon to a fortnight before
it is truly stable. We cap the interval at 180 days: textbook SM-2 will
happily push a mature card years out, but a devotee’s whole point is to keep
these verses warm, so half a year is as far as one is ever allowed to drift. And
we expose three grades, not six — forgot, hard, good, which map onto
SM-2’s 0–5 quality scale as 1, 3 and 4. A verse you either could not produce, or
produced with a struggle, or produced cleanly; the finer gradations SuperMemo
asks for are honest noise on a phone at dawn.
The grade does exactly what the spacing effect predicts. A good in review
multiplies the interval by the ease and nudges the ease up; a hard grows the
interval only slightly and trims the ease; a forgot is a lapse — the card
falls back to relearning, the ease takes its biggest cut, and you start rebuilding
stability. Concretely, a verse you keep getting right walks out something like
1 → 2 → 5 → 11 → 24 days, each correct recall buying a longer holiday, exactly
as the curve says it should.
A pure function, so the schedule can be replayed
One detail matters more than its size suggests. The scheduler is a pure
function — (previous state, grade) → next state, with no clock of its own and
no database underneath it. The time and the day-load are passed in; nothing is
read or written.
That is partly for testing — a pure function is trivial to check, and we can hand
it a fake clock and fast-forward a card through six months in a millisecond — but
it buys something deeper. Every review writes a row to review_logs carrying the
grade, the scheduler version, and a JSON snapshot of the state before and
after. The schedule is therefore not a mutable pile of due-dates we hope is
right; it is the fold of a log. Replay the grades and you reconstruct the
exact schedule. Ship a better algorithm tomorrow — sm2-v2 — and the old rows
remain interpretable, because each one says which scheduler computed it. It is
event sourcing on a budget, and it means a year of someone’s practice is never a
black box.
What the app is really doing
Step back and the whole thing is one idea. Ebbinghaus measured a leak; the spacing effect is the patch; SM-2 is a forty-year-old recipe for when to apply it; and Shlokas is that recipe, trimmed to verses and wired to a swipe. None of it makes memory effortless — the work of recalling a śloka is exactly the work that makes it stick, and we would not remove it if we could.
What it removes is the waste — the verses reviewed too early out of anxiety, the ones reviewed too late and lost, the flat panic of facing two hundred half-known ślokas with no idea which one is about to slip. The app holds the curve for every verse you know and shows you, each morning, only the handful standing at the edge. You do the remembering. It just makes sure you are never remembering the wrong thing at the wrong time.
In the next piece we’ll look at what happens when that “handful at the edge” stops being a handful — when the math wants to show you sixty cards on a Tuesday and four on a Wednesday, and why we taught the scheduler to bend.