He was born in Jiao prefecture (modern-day Hanoi), Protectorate General to Pacify the South, when Vietnam was part of the Tang dynasty.
[1] The Tang imperial system allowed for some promotion by merit and could even be strikingly trans-ethnic.
At this time, however, Confucianism ideas had very little impact on the indigenous people of North Vietnam.
He then took a trip to Shu, modern-day Sichuan Province, to visit a fellow student.
[3] In the tenth year of Yuanhe (815), I failed the examinations [at Ch’ang-an, the T'ang capital in northern China].