What we remember reflects both what we encounter, such as the intrinsic memorability of a stimulus, and our internal attentional state when we encounter that stimulus. Our memories are better for memorable images and images encountered in an engaged attentional state. Here, in an effort to modulate long-term memory performance, we manipulated these factors in combination by selecting the memorability of presented images contingent on individuals’ natural fluctuations in sustained attention. Can image memorability and attentional state be strategically combined to improve memory? Are memorable images still well-remembered during lapses in sustained attention, and conversely, can attentive states rescue memory performance for forgettable images? We designed a procedure to monitor participants’ sustained attention dynamics on the fly via their response time fluctuations during a continuous performance task with trial-unique scene images. When high or low attentional states were detected, our algorithm triggered the presentation of high or low memorability images. Afterwards, participants completed a surprise recognition memory test for the attention-triggered images. Results demonstrated that memory performance for memorable items is not only resistant to lapses in sustained attention, but also that memory cannot be further improved by encoding memorable items in engaged attentional states. On the other hand, memory performance for low memorability images can be rescued by attentive encoding states. In sum, we show that both memorability and sustained attention can be leveraged in real time to maximize memory performance. This approach suggests that adaptive cognitive interfaces can tailor what information appears when to best support overall memory.