Decades in the future near Shanghai, nanotechnologist John Percival Hackworth is commissioned to build a state-of-the-art interactive device — "A Young Lady's Illustrated Primer" — for a duke's granddaughter, and secretly makes an illegal copy for his own daughter. When Hackworth is waylaid on the street, the stolen Primer ends up not with his daughter but with Nell, a young "thete" girl from the poor, tribeless underclass, brought home by her brother Harv. Designed to raise a girl capable of independent thought, the Primer begins teaching Nell through interactive fairy tales that grow more complex as she does, reshaping her upbringing and eventually opening a way out of her circumstances. Meanwhile Hackworth, exposed for his theft, is cast out of neo-Victorian society and pursued by both Protocol Enforcement and criminal factions as he searches for a mysterious figure called the Alchemist. The novel follows Nell's coming-of-age — partly inside the Primer's virtual world, partly amid competing real-world "phyle" subcultures — as the consequences of Hackworth's crime ripple outward.