A memory of prior thermal experience governs Caenorhabditis elegans thermotactic behavior. On a spatial thermal gradient, C. elegans tracks isotherms near a remembered temperature we call the thermotactic set-point (T(S)). The T(S) corresponds to the previous cultivation temperature and can be reset by sustained exposure to a new temperature. The mechanisms underlying this behavioral plasticity are unknown, partly because sensory and experience-dependent components of thermotactic behavior have been difficult to separate. Using newly developed quantitative behavioral analyses, we demonstrate that the T(S) represents a weighted average of a worm's temperature history. We identify the DGK-3 diacylglycerol kinase as a thermal memory molecule that regulates the rate of T(S) resetting by modulating the temperature range of synaptic output, but not temperature sensitivity, of the AFD thermosensory neurons. These results provide the first mechanistic insight into the basis of experience-dependent plasticity in this complex behavior.