Pain and trauma permeate Michel Franco’s new drama “Memory,” about two lost souls who find surprising comfort in one another. Both Jessica Chastain’s Sylvia and Peter Sarsgaard’s Saul are hostage to their own minds, though in vastly different ways. Hers haunts her. His is failing rapidly. And neither are entirely trustworthy.

“Memory” starts as a seemingly standard- issue “damaged person” movie, introducing Sylvia celebrating 12 years of sobriety at an Alcoholics Anonymous meeting that her 12-year-old attends with her. But there are layers to this mystery, compounded with unreliable narrators and moral gray areas. Before you know it, the film morphs into something unexpected.

Though it is not easily categorizable, “Memory” is a thoughtful journey featuring fine performances from Chastain and Sarsgaard. While there are moments of levity to break up the anguish, it could also come with a laundry list of trigger warnings as it explores difficult subjects from sexual abuse to mental illness in unsatisfactory ways.

The film binds you at first to Sylvia, a social worker and single mother who is suspicious of everything and everyone. She lives by a strict routine: Walking her daughter, Anna (Brooke Timber), to school, going to work at an adult day care and her AA meetings. Home is a fortress: As soon as she steps into her downtrodden apartment, she’s triple locking her door and punching in the security code to arm the place.

It’s surprising that her younger sister Olivia (Merritt Wever) is able to convince her to tag along to a high school reunion event early in the film. The decision seems even more unfathomable when you learn about Sylvia’s school years, but it’s clear that she is uncomfortable and unhappy at the event, which she soon leaves.

For a moment, you wonder if perhaps her fears are warranted as she realizes that night that a man is following her home, first down the street, then onto the same subway car, then right to her doorstep. Hours later, the man is still there outside, looking up at her. Is he imagined? A dream? An ex? A stranger?

The man in question is Saul, who she finds out has early onset dementia. He won’t remember that he followed her home or why, but he will remember her, for whatever reason. His brother, Isaac (Josh Charles), asks if Sylvia would want to work as a companion to Saul.

Saul and Sylvia develop a deep bond with one another. Both are damaged and longing for connection and their friendship is like a balm, until it evolves into something else. The relationship presents an ethical quandary that the movie does not seem willing to engage with in any serious way, making “Memory” feel underdeveloped at best. At worst, it’s not even sure what it’s trying to say. And it has one of those endings that presents itself as happy but leaves you with a lingering feeling of dread.

Sarsgaard does a beautiful job of playing this man who has been dealt an awful card, whose body still works but whose mind is untrustworthy. His isn’t the only one: Sylvia also has flawed recall. It all compounds into misery, secrets and shame. Memory may be imperfect, the movie reminds us, but feelings rarely are.

MPA rating: R ( for graphic nudity, some sexual content and language)

Running time: 1:50

How to watch: In theaters