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.