Shy, soft-spoken Joel Barish and unrestrained free spirit Clementine Kruczynski meet on a Long Island Rail Road train from Montauk to Rockville Centre. Both had felt the need to travel to Montauk that day, and they almost immediately connect, feeling drawn to each other despite their contrasting personalities. Although Joel and Clementine do not realize it, they were in a relationship, separated after having dated for two years. After a fight, Clementine had hired the New York City firm Lacuna, Inc. to erase all her memories of their relationship. Upon discovering this from his friends Rob and Carrie, Joel decides to undergo the procedure himself.
The narrative subsequently takes place in Joel’s mind during the memory erasing procedure. Joel finds himself revisiting his memories of Clementine in reverse, starting from the downfall of their relationship. As he comes across happier memories of Clementine early in their relationship, he attempts to preserve at least some memory of her and his love for her, trying to evade the procedure by taking his idealized memory of Clementine into memories not linked to her and attempting to wake up and stop the process. Despite his efforts, the technicians were successful in erasing his memories. Joel comes to the last remaining memory of Clementine, the day he first met her, at a beach house in Montauk. As the memory disintegrates around them, she tells him to meet her in Montauk. This leads to both Joel and Clementine travelling to Montauk not understanding their feelings to go there, where they subsequently meets on the train.
A separate story arc occurs during Joel’s memory erasure, revolving around Lacuna’s employees. Patrick, one of the Lacuna technicians performing the erasure, uses Joel’s memories and his mementos of Clementine to seduce and date her in the present. Mary, the Lacuna receptionist, is dating another technician, Stan, but has feelings for the head of Lacuna, Dr. Howard Mierzwiak, who is married. During Joel’s memory wipe, Mary discovers she previously had an affair with Dr. Mierzwiak and agreed to have the affair erased from her memory after Dr. Mierzwiak’s wife found out. Devastated by this discovery, Mary quits her job and steals the company’s records, mailing all of Lacuna’s clients the tapes of each client recounting their memories to be erased.
In the present, Joel and Clementine meet at the Montauk train station and are eager to begin what appears to be a new and exciting relationship. When they both find their Lacuna records mailed to them by Mary, they are shocked and disturbed by the bitter memories they have of each other. Clementine attempts to leave, saying that the relationship might end the same way it did in the tapes. But Joel pleads to her. They realize that flaws in their relationship are inevitable but decides to go on with their relationship upon discovering that they are meant to be together.