Background:the secondary metabolite of H. serrata, huperzine A (HupA) can be used in the treatment of Alzheimer’s disease and can improve the cognitive function of patients. The use of in vitro culture and secondary metabolism engineering to obtain secondary metabolites is the most effective method to solve a lack of HupA sources and protect H. serrata as a natural resource. This study was based on the in vitro thallus culture conditions for H. serrate, and different concentrations of alkaloid precursor amino acids (lysine, aspartic acid, and trytophan) were added. We found that addition of different amino acids to thallus cultures had different effects on HupA accumulation. Transcriptome sequencing was carried out on thalli with significant differences in the HupA content due to treatment with different amino acids for differential analysis, and real-time fluorescence quantitative PCR was used for validation to examine the functional genes involved in exogenous amino acid regulation of HupA accumulation in thalli.Results:We found that addition of 1 mmol·L−1 aspartic acid (D) solution promoted HupA accumulation, at a level of 84.05 μg·g−1 dry weight (DW), which was 1.29-fold that of the control (CK: 65.15 μg·g−1 DW). Addition of 4 mmol·L−1 lysine (K) solution significantly inhibited HupA accumulation, at a level of 48.42 μg·g−1 DW, which was 0.75-fold that of the control.Transcriptome sequencing-bioinformatics alignment analysis of the aforementioned materials showed that in GO alignment analysis, functions were annotated for 16,258 unigenes. From the statistical analysis of the DEGs of the three groups, we found that there were 1046, 782, and 1586 DEGs for CK vs D, CK vs K, and D vs K, respectively, with D vs K having the most DEGs. DEGs that were enriched in KEGG metabolic pathways and validated by fluorescence quantitative PCR included PANK1, GDH2, APX, HA1, ND4L, and COX1. Conclusions:The above results showed that HupA content differences in D and K treatments were directly proportional to DEGs. Gene expression differences are the molecular basis that affects HupA accumulation in in vitro thallus cultures. PANK1 and GDH2 encode enzymes that synthesize an alkaloid intermediate.