An agent (the glowing sphere) lives on a 6×6 grid. Each episode it starts at the blue tile and tries to reach the green goal tile while avoiding the two red pits and the dark wall blocks. It has no map — only a Q-table of estimated values for every (state, action) pair, which it updates after every single step using the Bellman equation.
Q(s,a) += α · (r + γ · max Q(s') − Q(s,a)).Q-learning is off-policy: it always bootstraps toward the best possible next action, even while the agent itself is busy exploring randomly. That single design choice is what lets the same algorithm learn a correct, optimal policy even though most of the moves it actually makes during training are deliberately imperfect.
A single agent wanders a 3D 6×6 grid, running full Q-learning updates after every real step it takes — no scripted animation, the tile colors and policy arrows you see are literally the live Q-table.
Every tile's color encodes its current best-known Q-value and every cone shows the greedy action for that state, so you can watch the Bellman equation propagate value backward from the goal through the grid, step by step, episode by episode.
Tune the learning rate, discount factor and exploration rate, then watch the agent bounce between random exploration and exploitation of what it has already learned. Reset the Q-table at any time to start the learning process from zero again.
Q-learning was introduced by Chris Watkins in 1989 and proven to converge to the optimal policy under mild conditions — even though the agent that's collecting the data is, by design, not always acting optimally.