Modern experimental analysis techniques have the problem of inefficiency in the analysis of traditional Chinese medicine composition. For the construction of a knowledge graph of traditional Chinese medicine ingredients, this paper first proposes a two-way graph convolutional aggregation network model, which is characterized by the node features of the knowledge graph being enhanced by the relationship features in the initial embedding of entities and relationships. The performer model can reduce the computation of the attention score and improve the computational efficiency of the model. Next, the two-way graph convolutional aggregation network model is used to perform the analysis in the TCM-related database. Finally, the results of the analysis are applied to a real case study of traditional Chinese medicine composition analysis. The construction of the knowledge graph for traditional Chinese medicine ingredients resulted in the acquisition of 14 high-frequency keywords. In the results of the compositional analysis of the herbs of C. minor, 13 batches of samples could be clustered into three groups, and 11 common peaks and 4 common components were identified for the 13 batches of samples, which were protocatechuic acid, vanillic acid, caffeic acid, and chrysanthemic acid, respectively. A cumulative variance contribution of 84.853% was obtained after extracting three principal components.