At first, Sheppard's team is thrilled to discover a vast, highly technological city called Asuras, full of people who claim to be Ancients. Weir eagerly opens negotiations with the Asuran High Council, but the city's leader, Oberoth, arrogantly refuses to initiate trade and flatly denies the humans any help in their war with the Wraith. Even after he grudgingly concludes that his primitive guests may possess worthwhile knowledge, he still doesn't negotiate with them - he just locks them up.
A second Asuran, Niam, treats Weir, Sheppard, McKay, Ronon and Teyla more kindly, but he can't stop Oberoth from cruelly probing their minds through induced hallucinations. Sheppard, Weir and McKay have only encountered one other enemy that probes minds in this way: the Replicators, lethal machines who plagued SG-1 for years. The team guesses that they're now in the hands of similar beings.
Oberoth soon gives orders for a spectacular maneuver: the entire center of the city blasts off, revealing itself to be a massive spacecraft powered by an Ancient star drive. Niam tells the amazed human captives that they're now flying to Atlantis. The mechanical Asurans, Niam explains, were designed by the Ancients of Atlantis as weapons against the Wraith. The Ancients programmed the humanoid machines to be unremittingly aggressive, but, when they proved to be ineffective as weapons, the Ancients attempted to destroy them all.
Only a few nanites survived on Asuras, the site of their creation, but these evolved, re-building Ancient bodies and an Ancient civilization for themselves. Now, having learned through the mind probes that Atlantis still exists, Oberoth is traveling there to destroy the city as revenge for the Ancients' attempt to exterminate his people.
Niam, by contrast, longs to evolve spiritually, following in the philosophical footsteps of the Ancients until he can Ascend as they did. Because he and his people are programmed for aggression, however, his quest for inner peace is impossible - especially because the Asurans can't change the base code of their programming for themselves. But if McKay will reprogram his people, Niam offers to stop Oberoth's attack. Rewriting Asuran code is almost as complicated as rewriting human DNA, and McKay must somehow finish the job before the deadly Asuran ship arrives above Atlantis. If he can't, his home will be vaporized to avenge a 10,000-year-old wrong.