# karpathy/reinforcejs

Reinforcement Learning Agents in Javascript (Dynamic Programming, Temporal Difference, Deep Q-Learning, Stochastic/Deterministic Policy Gradients)

Repository: https://github.com/karpathy/reinforcejs
Canonical: https://ross.abutalabs.com/products/reinforcejs
Language: HTML
License Family: other
Last push: 2019-02-18T20:11:56+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4155, "days_push": 2753, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1480, forks 355 (observed 2026-08-28T04:04:50.914982+00:00)

## What it is
REINFORCEjs is a JavaScript library implementing common reinforcement learning algorithms including Dynamic Programming, Temporal Difference Learning (SARSA/Q-Learning), Deep Q-Learning, and Stochastic/Deterministic Policy Gradients. It ships with web demos and exports an RL object with DP, TD, and DQN agent classes for building learning loops in the browser or Node.

## Use cases
- train reinforcement learning agents in the browser
- learn how Q-learning and deep Q-learning work
- implement tabular TD learning like SARSA
- experiment with policy gradient methods for continuous actions
- build interactive RL demos for teaching
- run a DQN agent on a custom environment in JavaScript

## When to choose
- you want to learn or teach RL algorithms with runnable browser demos
- you need lightweight RL agents in JavaScript for small state/action spaces
- you want a simple DQN implementation without heavy dependencies

## When to avoid
- you need production-grade, well-tested RL for real applications
- you need GPU-accelerated training or large-scale experiments
- you need actively maintained software with ongoing bug fixes
- you need policy gradient methods that are reliable, as they are described as very alpha

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, reinforcement-learning, agent-framework
- domain: reinforcement-learning, machine-learning, education
- platform: browser
- tags: reinforcement-learning, q-learning, deep-q-learning, policy-gradients, javascript, educational-demos, nodejs

## Member repositories
- karpathy/reinforcejs (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:50.914982+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:34:15.037233+00:00, confidence not recorded.
  - readme: https://github.com/karpathy/reinforcejs (fetched 2026-08-28T04:04:50.914982+00:00, sha 28c323f2068a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
