amir/

structural reinforcement for spaced repetition

Structural Recall

A spaced-repetition system in which failing a card resurfaces the related cards built on the same underlying ideas, so a lapse refreshes the surrounding structure rather than one isolated fact. The relationships form an explicit motif graph. Scheduling uses FSRS, the current state-of-the-art open-source scheduler; the structural layer is this system's contribution.

SchedulingFSRS-6
Retrievalmotif graph
RankingIDF-weighted structural score
STATUSbuilt · two live corpora

The idea

Ordinary spaced repetition schedules each card independently: a card is forgotten, it returns, alone. Structural Recall adds a second signal. Cards are tagged with motifs — coarse, reusable ideas that recur across many topics (log-likelihood,divide and conquer, orthogonality). Failing a card resurfaces other cards built on the same motifs, refreshing the related structure.

The two engines

FSRS is the scheduling algorithm, predicting per-card recall probability and deciding when a card returns. The motif graph enables structured retrieval, deciding what returns on a failure. They meet at a single point: when the graph ranks neighbors equally, recall breaks the tie toward the card you are closer to forgetting.

Explainable on the structural path

When cards are served by the motif graph, recommendations come from traversing explicit, weighted links between motifs. Because the rule is explicit, any recommendation can be traced back to the links that produced it, rather than to an opaque similarity score. The links are LLM-drafted and human-reviewed.

Theoretical grounding

Two core design choices correspond to established results in memory and learning research.

Design elementResearch it rests onReference
Rank rare shared motifs above common onesThe fan effect — retrieval efficiency declines with associative fan, so rare shared motifs carry greater diagnostic weight than common ones.(Anderson, 1974)
Resurface structurally related cardsRetrieval-induced facilitation — retrieving one item can strengthen well-integrated related items after a delay.(Chan et al., 2006)
Grounded, not verified. These findings justify the design's form. They do not establish that resurfacing structure in this fashion improves retention for a given learner.

Populating the system

An LLM agent generates cards, motifs, and edges from source documents, constrained and reviewed by a surrounding pipeline. A human vets each proposed motif before it enters the vocabulary, resolves flagged duplicates, and reviews the edges.

Cards and motifs are generated, then reviewed

An automated pipeline reads source documents (lecture PDFs, notes) and produces draft cards with coarse concepts, typed kinds, and candidate motifs. Every proposed new motif passes through a human gate before it enters the vocabulary.

The graph is a separate, reviewed pass

Edges between motifs are generated in their own step once the vocabulary is stable, then reviewed. An edge is given full weight when two motifs are the same idea, half when they are merely related.

Automated generation, human judgment. The pipeline removes the authoring labor but keeps a person where judgment is required: which proposed motifs are real, which flagged duplicates to merge, and whether an edge marks an identity or a mere relation.

Architecture

Three layers, dependencies pointing downward.

UI layer dispatch + I/O
authoringreview
authoring exposes the manual corpus commands — ingest, review drafts, resolve duplicates, merge vocabulary, edit edges — each delegating to a logic-layer module; review drives a study session. Both route input and format output.
↓  depends on
Logic layer policy + computation · no SQL
recommendersessioningestionschedulervocabulary
recommender ranks the neighbors to reinforce on a failure; session assembles the daily plan and records each grade as the review proceeds; ingestion builds the corpus, owns its later mutations, and re-embeds it when the model changes; scheduler wraps FSRS: applies each grade to a card's memory state and versions the fitted parameters when they are re-optimized against review history; vocabulary admits or rejects proposed motifs and concepts. Each module receives its store rather than constructing one — injected, not imported — leaving the layer corpus-agnostic.
↓  depends on
Foundation the only SQL · text → vector
storeembedding
store owns the database: the schema, every read and write, the atomic grade commit, and the queue of cards awaiting reinforcement; embedding turns a card's text into a vector and computes the cosine similarity the fallback ranks on.
The store owns all SQL. No other module queries it, and it never hands out a live connection; callers receive plain data objects. A single boundary filter — reviewed, in rotation, not deleted — guarantees every component sees the same corpus.

What happens when you fail a card

// one failure, traced through the system

01ReviewFSRS builds the day: 15 scheduled cards by recall risk, and up to 3 reinforcements.
02FailA card graded again (the "I forgot" grade) pulls its due date sharply forward and triggers the neighbor search.
03ExpandCollect the failed card's motifs, plus motifs one edge away in the graph (single-hop).
04ScoreRank neighbors by shared-motif overlap, weighting rarer motifs higher, less each candidate's current recall probability.
05TomorrowThe top 1–2 neighbors per failure are queued for the next session, under a separate reinforcement budget.
The retrieval fallback. When a failed card's motifs reach no neighbors — leaving it structurally isolated — an embedding model (MiniLM) selects the nearest card by cosine similarity instead.

Failure signals structural decay

