The story takes place in the future where the greenhouse gases have caused the polar icecaps to melt, flooding coastal cities. To combat over-population, people wishing to have children must apply for a license.
The film starts in the offices of a company called Cybertronics, where its owner, Professor Allen Hobby (William Hurt), wishes to push mecha (aka robotic) technology, to make a creation that can love. When his colleagues mention their 'love units' Hobby corrects them: he is not talking physical love, but emotional love, such as that of a child for its mother.
The narrative then moves 18 months into the future where the Swintons, whose son Martin (Jake Thomas) is currently in cryostasis until a cure can be found for a debilitating disease he is stricken with.
His mother Monica (Frances O'Connor) has not held up well emotionally under the conditions that have taken her son from her.
Hoping to help her cope, her husband Henry (Sam Robards), a Cybertronics employee, takes part in a test wherein they would be able to be a family to the company's newest mecha: David (Haley Joel Osment), the culmination of Hobby's research to make a robot that can 'love.'
At first, Monica is angry, believing her husband is trying to 'replace' Martin.
However, Monica tries to adapt to David. Henry also informs her that if they choose to keep David that she must 'imprint' herself upon him.
However, if there was ever to come a time that she chose not to want him, due to the imprinting being permanent, David would need to be sent back to Cybertronics to be destroyed. After some time, Monica decides to perform the imprinting process.
She reads a list of words that will activate David's emotional simulation. When she does, David calls her "mommy" and begins to act like a real child. To provide David with another form of companionship, she gives him a robotic teddy bear called Teddy, which once belonged to Martin.
Things appear to be going well for the Swintons, until one day, a cure brings Martin back to health. Martin looks upon David not as a human, but more as a 'supertoy' or a 'doll.'
One day, Martin asks their mother to read them 'Pinocchio,' to which David becomes enamored by, in which the wooden puppet becomes a real boy thanks to the story's Blue Fairy.
Martin then tries to get David into trouble in a number of ways.
First, he cajoles David into eating spinach, which causes David to malfunction and need cleaning.
Another time, he tells David to cut off some of Monica's hair while she sleeps as a gesture of love, but the incident makes Henry think that David was trying to attack his wife. At Martin's birthday party, one of his friends decides to test David, to see if he has a way to prevent himself from pain.
The 'test' causes David to grab onto Martin, crying 'keep me safe.' The two fall into the Swinton's swimming pool, where it seems that David was attempting to drown Martin.
Henry decides that David is no longer safe, and convinces Monica to return David to be destroyed. Monica tries to take David to Cybertronics under the cover story of going on a picnic.
However, she cannot bring herself to take David directly to Cybertronics and abandons him in a forest, along with Teddy. David becomes frightened and confused and he questions why he is being forced to leave his mother.
Meanwhile, a male-prostitute mecha, Gigolo Joe, arrives at the apartment of a woman he sees regularly.
He changes his appearance to suit her and, entering the bedroom, finds her dead. Her husband appears and kisses his wife, saying "I might have killed you but you killed me first". Joe retreats, realizing that the woman's husband is framing him for the murder. Joe rushes out of the apartment building and cuts off his registration tag to avoid detection by the police.