Warning
This is an experimental project and a work in progress. It is intended for educational and demonstration purposes.
This is a platform for learning propositional logic. By using a knowledge graph to track what you know, the system schedules reviews using the FSRS v6 algorithm.
- I was fascinated by the Math Academy system and wanted to create something similar.
- I wanted a cool project to help land an internship (hiring? moaaz.ae@proton.me).
- For this to be a resource for others who want to start using the "Math Academy way" to build the most effective platforms for learning.
- Math Academy: The main inspiration for this system.
- Justin Skycak: For the book The Math Academy Way, which provides the pedagogical foundation for the platform.
The system uses two main data structures.
The curriculum is a directed acyclic graph containing 29 topics. Each topic links to its prerequisites via edges with weights from 0 to 1; a weight of 1 means the prerequisite is practiced completely when the lesson is practiced.
graph LR
sentences["Sentences"] -- 0.3 --> atomic["Atomic Sentences"]
sentences -- 0.3 --> arguments["Arguments"]
atomic -- 0.3 --> tfunc["Truth Functions"]
atomic -- 0.5 --> conj["Conjunction"]
tfunc -- 0.5 --> conj
conj -- 0.3 --> wff["Well-Formed Formulas"]
wff -- 0.7 --> scope["Scope"]
scope -- 0.2 --> cond["Conditional"]
The database stores the state for every user and topic, tracking your progress in the topic_state table.
- Stability: The number of days until the system predicts a 90% chance of recall.
- Difficulty: A value from 1 to 10. It represents how hard the topic is for you.
- Due Date: The next time you should review the topic.
The platform uses five core algorithms.
The placement test finds your level quickly by using a binary search on milestones.
- The system identifies milestones in the topological order of the graph.
- It picks the middle milestone and gives you a problem.
- If you pass, the search continues in the later half of the graph.
- If you fail, it searches the earlier half.
- When the pass/fail boundary is found, the system marks all topics below it as "Review" state.
The Free Spaced Repetition Scheduler (FSRS) predicts when you will forget a topic. It uses the DSR model (Difficulty, Stability, and Retrievability) to calculate the probability of recall.
-
Retrievability (
$R$ ): The probability you remember a topic. It follows a power law. - Formula:
-
Weights: The algorithm uses 21 trainable parameters (
$w_{0 \dots 20}$ ) to update stability and difficulty after every answer.
FIRe updates the stability of parent topics when you solve a child topic, which prevents redundant reviews of simple concepts.
- You answer a problem correctly.
- The system calculates a "chain weight" by multiplying the edge weights of the prerequisites.
- It applies a stability boost to all ancestor topics in the graph.
- Boosts decay as the algorithm moves further away from the original topic.
The scheduler decides which topics to show on your dashboard.
- Unlocking: A topic is "New" only if all its prerequisites are in the "Review" state.
- Compression: If a topic is due and its child is also due, the system only shows the child.
- Relearning: If you fail a prerequisite, the system hides all dependent topics until you fix the prerequisite.
The src/lib/logic.ts module parses LaTeX logic formulas and evaluates them. It checks formula equivalence by generating and comparing truth tables.
- Parser: A recursive descent parser converts LaTeX strings into an Abstract Syntax Tree (AST).
-
Operators: It supports
$\neg$ ,$\land$ ,$\lor$ ,$\to$ , and$\leftrightarrow$ .
- ts-fsrs
- SvelteKit (Svelte 5)
- PostgreSQL with Kysely
- Better Auth
- TailwindCSS v4
- Remark/Rehype ecosystem with KaTeX
- Kamal & Docker
- Vitest (Unit) and Playwright (E2E)
src/lib/curriculum: Lesson files and problem definitions.src/lib/server/services: Implementation of the diagnostic, scheduler, and FIRe.src/lib/server/fsrs: Thin wrapper that configures and re-exports thets-fsrsscheduler.src/lib/logic.ts: The parser and truth table evaluator.
Install dependencies:
pnpm installStart the database and sync the curriculum:
pnpm db:start:dev
pnpm db:migrate:dev
pnpm db:seed:devRun the server:
pnpm devMIT