With the increasing demand for online online courses, how to accurately recommend courses of interest to users from the massive data on the Internet has become a concern of many course platforms. The author proposes to build a knowledge graph of online courses, store knowledge graphs in graph database Neo4j, and recommend online courses based on knowledge graphs. Compared with the traditional course recommendation algorithm, the course recommendation in this paper can be quickly retrieved according to the relationship between the data, so that the recommended results are more accurate and diverse.