The Midrash on Proverbs: Translated from the Hebrew with an Introduction and Annotations by Burton L. Visotzky (New Haven and London: Yale University Press, 1992), p. 46, claims that the divine Wisdom mentioned in Proverbs 8:22ff is the Torah which God created before he brought forth anything else:
"R. Nehemiah said: Come and see what a good thing God has created in His world even before He created the universe. What may this be? It is the Torah!."
We also read:
"What [is the scriptural proof for] Torah? The Lord created me at the beginning of his course, As the first of His works of old (Prov 8:22) . . . At first Torah was in heaven, as it is said, I was with Him as a confidant (Prov 8:30). Later on Moses arose and brought it down to earth to give it to humanity, as it is said, Rejoicing in his inhabited world, Finding delight with mankind (Prov 8:31)."
According to this Midrash on Proverbs, the Torah was "created" prior to the cosmos: it was preexistent. Compare Ecclesiasticus 1:1-4.