| name | ari-review |
| description | Run spaced repetition reviews (SM-2) with retrieval-first prompts and quality scoring |
| triggers | ["daily review","spaced repetition","review due","SM-2","quiz me","/ari-review"] |
ARI Review (Spaced Repetition)
Run a spaced repetition review session using the SM-2 algorithm. This implements evidence-based learning science from Roediger & Karpicke (2006) showing retrieval practice produces 3x better retention than restudying.
What It Does
- Fetches all cards due for review from persistent storage
- Presents each card as a retrieval prompt (front first)
- Collects quality rating (0-5) after reveal
- Updates card scheduling via SM-2 algorithm
- Shows session summary with streak and next review info
How To Run
When invoked, execute this review session:
const { getSpacedRepetitionEngine } = await import('../cognition/learning/spaced-repetition.js');
const engine = await getSpacedRepetitionEngine();
const now = new Date();
const dueCards = engine.getReviewsDue(now);
const stats = engine.getStats();
Session Flow
For each due card, present this interaction:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ ARI REVIEW SESSION โ
โ Card 1/5 โข 5 cards due for review โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ CONCEPT: Expected Value โ
โ โ
โ Q: What is the formula for Expected Value? โ
โ โ
โ [Take a moment to recall before revealing the answer...] โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ [Press Enter to reveal answer] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
After user attempts recall, reveal and rate:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ANSWER REVEALED โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ A: EV = ฮฃ(probability ร value) โ
โ โ
โ How well did you recall this? โ
โ โ
โ [0] Complete blackout โ
โ [1] Incorrect; barely remembered โ
โ [2] Incorrect; remembered fragments โ
โ [3] Correct with serious difficulty โ
โ [4] Correct with minor hesitation โ
โ [5] Perfect recall; effortless โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Processing Ratings
const review = await engine.reviewCard(card.id, quality);
console.log(`
โ
Card updated!
Ease Factor: ${card.easeFactor.toFixed(2)} โ ${review.easeFactorAfter.toFixed(2)}
Next Review: ${review.nextReview.toLocaleDateString()} (${review.intervalAfter} days)
`);
Session Summary
At the end of the session:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ SESSION COMPLETE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Cards Reviewed: 5
โ
Perfect (5): 2
โ
Good (4): 1
โ ๏ธ Hard (3): 1
โ Failed (0-2): 1
Average Quality: 3.6/5
Time Spent: 4 minutes
๐ Statistics:
Total Cards: 47
Due Tomorrow: 8
Average Ease: 2.43
Reviewed Today: 12
Next review session: Tomorrow at 8:00 AM
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
SM-2 Algorithm Reference
| Quality | Meaning | Effect |
|---|
| 5 | Perfect recall | Interval ร ease factor |
| 4 | Correct with hesitation | Interval ร ease factor |
| 3 | Correct with difficulty | Interval ร ease factor |
| 2 | Wrong but easy in hindsight | Reset to 1 day |
| 1 | Wrong, barely remembered | Reset to 1 day |
| 0 | Complete blackout | Reset to 1 day, decrease ease |
Creating New Cards
If the user wants to add concepts to review:
const card = await engine.createCard({
concept: 'Kelly Criterion',
front: 'What is the Kelly Criterion formula?',
back: 'f* = (bp - q) / b, where b = odds, p = win probability, q = 1-p',
visual: '[Position Size] โโโโโโโโโโโโ [Full Kelly]',
});
Error Handling
Storage Failures
If the spaced repetition engine cannot load or save card data:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ ๏ธ STORAGE ERROR โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ
โ Unable to load review cards from ~/.ari/learning/ โ
โ โ
โ Possible causes: โ
โ โข Directory does not exist โ
โ โข Insufficient read/write permissions โ
โ โข Corrupted cards.json file โ
โ โ
โ Recovery options: โ
โ [A] Create directory and start fresh โ
โ [B] Restore from backup (cards.json.backup) โ
โ [C] View detailed error โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Auto-recovery:
try {
const engine = await getSpacedRepetitionEngine();
} catch (error) {
if (error.code === 'STORAGE_INIT_FAILED') {
await fs.mkdir(path.join(homeDir, '.ari', 'learning'), { recursive: true });
await fs.writeFile(cardsPath, JSON.stringify({ cards: [] }));
}
}
Card Scheduling Errors
If SM-2 algorithm encounters invalid state:
if (card.interval < 0 || card.easeFactor < 1.3) {
card.interval = 1;
card.easeFactor = 2.5;
card.consecutiveCorrect = 0;
}
Card Management
Edit Cards
Update existing cards without losing scheduling history:
const updatedCard = await engine.updateCard(cardId, {
front: 'New question text',
back: 'New answer text',
});
UI Flow:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ๏ธ EDIT CARD โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ
โ Card ID: abc123 โ
โ Concept: Kelly Criterion โ
โ โ
โ Current Front: โ
โ "What is the Kelly Criterion formula?" โ
โ โ
โ New Front (or press Enter to keep): โ
โ [_____________________________________________] โ
โ โ
โ Current Back: โ
โ "f* = (bp - q) / b" โ
โ โ
โ New Back (or press Enter to keep): โ
โ [_____________________________________________] โ
โ โ
โ โ ๏ธ Scheduling data will be preserved โ
โ โ
โ [Save] [Cancel] โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Delete Cards
Remove cards permanently:
await engine.deleteCard(cardId);
Confirmation:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐๏ธ DELETE CARD? โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ
โ Card: "What is the Kelly Criterion formula?" โ
โ Concept: Kelly Criterion โ
โ โ
โ โ ๏ธ This action cannot be undone โ
โ โ
โ [Delete] [Cancel] โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Archive Cards
Suspend cards without deleting (for concepts no longer relevant):
await engine.archiveCard(cardId);
Archived cards are excluded from review queues but can be restored:
await engine.unarchiveCard(cardId);
Import/Export
Export All Cards
Save cards as portable JSON:
const exported = await engine.exportCards();
await fs.writeFile('my-cards-backup.json', JSON.stringify(exported, null, 2));
Export Format:
{
"exportedAt": "2026-02-02T12:00:00.000Z",
"version": "1.0",
"cards": [
{
"id": "abc123",
"concept": "Kelly Criterion",
"front": "What is the Kelly Criterion formula?",
"back": "f* = (bp - q) / b",
"interval": 7,
"easeFactor": 2.5,
"nextReview": "2026-02-09T12:00:00.000Z"
}
]
}
Import Cards
Restore from backup or import shared decks:
const imported = JSON.parse(await fs.readFile('my-cards-backup.json', 'utf-8'));
const result = await engine.importCards(imported.cards, {
mergeStrategy: 'skip'
});
console.log(`Imported ${result.added} new cards, skipped ${result.skipped} duplicates`);
Import Conflict Resolution:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ฅ IMPORT CONFLICT โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ
โ Found 3 cards with matching IDs in your deck: โ
โ โ
โ Card 1: "Kelly Criterion" โ
โ โข Your version: Interval 7 days, EF 2.5 โ
โ โข Import version: Interval 1 day, EF 2.3 โ
โ โ
โ How should conflicts be resolved? โ
โ โ
โ [A] Skip (keep your version) โ
โ [B] Overwrite (replace with import) โ
โ [C] Merge (keep better scheduling data) โ
โ [D] Ask for each conflict โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Core Modules
src/cognition/learning/spaced-repetition.ts - SM-2 engine with persistence
src/cognition/learning/storage-adapter.ts - File-based persistence
src/cognition/learning/retrieval-practice.ts - Socratic dialogue
src/cognition/learning/concept-cards.ts - Card generation
Best Practices
- Keep sessions short (5-10 minutes, ~10-20 cards max)
- Review consistently - Daily reviews build habit
- Be honest with ratings - Accurate ratings improve scheduling
- Use retrieval first - Try to recall before revealing
- Add visual encodings - Dual coding improves retention
See Also
Related Skills:
/ari-practice - Deliberate practice sessions that auto-generate review cards
/ari-learning-mode - Comprehension checks that create cards for key concepts
/ari-think - Deep reasoning that identifies concepts worth memorizing
Integration:
When you complete a /ari-practice session, cards are automatically generated for concepts where you struggled. These appear in your next review queue.
Workflow:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ [/ari-practice] โ Practice generates cards for weak areas โ
โ โ โ
โ [/ari-review] โ Daily reviews reinforce learning โ
โ โ โ
โ Cards mature over time (1d โ 7d โ 30d โ 120d intervals) โ
โ โ โ
โ Long-term retention and mastery โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Cross-Domain Learning:
Review cards span all three cognitive domains:
- LOGOS: Formulas, algorithms, quantitative reasoning
- ETHOS: Bias patterns, decision frameworks, emotional regulation
- PATHOS: Wisdom traditions, CBT techniques, philosophical concepts