TLDR Imamat History: Syria
Imam Muhammad ibn Ismail
With the Shia community fractured and the Abbasid Empire bearing down, Muhammad ibn Ismail went into hiding. There's no consensus on where he went, reports range from the Farghana Valley to Rayy to Samia (which was named after him). He moved the his head of operations from Medina to Salamiyah, Syria which allowed him to spread the Ismaili Mission with the support of various Dais, including Abdullah bin Maymun alQaddah. The Dais were sometimes instructed to adopt the Imam's name as they traveled, in order to protect his identity and location. Because of the message they spread, the Dais were highly respected and treated very well in the villages they visited, often given gifts and homes. Many gifts and lots of money were sent back to Muhammad ibn Ismail, and these funds were used to support the spread of the Mission. Eventually, Muhammad ibn Ismail retired in Nishapur with his family, where he died.
Imam Wafi Ahmed
Wafi Ahmed was born in Nishapur, but he moved back to Salamiyah to be at the center of the Ismaili Mission. However, prosecution from the Abbasids made Wafi Ahmed's presence in Syria unsafe and he adopted a nomadic life, similar to that of his father, travelling to Daylam and Ahvaz in Iran, then Samarra in Iraq. When he traveled, he was accompanied by thirty-two Dais who handled his Mission logistics. Abdullah, the son of Maymun alQaddah, became Wafi Ahmed's (and later, Taqi Muhammad's) decoy, often assuming the Imam's identity in order to protect the real Imam from harm. Eventually, Wafi Ahmed returned to Salamiyah, where he passed away.
Imam Taqi Muhammad
Taqi Muhammad continued his father's work in Salamiyah, overseeing the spread of the Ismaili Mission across the Abbasid Empire. He also supervised the compilation of the Brotherhood of Purity's Encyclopedia, which reconciled Ismaili doctrines with Greek philosophies and formed the basis for medieval Ismaili thought. The Brotherhood was spread across multiple countries, and when their Encyclopedia was finished, Taqi Muhammad secretly distributed copies in mosques across the Abbasid empire. This gained the attention of Caliph Mamun, who began organizing public philosophical discussions in order to root out those who had participated in the Encyclopedia's creation. Dai Tirmidhi attended one of these discussions and he was so articulate that the Caliph pretended to convert to Ismailism and asked for the identity of the Imam. As a precaution, Tirmidhi claimed himself as the Imam and was promptly beheaded by Mamun's men, thus publicly exposing Caliph Mamun's true intentions. Taqi Muhammad eventually died in Salamiyah.
Imam Razi adDin Abdullah
Razi adDin Abdullah continued the Ismaili Mission, adding a summary to the Brotherhood of Purity's Encyclopedia. He hid in plain sight in Salamiyah, posing as a merchant. His disguise allowed him to influence local government and travel across the land without becoming suspicious, even when the Abbasids, alarmed at the spread of Ismailism beyond their own reach, began searching for him. His brother, Muhammad Said alKhayr acted as a decoy after Abdullah bin Maymun died of old age. Under Razi adDin Abdullah, the secret Ismaili movement gained even more power and followers. In Kufa, Razi adDin Abdullah was introduced to Mansur alYemen, who wanted to establish an Ismaili State in Yemen. While Razi adDin Abdullah was travelling, his brother in Salamiyah planned to usurp the Imamat, however, his sons died before he could appoint them. Razi adDin Abdullah died in Ashkar Mukram in Persia before alYemen could establish the Ismaili State.