In 602 AD, Li was born in Yong (now Fengxiang County, Shaanxi Province). His father is Li Bo. In the Sui Dynasty, he worked as a small official in the county government. He gave up his official position and became a Taoist priest. He is very learned. He named himself Huang Guanzi, annotated Laozi, compiled ten volumes of local chronicles and wrote astronomical images. Therefore, under the influence of his father Li, he was known as a "prodigy" from an early age, especially fond of astronomy, geography, Taoism and the study of Yin and Yang. At the age of 9, he went to Jingyun Temple in Nantuo Mountain, Henan Province to worship Yuan Daochang as a teacher. /kloc-when he was 0/7 years old, he returned to his hometown, was recommended by Li Shimin's good friend Liu Wenjing, became a counselor in Li Shimin, and took part in the uprising against Sui and Xing Tang Dynasties.
In 6 18, Li Yuan proclaimed himself King of Qin, and Li Wei, Minister of Qin, joined the army. In the first year of Tang Zhenguan (627), Li took the assistant minister directly to Taishi Museum. Li is in charge of astronomy, geography, calendar and historical compilation, and he has been playing his best for 40 years.