Traumatic brain injury (TBI) is a leading cause of cognitive disability in adults, often characterized by marked deficits in episodic memory and executive function. Prior studies have found that direct electrical stimulation of the temporal cortex yielded improved memory in epilepsy patients, but it is not clear if these results generalize to patients with a specific history of TBI. Here we asked whether applying closed-loop, direct electrical stimulation to lateral temporal cortex could reliably improve memory in a TBI cohort. Among a larger group of patients undergoing neurosurgical evaluation for refractory epilepsy, we recruited a subset of patients with a history of moderate-to-severe TBI. By analyzing neural data from indwelling electrodes as patients studied and recalled lists of words, we trained personalized machine-learning classifiers to predict momentary fluctuations in mnemonic function in each patient. We subsequently used these classifiers to trigger high-frequency stimulation of the lateral temporal cortex (LTC) at moments when memory was predicted to fail. This strategy yielded a 19% boost in recall performance on stimulated as compared with non-stimulated lists (P = 0.012). These results provide a proof-of-concept for using closed-loop stimulation of the brain in treatment of TBI-related memory impairment.