In 1897 he obtained a degree in Letters from the Universidad Nacional Mayor de San Marcos, with a thesis entitled "El Porvenir de las Razas en el Perú" ("The Future of the Races in Peru") in which he defended the controversial thesis that the Peruvian race had to be improved and that this could be achieved through the introduction of Germans into Peru. He also obtained a doctorate from this university with a thesis on philosophy and art and became a professor at the university subsequently. In 1899 he obtained a bachelor of law degree from the same university. During his university studies, he worked as curator of the National Library of Peru and started his activities as a writer.