Bereshit Rabbah 1.1

R. Oshaya began (his midrashic exposition in this way): "Then I was by Him, as an amon; and I was daily all delight" (Prov. 8:30). Amon means tutor; amon means covered; amon means hidden; and some say, amon means great. Amon is a tutor, as you read: "As an omen (= nursing father) carried the sucking child" (Num 11:12). Amon means covered, as in the verse, "Ha'emunim (= those who were covered) in scarlet" (Lam 4:5). Amon means hidden, as in the verse, "And he omen (= concealed) Hadassah" (Est 2:7). Amon means great, as in the verse, "Are you better than No-amon?" (Nah 3:8) -- which is rendered, "Are you better than Alexandria the Great, which is situated among the rivers?"

Another interpretation: Amon is a workman (uman). The Torah (= Wisdom) declares: "I was the working tool of the Holy One, blessed be He." In human practice, when a mortal king builds a palace, he builds it not with his own skill but with the skill of an architect. The architect moreover does not build it out of his head, but employs plans and diagrams to know how to arrange the chambers and the doors. Thus God consulted the Torah and created the world, while the Torah declares: "In/by/with the Beginning (be-Reshit) God created" (Gen 1:1). "Beginning" (reshit) here refers to the Torah, as in the verse, "The Lord made me as the Beginning (reshit) of His way" (Prov. 8:22).

Bereshit Rabbah 1.4

"In the beginning God created..." (Gen 1:1)

Six things preceded the creation of the world. Among them are some that were created and others whose creation was merely contemplated.

The Torah and the Throne of Glory were created. The Torah, for it is written: "The Lord made me as the beginning of His way, prior to His works of old" (Prov 8:22). The Throne of Glory, as it is written: "Your throne is established of old" and so on (Ps 93:2).

The creation of the Patriarchs was contemplated, for it is written, "I saw your fathers as the first-ripe in the fig-tree at her first season" (Hos 9:10). Israel was contemplated, as it is written, "Remember your congregation, which you obtained aforetime" (Ps 74:2).

The Temple was contemplated, for it is written, "Your throne of glory, on high from the beginning, the place of our sanctuary" (Jer 17:12). The name of Messiah was contemplated, for it is written, "His name existed before the sun" (Ps. 72:17).

R. Ahaba b. R. Ze'ira said: "Repentance, too, as it is written: "Before the mountains were brought forth" and so on (Ps 90:2), and from that very moment, "You turned humankind to contrition, and said: 'Repent, children of men'" (Ps 90:3).

I still do not know which was first, whether the Torah preceded the Throne of Glory or the Throne of Glory preceded the Torah. R. Abba b. Kahana said: "The Torah preceded the Throne of Glory, for it says, 'The Lord made me as the beginning of His way, prior to His works of old' (Prov 8:22), which means prior to that of which it is written 'Your throne is established of old' (Ps 93:2)."