Yelü Yan, a modern history graduate student and descendant of the Khitans, and Murong Yan, a mechanical engineering prodigy and descendant of the Xianbei, unexpectedly transmigrate together to Bianjing during the Jingyou era of the Northern Song. She becomes the fiery madam of the Drunken Spring Pavilion brothel and is bound to the Glamour System. She must run a pleasure house and build connections to raise her Glamour points. He ends up a down-and-out scholar living in a ruined temple, where he activates the Principles System and survives by analyzing the structure of all things and improving ancient crafts.
One schemes and maneuvers amid the brothel's finery, turning it into an intelligence hub. The other tinkers away in the bustling streets, using his mechanical knowledge to set the wheels of the age in motion. When a Khitan brothel madam meets a Xianbei scholar, the two, aided by their Systems, go from testing one another to joining forces to break through every impasse. They must contend with rival businesses and political intrigue while surviving between the cracks amid the threat of Western Xia incursions and undercurrents of reform. Armed with modern knowledge, they write a legend that transcends ethnic boundaries and shakes the world in Bianjing, a city ablaze with splendor.