On Valentine’s Day, 2004, Joel Barish awakens in his New York City apartment feeling hung over. Driven by an inexplicable urgency, he rushes to catch a train to Montauk, Long Island. There, despite the cold, he wanders the beach and writes in his journal, too shy to approach a girl with hair dyed electric blue, who catches his eye. They are on the same train home, however, and the extroverted girl, Clementine Kruczynski, launches into a conversation with Joel that is both stilted and oddly familiar. Clem’s quick temper frustrates Joel, who pulls away but later offers her a ride home and accompanies her into her apartment. Overwhelmed by his attraction to her quirkiness and candor, Joel leaves, but as soon as he gets home he calls her, and the next night she takes him to the frozen Charles River to lie on the ice. Over the course of the night, they fall in love, he enthralled with her liveliness and she drawn to his kindness. In the morning, Joel drives Clem home, and while she runs inside, Patrick, a stranger to Joel, asks him why he is there, then walks away. Two days earlier, Joel, deeply grieving over his breakup with Clem, takes a pill prescribed to him by Dr. Howard Mierzwiak of Lacuna, Inc. and, as planned, is soon comatose. Patrick and Stan Fink, Lacuna employees, enter his apartment and set up their equipment, which causes Joel to relive his memories of Clem, beginning with their breakup: Two days before Valentine's Day, he visits his friends Carrie and Rob Eakin to lament that Clem is acting as if she does not know him. Rob reluctantly hands Joel a card from Lacuna, which states that Clem has had him erased from her memory. Horrified, Joel visits the Lacuna offices, where Howard explains that Clem has opted to have all memories of Joel removed from her brain. Joel leaves but, devastated, returns soon after to demand that Howard perform the procedure on him, to remove Clem. Howard directs him to bring to the office everything associated with her, which they will use to create a “map” of his memories in his brain, after which the technicians will come to his house and overnight remove the memories. Later, back at the office, Stan maps Joel’s brain, but when in the present, one of the Lacuna machine’s wires malfunctions and the inexperienced Patrick fumbles with the plugs, Joel’s memories grow staticky, and his emerging consciousness allows him to enter his own memory. Disoriented and frightened, Joel questions Howard and finds that, within his own memory, he can comment on the occasion and watch it unfold. His two realities continue to blur as Joel simultaneously hears Patrick in the present discussing his new girl friend, and reexperiences his last fight with Clem: She comes home late, drunk, and reveals that she crashed his car. Both furious and fed up, they fight, and after Joel insinuates that she sleeps around to entice people to like her, Clem stalks out. He follows her down the street, but as cars drop from the sky, Joel announces to Clem that he is in the process of erasing her. In the present, Patrick, drinking beers with Stan, admits that after erasing Clem’s memory the week earlier, he fell in love with and began dating her. Hearing Patrick, Joel’s discomfort grows, but then Stan begins removing a previous memory, and Joel relives the moment when Clem, characteristically feeling trapped and irritated, leaves to go drinking alone. Then in an earlier memory, they fight over her desire to have a baby, and Clem is insulted that Joel does not consider her equipped to be a good mother. That memory begins to disintegrate, while in the apartment, Lacuna receptionist Mary Svevo arrives to spend the evening with Stan, her boyfriend. The three Lacuna employees raid the unconscious Joel’s liquor cabinet, Stan confident that the machine is on “autopilot,” while Joel courses through the next memories, including a dinner during which he worries that Clem drinks too much and they have little left to say to each other. From within the recollection Joel hears Patrick talking to his girl friend on the phone, and realizes that she is Clem. Patrick leaves to visit Clem, who, confused and frightened, sobs that “nothing makes any sense.” Secretly consulting the journal pages he has stolen from Joel’s bag of mementos, Patrick uses Joel’s past words to seduce Clem into loving him. Puzzled as to why Patrick, who says all the right things, makes her uncomfortable, she insists they visit the Charles. Meanwhile, Joel, recalling a day when Clem is tender and vulnerable, tries desperately to hold on to the memory, but instead is brought back to their first night on the frozen Charles, and relives the feeling of perfect happiness. At the same time, Patrick is on the Charles reciting Joel’s words to Clem, but she reacts with distaste. In Joel’s mind, he and Clem discuss how they can stop the erasure process, and on her suggestion, he manages to wake himself up. When that fails to work, she proposes that they hide her in a memory not mapped out by Lacuna, and he brings her back into his childhood. In his mother’s kitchen, Clem appears as a neighbor while Joel is at once his current self and his four-year-old incarnation. Just then, Stan realizes that the machinery has stopped, and stoned on marijuana and panicked, follows Mary’s advice to call Howard. The doctor arrives and, shocked that Joel is proving resistant to the technology, manages to “find” him again on the brainwave chart. Joel remembers watching a drive-in movie with Clem and making up the words, but when the car falls apart around them, he grabs her hand and runs, as the ground crumbles behind them. Clem exhorts him to find a more deeply buried memory, so Joel takes her to a moment of humiliation, when his mother caught him masturbating. This proves unsuccessful, so they move on to a more painful memory, when childhood bullies forced him to hammer a bird to death. Clem, now a child too, marches Joel out of the playground, but as they play by his house, it melts away, Howard having found him once again. In the apartment, Stan grows jealous over Mary’s attentions to Howard and so goes outside, and soon Mary gives in to her adoration of the doctor and kisses him. Howard tries weakly to resist, but then kisses her, not realizing that his wife Hollis has driven up and is watching through the window with Stan. Stan honks his horn, and Howard and Mary run outside to placate Hollis, but she informs Mary that this is not the first time she has kissed Howard. Trapped, Howard admits that after a failed romance between them, Mary asked to have him removed from her memory. Feeling violated, Mary returns to the office to search for the tape recording Howard made of her verbal memories. Meanwhile, Joel is remembering the day after he met Clem, when he goes to the bookstore where she works. She is at first distant as she informs him, in the past, that she will not be his savior, then kind when he confesses, in the present, that he has always wanted her to be. As the book titles fade around them, she urges him to remember her. Finally, Joel experiences again the day they met, at a beach party in Montauk. During the memory, both are aware that this is the last memory remaining, and try to enjoy its sweetness. He watches with trepidation and admiration as she breaks into an empty house, and although he leaves her there alone, in the present he is able to return to proclaim his love. As the house falls into ruins, she whispers to him to meet her in Montauk, and soon, the procedure is finished. The next morning, Valentine's Day, Joel awakens in his apartment feeling hung over, then, driven by an inexplicable urgency, rushes to catch a train to Montauk. He meets Clem on the train, and two mornings later, she leaves his car to get her toothbrush and Patrick knocks on Joel’s window. On her way back out, Clem grabs her mail, in which she finds an envelope from Mary, who has returned all of Lacuna’s clients’ audio tapes. In the car, Clem and Joel listen to Clem, weeks earlier, discussing the reasons why she wants to erase Joel, and Joel reacts with fear and disgust, causing Clem to leave the car. She soon drives to his apartment, however, where she finds him listening to his own tape. They try to ignore the terrible statements on the tapes, but Clem, realizing how badly their old relationship ended, decides to leave. Joel follows her, however, and proposes they try again. As she counters that they already know what will go wrong and how, Clem realizes that even with the uncertainty and possibility of failure, their love is worth another try, and their memories worth rebuilding.