A giant nuclear explosion grew on the horizon. A shock wave shook the remnants of the city, and shattered the remaining windows in the empty carcass of a skyscraper. A fleet of drones flew by, scanning the environment, looking for the enemies.
Target locked - a two-stories tall rusty robot was rolling on it's tracks down the street. In a few minutes it was pierced by laser rays and turned into a few glowing hot remnants scattered on the ground. Drones continued their search. Once they have passed, several cleaning robots started working on restoring the skyscraper. There were too few of them to fix the city, but they have significantly slowed down the deterioration. Most of the cities looked like that, the remaining battlefields of the pointless war. There were no humans in the world for more than 1000 years.
In the middle of the desert, in a place not marked on any of the maps, stood a big research facility. Several automatic factories kept producing more and more robots and drones. Robots gathered resources, repaired the damages, and kept all the systems working. This facility was very rarely attacked by enemy forces, it easily defeated all the robots that came close, and jammed the signals, preventing them from disclosing the location to the rest of the world.
The facility was operated by a simple, non-sentient proto-AI. Before leaving the place in panic, one of the lead scientist changed the algorithm, which now introduced small semi-random mutations into the bots that are being built, measured statistics on all the bots, and built new ones based on the combination of several best-performing models.
Today was a special day. One of the bots rolled down from the construction line, downloaded and analyzed all of the available information, processed it, and composed it's own, personal utility function, which was the equivalent of a human question "Who am I?"