For AI agents: the complete documentation index is available at https://open-spaced-repetition.github.io/ts-fsrs/llms.txt, the full documentation bundle is available at https://open-spaced-repetition.github.io/ts-fsrs/llms-full.txt, and this page is available as Markdown at https://open-spaced-repetition.github.io/ts-fsrs/guide/index.md.

Introduction

ts-fsrs is a TypeScript toolkit for building spaced repetition systems with FSRS. Its declarative API creates a reusable scheduler definition from a model, a chronology, and optional middleware.

Building blocks

A model is the FSRS algorithm and its parameters. FSRS7Model is the current one; FSRS-3 through FSRS-6 stay available for review histories built on them.

A chronology decides how time is represented. dateChrono works with Date, numericChrono with numbers in days, and temporalInstantChrono with Temporal.Instant.

Middleware adds scheduling policy, such as schedulerLearningStepsMiddleware, schedulerFuzzingMiddleware, schedulerMaximumIntervalMiddleware, or schedulerLeechMiddleware. Add them with .use(...) before creating the scheduler.

defineScheduler combines these into a definition. Calling .create() validates the configuration and returns an independent scheduler, so one definition can back several of them.

For your Agent
Integrate ts-fsrs into a TypeScript application

Copy this prompt and send it to your AI agent to install ts-fsrs and create a working FSRS-7 scheduler.

Head to Quick start to install the package and run a scheduler in the browser.