Music is a way to reflect people’s real-life emotions, and listening to music has become an inseparable habit of the daily life. Text-based music information retrieval is still the main way for people to find music, but this method has obvious shortcomings and deficiencies, and it is a relatively cumbersome and inefficient method. In order to solve this problem, this paper proposes a feature extraction LAM algorithm based on the contour of music melody. Melody is the most important extraction feature in content-based music retrieval. Users can hum a song according to their own memory and then extract the rhythm, melody, and other information of the hummed audio information to match and identify the rhythm and melody features of the original song stored in the database. The retrieval method is based on the melody, rhythm, and other musical features of music and involves many issues such as the expression of musical melody, feature extraction of musical melody, user query construction, music melody matching, and music database construction. With the help of the customized query interface, media information can be retrieved. Finally, the experiment proves that the top-ten hit rate of the LAM algorithm after clustering is 91.3%, the top-three hit rate is 78.8%, and the first hit rate is 71.2%. The approximate symbol matching DP algorithm has a top-ten hit rate of 83.6%, a top-three hit rate of 66.4%, and a first hit rate of 63.6%. The method proposed in this paper has a high retrieval hit rate.