It's set primarily in the Baghdad of the 8th Century, during the time of the Caliph Haroun al-Rashid, and our protagonists are part of the household of Jaffar, son of the Vizier. Jaffar & Haroun are historical figures (as are some of the others), and they are also protagonists in some of the stories in the Arabian Nights. This story is a kind of modern story of that type, with ancient magic & djinn. There's also some of the feel of Sherlock Holmes & Watson to the main two characters.
Everything is told to us by Captain Asim, the man in charge of Jaffar's household guards. He organises a diversion for Jaffar after his pet bird has died - they go out into the market place in disguise, accompanied by the scholar Dabir. While Jaffar enjoys pretending to be a common person they go and have their fortunes told, and shortly afterwards a man being chased through the streets trying to reach Jaffar dies in front of them carrying an elaborate door pull. The two main plot lines of the book are thus launched - Dabir is tasked to find out what is so important about the door pull, and Asim is to guard him particularly when this requires travelling to a far away ruined city. Jaffar is also keen to separate Dabir from his erstwhile pupil, Jaffar's niece Sabirah, out of fear that they have fallen in love - said fear being encouraged by the prophecy of the fortune teller. Sabirah is destined for an arranged marriage with someone politically suitable, and far above the station of a scholar/tutor no matter how learned he is.
One thing I really liked about this book is how rooted in the real world it is - even the bits that are fantastical. There's a tale within the tale about a previous adventure of Jaffar, Asim & Dabir and described as an incidental detail in the ancient ruins they visit is what is what seems quite clearly an ancient Assyrian relief of a king in a chariot. The afterword at the end says that Haroun & Jaffar are real, but I was quite pleased I'd figured that out already & I'd looked them up (and the answer to what Jaffar's prophecy means was mentioned in wikipedia too!). Also helping it to feel real was that the characters don't feel like 21st Century Westerners dumped in an exotic setting.