In the near future, a train crash revolutionizes the lives of two teenagers.
Eighteen-year-old music savant, LUKE, loses his mother, causing a resurgence of his self-destructive impulses, and stifling his composing abilities.
Nineteen-year-old neuroscience student, RILEY, who almost boarded the train, develops a renewed sense of purpose after suffering through two devastating events—her brother’s death by Huntington’s, and being raped by her uncle. She resumes working with an institute building the AMRED—a memory-erasing device to replace the now outlawed ones that triggered side effects. Upon completion, Riley seeks to eradicate the traumatic memories of her assault.
Riley’s plans are stalled when the mayor diverts funding for the AMRED towards establishing the Mental Health Database—a watch list for monitoring mentally ill citizens prone to violence. This is a move by the mayor, who in hoping to get re-elected, capitalizes on mental illness stigmatization that spikes after it’s revealed the train’s driver was schizophrenic. Riley’s PTSD places her on the watch list.
Luke, who’s been home-schooled since his first suicide attempt at twelve, after his dad left, enrols in high school. He does so under the persuasion of GARY—a board member who was romantically involved with his mom.
After the demise of the school’s music teacher, Riley—who was his assistant—is appointed as an interim replacement. A former songwriter, she’s tasked by Gary with helping Luke rekindle his creative spark in time for his concert. At the end of class, the two bond over their mutual passion for music.
Luke’s serenity is disrupted when he fails to control his impulses, and gets into a fight. Luke gets entered into the watch list. Feeling marginalized, he succumbs to the seductions of his impulses, resolving to kill himself. But after a bonding experience with Riley during class, Luke’s impulses are calmed. He realises to beat his demons, he’ll need help. Gary finds him a therapist—DR. FERRELL.
Luke’s appointment ends in disillusionment, with Dr. Ferrell showing disinterest to his troubles. Bored, Luke attends a recovery meeting where he runs into his history partner, ASH, a recovering addict. They agree to work on their assignment after Ash gets clean.
Meanwhile, Riley visits her parents, and learns her mother put her uncle up to raping her—the revelation reopening Riley’s emotional wounds. She renews her search for funding the AMRED. She proposes the idea to her old professor—Ash’s Dad, who successfully pitches it to a research institute.
When Ash leaves rehab, he and Luke visit of a historical site, where they encounter advocates of the database. In the ensuing confrontation, Luke learns Ash’s also on the watch list. Ash, feeling their partnership has evolved into a friendship, gives Luke a birthday present. Fuelled by his impulses, Luke terminates their friendship. Overcome by depression, Ash turns to drugs to numb his Luke-inflicted pain. This time, he fatally overdoses.
After Ash’s funeral, Luke puts a gun to his head. Riley—who’d stayed behind with Ash’s dad—stops Luke from pulling the trigger, persuading him he’s redeemable. Luke surrenders the weapon to her, and the two share an intimate moment.
Later that night, Luke is awoken by the symphony in his dreams, and begins scribing it. He’s interrupted by SKYLAR—his half-sister living with their dad. She hands him a package mistakenly sent to their address by Ferrell. Luke quickly discards it.
Riley visits a police station to handover Luke’s gun, only to be informed it was reported missing by Gary. Her predicament is exacerbated when they discover she’s in the database. Riley’s spared incarceration by Gary’s intervention. He leaves her the gun for her protection.
Luke completes his symphony in time for the concert. Riley asks him to meet her before performing. Still shaken from the incident with the police, she intends to propose to him the idea of leaving their town—which’s becoming increasingly unsafe for the mentally ill—for the institute’s town where she’ll complete building the AMRED, and thereafter they’ll delete the traumatic experiences which birthed their demons.
While Riley awaits Luke, she opens the package she also received from Ferrell, which contains a USB stick. She plays it and a video pops up showing her thirteen-year-old self and her mom in a meeting with Ferrell, who’s prepping Riley for a procedure to wipe the memory of watching her brother jump to his death after getting into a suicide pact with Luke.
Luke arrives. Terrified by what she’s learned, Riley pulls out the gun. As he tries to placate Riley, she inadvertently sets off the weapon, injuring him. Scared and confused, she calls Gary about Luke, and races to find Ferrell.
At the hospital, Luke awakens to find Ferrell in his room. He leads Luke to his office where he finds Riley—whom Luke apologizes to but is shunned. Ferrell proceeds to divulge to Luke how he made a suicide pact with Riley’s brother, but bailed. To cure his remorse-ridden mind of his betrayal, he underwent a memory-erasure procedure—which deleted his memories but didn’t wipe the guilt emotions linked to those memories. Luke learns his impulses are a manifestation of this guilt.
Wary of additional damage tampering with memories might do, Riley abandons the AMRED, and joins a research fellowship at a foreign university with the hope of finding a cure for Huntington’s—which while it didn’t claim her brother’s life is slowly making strides in ending hers.
Months pass, and Riley still hasn’t made progress, unlike her disease. Realizing she has limited time left, she returns home to a town with a new mayor, and a closed database. Her search for Luke leads her to their old music class. Luke—devoid of Riley to help tame his impulses—has learned to cope without her after finding companionship in Skylar. The two share one final heartfelt moment before she bids him goodbye.