Some couples seem to be perfect for each other, but can any relationship achieve perfection?

Silicon Valley entrepreneur Tim Scott believes that his wife, Abbie Cullen-Scott, was the perfect wife, the perfect mother and that they had the perfect marriage. And that’s what he tells her. But this Abbie may look like his wife and possess her memories, but she isn’t human. She’s a “companion robot,” manufactured by Tim, founder of Scott Robotics based in San Francisco.

JP Delaney’s third psychological thriller, “The Perfect Wife,” puts — almost perfectly — a high-tech spin on the stories of Frankenstein and Pygmalion with a tinge of the Stepford wives. Delaney includes just enough technology while keeping the focus primarily on the characters.

Abbie wakes up in what seems to be a hospital, having a dream about when she and Scott became engaged. But as Scott explains, that wasn’t a dream but “an upload” and that she is a “cobot” with carefully curated “memories” that don’t include what happened to the real Abbie. But Scott gave this new Abbie an intelligence — no matter how artificial — and the ability to eventually render emotions. She’s stunned to learn that Abbie disappeared in a surfing accident five years earlier. Tim was accused of her murder but the charges were dismissed because of a lack of evidence. While Tim tries to keep the existence of this Abbie quiet, the news gets out, igniting unwanted publicity and relaunching a police investigation.

“The Perfect Wife” smoothly alternates between the new Abbie’s narrative and the couple’s past, showing how the uptight Tim fell in love with this free-spirited artist. Abbie tells her story in second person, as if she’s not quite sure what she is, while their story as a couple is told by an unseen narrator.

Abbie is a compassionate character and is instantly appealing. It’s easy to forget that she’s a machine as she explores developing her emotions and feelings. At first, Tim seems like a good guy whose palpable grief led him to build a replacement. But Delaney’s subtle approach in depicting Tim’s controlling nature, his pathological obsession with work, and his neurosis about perfection add to the tension and the possibility of violence.

The intriguing plot leads to a chilling and surprising finale that perfectly caps “The Perfect Wife.”