Astragalus mongholicus is a traditional Chinese medicine (TCM) with important medicinal value and is widely used worldwide. Heat shock (HSF) transcription factors are among the most important transcription factors in plants and are involved in the transcriptional regulation of various stress responses, including drought, salinity, oxidation, osmotic stress, and high light, thereby regulating growth and developmental processes. However, the HFS gene family has not yet been identified in A. mongholicus, and little is known regarding the role of HSF genes in A. mongholicus. This study is based on whole genome analysis of A. mongholicus, identifying a total of 22 AmHSF genes and analyzing their physicochemical properties. Divided into three subgroups based on phylogenetic and gene structural characteristics, including subgroup A (12), subgroup B (9), and subgroup C (1), they are randomly distributed in 8 out of 9 chromosomes of A. mongholicus. In addition, transcriptome data and quantitative real time polymerase chain reaction (qRT-PCR) analyses revealed that AmHSF was differentially transcribed in different tissues, suggesting that AmHSF gene functions may differ. Red and blue light treatment significantly affected the expression of 20 HSF genes in soilless cultivation of A. mongholicus seedlings. AmHSF3, AmHSF3, AmHSF11, AmHSF12, and AmHSF14 were upregulated after red light and blue light treatment, and these genes all had light-corresponding cis-elements, suggesting that AmHSF genes play an important role in the light response of A. mongholicus. Although the responses of soilless-cultivated A. mongholicus seedlings to red and blue light may not represent the mature stage, our results provide fundamental research for future elucidation of the regulatory mechanisms of HSF in the growth and development of A. mongholicus and its response to different light conditions.