Even when Jon Hamm is at his most animated, there’s a certain stiff formality to his onscreen persona.

He’s the American Michael Fassbender.

The casting of the handsome Hamm as a disturbingly calm and increasingly complex and “intelligent” hologram in “Marjorie Prime” is almost too perfect. Even though we know this is a dysfunctional family drama and not another “Alien” movie, Hamm is so chillingly good as the imperturbable artificial being, we half-expect him to go rogue and start eliminating the humans in the name of his self-preservation.

Based on an award-winning play by Jordan Harrison and adapted for the screen with minimalist efficiency by writer-director Michael Almereyda, “Marjorie Prime” sounds like the title of a British miniseries, but is in fact one of the strangest, most disturbing and most thought-provoking films of 2017.

Set sometime in the near future, “Marjorie Prime” plunges us into the lives of a fragmented, upper-middle-class family that has been hit multiple times with devastating tragedies.

The veteran actress Lois Smith gives a nomination-worthy performance as Marjorie, who is near the end of her life and is well aware of that reality. Marjorie spends many an hour reminiscing and hashing over the past with her husband Walter, who has been quite dead for many years now.

Well. The man in the suit sitting across from Marjorie in their beautiful house by the sea isn’t Walter in the flesh; it’s a computer-generated hologram of Walter in his 40s, when he and Marjorie were at least relatively happy. Hologram Walter has been programmed to “remember” myriad details of his life with Marjorie — but he doesn’t “know” everything. She has to fill him in on the particulars of certain events, remind him of how he acted and felt, tell him what he said or did. Walter stores away this information and says, “I’ll remember that next time.”

Geena Davis gives a quietly intense performance as Marjorie’s daughter Tess, who has been hardened by life’s setbacks and has a fragile, perpetually tense relationship with her mother. Tess is against the whole Hologram Walter thing. She comes to resent how her mother shows more affection for a computer program than the daughter right in front of her.

Tim Robbins is Tess’ husband Jon, an aging hippie type who is outwardly more laid-back than his wife, but is wrestling with his own demons. (He self-medicates with bottomless glasses of Scotch.) As the events of “Marjorie Prime” unfold and grow ever darker, Robbins does a beautiful and subtle job of conveying how the weight of life is literally bringing Jon down. The simple act of taking the stairs up to the bedroom becomes such a task Jon has to pause in mid-climb and summon the physical and emotional strength to carry on.

“Marjorie Prime” traffics a lofty road, posing questions such as: if you could bring back a deceased loved one in the form of a computer program, which version of that person would you summon? And once that person was in front of you, which memories and conflicts and lovely moments would you most want to discuss?

The exchanges feel slightly redundant at times. The stagey origins of the material surface occasionally. Minor bumps, though, in a unique psychological journey.

★★★1⁄2

FilmRise presents a film written and directed by Michael Almereyda, based on the play by Jordan Harrison. No MPAA rating. Running time: 99 minutes. Opens Friday at Facets Cinematheque.