Yao Ji (姚洎), formally the Marquess of Wuxing (吳興侯), was an official of the Chinese dynasty Tang Dynasty and its successor state Later Liang of the Five Dynasties and Ten Kingdoms period, serving as a chancellor during the reign of Later Liang's last emperor Zhu Zhen.
During Tang Dynasty
Yao Ji's background is not clear, as there was no biography of his in the four relevant official histories — the Old Book of Tang, the New Book of Tang, the History of the Five Dynasties, and the New History of the Five Dynasties. However, it appeared that at some point he served as a staff member to the military governor of Jingnan Circuit (荊南, headquartered in modern Jingzhou, Hubei), as there is an extant poem by the Buddhist monk-poet Guanxiu to Yao congratulating him on being recalled from serving on staff at Jiangling Municipality (江陵), the capital of Jingnan Circuit, back to the capital Chang'an, apparently to serve as a low-level consultant in the imperial government, Shiyi (拾遺), but it is not clear when Guangxiu wrote it.
The first substantially datable historical reference to Yao was in 902, when then-reigning Emperor Zhaozong of Tang had been forcibly taken by powerful eunuchs, led by Han Quanhui and Zhang Yanhong (張彥弘), to Fengxiang Circuit (鳳翔, headquartered in modern Baoji, Shaanxi), then governed by the eunuchs' ally Li Maozhen, the military governor (Jiedushi) of Fengxiang. At that time, both Yao and his friend Han Wo (韓偓) were serving as imperial scholars (翰林學士, Hanlin Xueshi) and had accompanied Emperor Zhaozong to Fengxiang; subsequently, Li Maozhen's rival Zhu Quanzhong the military governor of Xuanwu Circuit (宣武, headquartered in modern Kaifeng, Henan) put Fengxiang Circuit's capital Fengxiang Municipality under siege. When the chancellor Wei Yifan was forced to leave the imperial government for some time because his mother had died, the eunuchs initially recommended that Yao become chancellor to replace Wei. Han Wo recommended that Yao decline the commission:
If you want long-term benefit, it is better not to take that position, although if this is indeed the will of the Emperor, it is fine to do so. You should think about this: the army from Bian Prefecture [(汴州, i.e., Xuanwu's capital)] is about to complete the encirclement, and this lone city cannot stand for long. Our families are all in the east, and how can you not be worried about them?
Yao thus claimed to be ill and declined the commission, and Emperor Zhaozong himself was also not inclined to issue it. Instead, the position went to Su Jian. Later in the year, under the pressure from Li Maozhen and the eunuchs, Emperor Zhaozong was set to recall Wei back to the imperial government to again serve as chancellor, but when the draft edict was assigned to Han Wo to be written, Han refused to draft it — pointing out that having Wei return to the government after such a short mourning period was unseemly, so Emperor Zhaozong delayed the commission for some time. However, he eventually gave in to pressure, and had Yao instead draft it, and Wei was able to return as a chancellor. (Wei died shortly after, however.)
At that time, Emperor Zhaozong was under virtual house arrest. On an occasion late in 902, when the eunuchs guarding him were not around, he had his concubine, the Lady of Zhao, quickly summon Yao and Han Wo to his residence, for a brief meeting. He was, however, only able to hold their hands briefly and weep, before Yao reminded him that they might be discovered, and so they separated quickly.
In 903, Li Maozhen was forced to capitulate, slaughter the eunuchs, and surrender the emperor and the imperial household to Zhu. After that, while it is known that Han Wo was exiled for offending Zhu and Zhu's ally, the chancellor Cui Yin, historical references to Yao disappeared for some time.
During Later Liang
Zhu Quanzhong subsequently usurped the Tang throne, establishing a new Later Liang as its Emperor Taizu. In 913, by which time his son Zhu Zhen was emperor, Yao Ji, who was then serving as the chief imperial censor (御史大夫, Yushi Daifu), was given the chancellor designation Tong Zhongshu Menxia Pingzhangshi (同中書門下平章事), and was also made Zhongshu Shilang (中書侍郎), the deputy head of the legislative bureau of government (中書省, Zhongshu Sheng). He was also referred to at that time as the Marquess of Wuxing, presumably a title that was previously created him by a Later Liang emperor. That was the last historical reference to Yao, and it is not known when he left office or when he died.