Traditional Chinese medicine (TCM) medical records contain valuable medical information, and are important resources for personalized knowledge analysis, auxiliary diagnosis and treatment, clinical decision support, and drug to use pattern mining of famous TCM doctors. As an effective and novel knowledge management technology, knowledge graph can provide a new way for the inheritance and development of TCM. Constructing medical knowledge graph can potentially help to discover knowledge from clinical data, assist clinical decision-making and personalized treatment recommendation. However, the construction of TCM knowledge graph is still mainly based on structured data, and unstructured texts such as medical records, literature and electronic medical records urgently need to be extracted for mining and analysis. Aiming at the difficulties of word segmentation, entity variety and ambiguity in TCM medical records, this paper proposes a named entity recognition method of deep learning hybrid model based on two-way long-term memory (BILSTM) network and conditional random field (CRF); then by analyzing the process of TCM diagnosis and treatment, the core concepts of TCM are extracted and the ontology layer is constructed; finally, the knowledge graph is constructed by Neo4j, which can provide retrieval, visualization and other functions to help the learning and sharing of TCM knowledge.