# ts-fsrs > Developer documentation for ts-fsrs ## Guide - [Introduction](https://open-spaced-repetition.github.io/ts-fsrs/guide/index.md): What ts-fsrs is, and how a model, a chronology, and optional middleware form a reusable scheduler definition - [Quick start](https://open-spaced-repetition.github.io/ts-fsrs/guide/quick-start.md): Install ts-fsrs, start with DefaultScheduler, and run both the default and custom scheduler examples in the browser with Rating.Good - [Migrating to v6 and FSRS-7](https://open-spaced-repetition.github.io/ts-fsrs/guide/migration.md): Migrate ts-fsrs v5 to defineScheduler in v6, then rebuild FSRS-7 memory from review history without rescheduling existing cards or using legacy APIs. - [Architecture](https://open-spaced-repetition.github.io/ts-fsrs/guide/architecture.md): Understand model, chrono, middleware, and scheduler responsibilities in ts-fsrs, create reusable presets, and follow a review from input to card and revlog - [State transitions](https://open-spaced-repetition.github.io/ts-fsrs/guide/state-transitions.md): Follow how ratings move cards through New, Learning, Review, and Relearning, and how card, revlog, memory state, and schedule status differ - [LLM](https://open-spaced-repetition.github.io/ts-fsrs/guide/llms.md): Read the ts-fsrs documentation as Markdown through llms.txt and llms-full.txt, and follow releases through the shared English Atom feed - [Model overview](https://open-spaced-repetition.github.io/ts-fsrs/guide/model/index.md): Understand the FSRS model contract, use a versioned model directly, and define a custom model with defineModel - [FSRS-7](https://open-spaced-repetition.github.io/ts-fsrs/guide/model/fsrs-7.md): FSRS-7 dual-trace formulas for recall, mixture weights, stability, difficulty, numerical intervals, and migration constraints - [FSRS-6](https://open-spaced-repetition.github.io/ts-fsrs/guide/model/fsrs-6.md): FSRS-6 formulas for trainable decay, initial memory, difficulty, recall, forgetting, same-day updates, and intervals - [FSRS-5](https://open-spaced-repetition.github.io/ts-fsrs/guide/model/fsrs-5.md): FSRS-5 formulas for its fixed power forgetting curve, difficulty, recall, forgetting, same-day stability, and intervals - [FSRS-4.5](https://open-spaced-repetition.github.io/ts-fsrs/guide/model/fsrs-4dot5.md): FSRS-4.5 formulas for its fixed power forgetting curve, interval inversion, difficulty, recall, and forgetting updates - [FSRS-4](https://open-spaced-repetition.github.io/ts-fsrs/guide/model/fsrs-4.md): FSRS-4 formulas for the power forgetting curve, interval inversion, initial memory, difficulty, recall, and forgetting - [FSRS-3](https://open-spaced-repetition.github.io/ts-fsrs/guide/model/fsrs-3.md): FSRS-3 formulas for the exponential forgetting curve, interval inversion, initial memory, difficulty, recall, and forgetting - [Chrono overview](https://open-spaced-repetition.github.io/ts-fsrs/guide/chrono/index.md): Choose a time representation for ts-fsrs, understand time normalization and day arithmetic, and customize dateChrono with defineChrono - [Date](https://open-spaced-repetition.github.io/ts-fsrs/guide/chrono/date.md): Use dateChrono with UTC date differences, fixed-duration addition, and card and revlog time fields - [Numeric](https://open-spaced-repetition.github.io/ts-fsrs/guide/chrono/numeric.md): Use numericChrono for relative day values and understand its zero-based time normalization - [Temporal Instant](https://open-spaced-repetition.github.io/ts-fsrs/guide/chrono/temporal-instant.md): Configure temporalInstantChrono timezones, fractional days, and calendar arithmetic - [Middleware overview](https://open-spaced-repetition.github.io/ts-fsrs/guide/middleware/index.md): Understand how middleware adds scheduling policies and application fields to a scheduler, and define fields and handlers with defineMiddleware - [Lifecycle](https://open-spaced-repetition.github.io/ts-fsrs/guide/middleware/lifecycle.md): Follow how middleware handlers run in order around the scheduler core, and how rollback and preview reuse the same handlers - [Built-in policies](https://open-spaced-repetition.github.io/ts-fsrs/guide/middleware/built-in.md): Review the middleware policies shipped with ts-fsrs and the order in which DefaultScheduler runs them - [Scheduler overview](https://open-spaced-repetition.github.io/ts-fsrs/guide/scheduler/index.md): Create a reusable scheduler definition with defineScheduler, create independent schedulers per configuration with .create, and compare with the DefaultScheduler preset - [DefaultScheduler](https://open-spaced-repetition.github.io/ts-fsrs/guide/scheduler/default-scheduler.md): Configure the DefaultScheduler preset, choose an FSRS model version, and decide when a preset or a custom defineScheduler definition fits - [Optimizer overview](https://open-spaced-repetition.github.io/ts-fsrs/guide/optimizer/index.md): Retrain FSRS weights from your review history with the binding, choose the Node or browser-Worker runtime, and follow the CSV-to-parameters pipeline - [Train and evaluate](https://open-spaced-repetition.github.io/ts-fsrs/guide/optimizer/train-evaluate.md): Follow the review-log pipeline with the binding — convert CSV to items, train weights, evaluate fit, and tune steps ## API - [ts-fsrs API overview](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/index.md): Index of the supported ts-fsrs API — the definitions, presets, policies, models, and types meant for application code - [DefaultScheduler](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/default-scheduler.md): Reference for DefaultScheduler — async factory returning a ready scheduler preset - [Scheduler](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/scheduler.md): Reference for the scheduler instance that defineScheduler.create and DefaultScheduler return - [Definitions](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/define/index.md): The define* functions for declaring schedulers, models, time abstractions, and middleware - [defineScheduler](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/define/define-scheduler.md): Reference for defineScheduler — create a reusable scheduler definition from a model and chrono - [defineModel](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/define/define-model.md): Reference for defineModel and the Model and ModelCore API it returns - [defineChrono](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/define/define-chrono.md): Reference for defineChrono — define a custom time abstraction for a scheduler - [defineMiddleware](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/define/define-middleware.md): Reference for defineMiddleware — extend schemas and run handlers around the scheduler core - [Chrono presets](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/chrono-presets.md): Reference for dateChrono, numericChrono, and temporalInstantChrono - [Rating, Grade, State](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/rating-grade-state.md): The rating and state enums and their validation schemas used by reviews and cards - [Models](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/models/index.md): Reference for the versioned model entry points under ts-fsrs/models/fsrs-3 through fsrs-7 - [FSRS-7](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/models/fsrs-7.md): Reference for ts-fsrs/models/fsrs-7 — model methods, weights, parameter helpers, schemas, and types - [FSRS-6](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/models/fsrs-6.md): Reference for ts-fsrs/models/fsrs-6 — the FSRS-6 model, its weights, bounds, parameter helpers, and decay - [FSRS-5](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/models/fsrs-5.md): Reference for ts-fsrs/models/fsrs-5 — its weights, bounds, and parameter helpers - [FSRS-4.5](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/models/fsrs-4dot5.md): Reference for ts-fsrs/models/fsrs-4dot5 — its weights, bounds, and parameter helpers - [FSRS-4](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/models/fsrs-4.md): Reference for ts-fsrs/models/fsrs-4 — its weights, bounds, and parameter helpers - [FSRS-3](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/models/fsrs-3.md): Reference for ts-fsrs/models/fsrs-3 — its weights, bounds, and parameter helpers - [Middlewares](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/middlewares/index.md): Index of ts-fsrs/middlewares — the built-in policies and the defaults, helpers, and schemas exported alongside them - [DesiredRetention](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/middlewares/desired-retention.md): Built-in middleware schedulerDesiredRetentionMiddleware — applies the desired retention target before interval calculation - [Cost ADR](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/middlewares/cost-adr.md): Cost ADR adjusts retention from memory state and review cost. Use `schedulerCostAdrMiddleware` instead of `schedulerDesiredRetentionMiddleware`; it is not included in `DefaultScheduler`. Interval caps still belong to `schedulerMaximumIntervalMiddleware`. - [LearningSteps](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/middlewares/learning-steps.md): Built-in middleware schedulerLearningStepsMiddleware — applies learning and relearning steps in short-term scheduling - [Fuzzing](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/middlewares/fuzz.md): Built-in middleware schedulerFuzzingMiddleware — spreads intervals for variety when enableFuzz is on - [MaximumInterval](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/middlewares/maximum-interval.md): Built-in middleware schedulerMaximumIntervalMiddleware — caps the day interval at maximumInterval - [Stats](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/middlewares/stats.md): Built-in middleware schedulerStatsMiddleware — maintains the reps and lapses counters - [MonotonicInterval](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/middlewares/monotonic-interval.md): Built-in middleware schedulerMonotonicIntervalMiddleware — ensures that the rating's intervals are never larger than previous ratings. - [ScheduledDays](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/middlewares/scheduled-days.md): Built-in middleware schedulerScheduledDaysMiddleware — stores the final interval as scheduled days - [Leech](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/middlewares/leech.md): Built-in middleware schedulerLeechMiddleware — suspends cards that lapse past a threshold - [Reschedule](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/reschedule.md): The ts-fsrs/reschedule entry point — replay review history and reschedule a card outside the normal review flow - [Utils](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/utils.md): Reference for the small numeric helpers exported from the ts-fsrs root — clamp and roundTo - [Types](https://open-spaced-repetition.github.io/ts-fsrs/api/ts-fsrs/types.md): Reference for the types exported from the ts-fsrs root ## Playground - [Playground](https://open-spaced-repetition.github.io/ts-fsrs/playground.md): Edit and run typed ts-fsrs and WASIP1 optimizer examples without blocking the page. ## Others - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/updates/index.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/updates/page/2.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/updates/page/3.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/updates/page/4.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/updates/page/5.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/updates/page/6.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/updates/binding/index.md): Published package releases, changelogs, and npm downloads.