Motifs are reusable structures recurring across cards, so failing a card signals that the structure has decayed — not merely that one problem was hard. If you can no longer derive the OLS estimator, the underlying construction has likely faded wherever it appears. The system therefore resurfaces cards built on that structure: the ridge derivation carries the same motifs — normal equations, matrix inversion, squared-error loss — plus an L2 penalty, refreshing the decayed structure in a new setting. Kind-scope sets the search space — structural cards across topics, conceptual cards within one — and shared motifs select the neighbors.

Why reinforcement is deferred and capped

The day's plan is fixed once built: refreshes triggered by today's failures surface in the next session, under a hard cap of 18 cards (15 scheduled + 3 reinforcements). Reinforcements expire after 3 days if not surfaced — a deliberately short window. A related failure signals that the neighbor's shared structure may also be weakening; its reinforcement therefore acts as an early, short-horizon refresher, where optimal spacing runs on the order of days (Cepeda et al., 2008). Long-term scheduling is governed by FSRS.

scheduling budget 15reinforcement budget 3reach single-hopedge weight 1.0 / 0.5reinforcement TTL 3 days

The ranking score

On failure, each candidate neighbor c' is scored.

score(c') = Σm∈matched w(m) · ln(N/df(m)) p_recall(c')

w(m) — reach weight of a matched motif

For a motif the card carries directly, w(m) = 1.0. For a motif reached one edge away, w(m) is the edge's weight, which is a two-tier classification: 1.0 if the link is constitutive (an identity, "X is Y"), 0.5 if the motifs are related but distinct.

ln(N/df) — the fan penalty

Each motif is down-weighted by how common it is (df = the number of cards carrying it) — the IDF weighting from information retrieval. Its functional form mirrors the ACT-R fan effect, where a cue linked to many items retrieves each less reliably: both impose a logarithmic penalty that grows with count.

p_recall — probability of recall

FSRS's estimate that a candidate is still recallable, subtracted from its summed motif weight. Because the motif term is unbounded and recall probability lies in [0,1], recall cannot overturn a structural lead — it breaks ties among comparably related candidates, preferring the one closer to being forgotten.

Results — the motif system vs. text similarity baselines

Each card's top-3 motif-neighbors are compared against those chosen by two independent text baselines — semantic (embedding cosine) and lexical (text-Jaccard) — over the same population. Low overlap with both, reproduced across two independently authored corpora, demonstrates that the motif system surfaces cards neither baseline recovers.

// corpus A — ML / statistics

top-3 overlap with the motif system  ·  lower = more distinct
vs. cosine (semantic)0.185
vs. text-Jaccard (lexical)0.171

// corpus B — NLP (independently authored: own vocabulary, own graph, no shared motifs)

top-3 overlap with the motif system  ·  lower = more distinct
vs. cosine (semantic)0.146
vs. text-Jaccard (lexical)0.122
Different selections from both baselines, on both corpora. For each card, the motif system's top-3 neighbors and a text method's barely overlap — set overlap stays below 0.2 across both corpora and both baselines
Structure is mostly motif-sharing; edges are a narrow extension.On failure, each card is reached one of three ways: a directly shared motif, an edge in the graph, or the embedding fallback. Direct motif-sharing is most common (80.8% ML · 59.7% NLP); the edge graph is the sole route for a small remainder (2.4% ML · 0.7% NLP); the rest reach only the fallback.

Scope

Effectiveness is unverified. Effectiveness is literature-grounded and empirically unverified; no figure here is evidence of a learning benefit.
Coverage differs between the two corpora; the gap is in conceptual-kind cards, not structural ones. Both corpora reproduce the core finding — the motif method surfaces different neighbors than the text baselines. What differs is coverage: the NLP corpus has more motif-less cards, but the excess sits in conceptual kinds — definitions, intuitions, interpretations — which appear to group under shared motifs less readily than structural cards do (motif-less rate17.9% ML / 43.5% NLP), whereas structural kinds stay comparably low in both (9.5% ML / 14.3% NLP).

References

Anderson, J. R. (1974). Retrieval of propositional information from long-term memory. Cognitive Psychology, 6(4), 451–474. https://doi.org/10.1016/0010-0285(74)90021-8

Cepeda, N. J., Vul, E., Rohrer, D., Wixted, J. T., & Pashler, H. (2008). Spacing effects in learning: A temporal ridgeline of optimal retention. Psychological Science, 19(11), 1095–1102. https://doi.org/10.1111/j.1467-9280.2008.02209.x

Chan, J. C. K., McDermott, K. B., & Roediger, H. L. III. (2006). Retrieval-induced facilitation: Initially nontested material can benefit from prior testing of related material. Journal of Experimental Psychology: General, 135(4), 553–571. https://doi.org/10.1037/0096-3445.135.4.553

Structural Recall · structural reinforcement for spaced repetition