The film takes place in the 22nd century with the effects of climate change changing the world. Henry and Monica are a couple whose child Martin is very sick and remains in a state of motionlessness (suspended animation). The couple acquires David, a robot capable of loving, to replace Martin. Martin gets better and returns. He becomes jealous of David. Martin tries to get David to do dangerous things that may hurt others. At a party, David tries to protect Martin but ends up almost drowning David. David is to be returned and destroyed, but Monica lets David stay in the woods. David wishes to be turned into a real boy by the Blue Fairy. David gets captured by a "Flesh Fair" but gets out, because the people believe he is really human. David travels with Joe. He eventually arrives in New York and meets his creator. He sees that there are other robots like himself and wants to kill himself. He jumps in the ocean and encounters a statue he believes to be the Blue Fairy. Centuries later, humans are extinct, and other species find David and revive him. David wishes to become a boy. Instead, they use the genes of Monica's hair to recreate her so that David can live one more day with her. 