This is from Howard Schwartz's "Tree of Souls: the mythology of Judaism".
196. THE COUNCIL OF SOULS
The souls of the righteous existed long before the creation of the world.
God consulted these souls in creating the universe, as it is said, They dwelt there in the king’s service (I Chron. 4:23). God called upon the souls of the righteous, who sat on the council with the Supreme King of Kings, to come together. He then took counsel with them before He brought the world into being, saying, “Let us make man” (Gen. 1:26). So too did they help Him with His work. Some assisted in planting and some helped create the borders of the sea, as it is said, Who set the sand as a boundary to the sea (Jer. 5:22). Nor does God make any important decision without consulting the Council of Souls. So too did God take counsel with the souls of the righteous. He asked them if they were willing to be created. And that is how the souls of the righteous, including the souls of Abraham and the other patriarchs, came into being.
While there are traditions that God took council with the angels or a divine partner such as Adam in creating the world, here the phrase, “Let us make man” from Genesis 1:26 is said to refer to a Council of Souls (nefashot shel Tzaddikim), with whom God consulted before creating the world. These souls of the righteous are said to have existed before the creation of the world. In fact, it is not specified that they were created by God at all, but only called together by God before He created the universe.
Further, they not only give their consent for the creation of the world, but they participate in it, assisting God in planting and creating the boundaries of the sea. Rabbi Levi Yitzhak of Berditchev interprets God’s consulting with the souls of the righteous to mean that He asked them if they were willing to be created.
Evidence of a divine council can be found in several biblical passages, such as Psalms 82:1, which states that God stands in the divine assembly; among the divine beings He pronounces judgment. Here the term for the divine assembly is “adat el.” In Canaanite Myth and Hebrew Epic, Frank Moore Cross describes this council as the Israelite counterpart of the Council of El found in Canaanite mythology, referring to El, the primary Canaanite god. It would thus seem that this obscure Jewish tradition is directly drawn from the Canaanite. Psalm 82 adds a strange twist to this myth: God appears to condemn the gods of the Council of Gods to death: “I had taken you for divine beings, sons of the Most High, all of you; but you shall die as men do, fall like any prince” (Ps. 82:6). This might be interpreted to mean that monotheism declares the death of polytheism.
Jeremiah 23:18 also describes a divine council: But he who has stood in the council of
Yahweh, and seen, and heard His word—He who has listened to His word must obey. Another reference to the divine council is found in 1 Kings 22:19-22, where God addresses the host of heaven, asking who will entice Ahab, and a certain spirit came forward and stood before the Lord and said, “I will entice him.” Other passages suggesting the existence of heavenly beings with whom God discusses His decisions include Isaiah 6 and Job 1-2.
Usually the term, “the souls of the righteous,” refers to the souls of the pious who have died, and whose souls have ascended to Paradise. By pre-existing, these souls become identified as primordial gods, such as are found in other Near Eastern mythologies. By calling them together as a council, God implicitly recognizes their power. It must be assumed that the council of souls gave its approval for the creation of the universe, since God proceeded with it after that. Another possible explanation would be to identify “the souls of the righteous” in this midrash with the angels. In other sources, God is said to have consulted with the angels before creating man, and there are traditions and countertraditions of the notion that the angels somehow participated in the creation of the world itself. See “Creation by Angels,” p. 116. However, it would be highly unusual to refer to the angels as “the souls of the righteous,” although Philo does refer to angels as “unbodied souls.” A prooftext for the existence of such a council of souls or angels can be found in Daniel 4:14: The matter is by decree of the watchers, and the sentence by the word of the holy ones. Both of these terms, the “watchers” and the “holy ones,” suggest some kind of supernatural figures from the heavenly realm, whether angels, souls, or additional divinities. The Council of Souls may also be identified with the heavenly court, and identified as the Watchers. See “The Heavenly Court,” p. 208, and “The Watchers,” p. 457. There are parallel myths about God consulting the angels, rather than souls, in the creation of Adam. The text of Genesis 1:26 states that God said: “Let us make man in our image, after our likeness.” But in the Pseudo-Yonathan Targum on Genesis 1:26, this is changed to read: “And God said to the angels who minister before him, who were created on the second day of Creation. `Let us make man in our image, after our likeness.’” See “Creation By Angels,” p. 116. In Genesis Rabbah 8:9 the question of how many deities created the world is directly broached: “How many deities created the world? You and I must inquire of the first day, as it is said, For ask now of the first days (Deut. 4:32).” The rabbis subsequently debate whether the first sentence of Genesis describes creation by one God or by many, since Elohim is plural. Read this way, the first line of Genesis reads: “In the beginning Gods created the heaven and the earth.” That such a debate can take place at all is remarkable, considering the centrality of monotheism. But it is also a tribute to the open-ended willingness of the rabbis to explore even apparently heretical interpretations of the Torah. The existence of this discussion and the fact that it was recorded in a primary text such as Genesis Rabbah, indicates that the “heretical” had some advocates among the rabbis. Perhaps it harks back to a residual pagan myth, a Canaanite myth about a council of gods. Such divine councils rule in Mesopotamian, Babylonian, and Canaanite mythology. In the Babylonian epic Enuma Elish, Marduk is made head of the divine council by defeating Tiamat, the personification of the sea. It is likely that the existence of such a council in Jewish tradition is a remnant of such an ancient myth. Ugaritic texts describe the abode of El, the primary Canaanite god, and his council on the mountain of El, where the gods are seated at a table. El’s abode is said to be in the north. This setting and location is echoed in Isaiah 14:13: “I will sit in the mount of assembly, on the summit of Zaphon.” (Zaphon is Hebrew for “north.”) God’s perplexing use of the first person plural in verses such as Let us make man in our image (Gen. 1:26), Behold the man has become like one of us (Gen. 3:22), and Let us, then, go down and confound their speech there (Gen. 11:7) can be explained as addressing the divine council. This same usage is found in the Ugaritic texts. Most midrashic texts interpret “Let us” as God addressing the angels.
Genesis Rabbah 8: 7; Maggid Devarav le-Ya’akov 1; No’am Elimelekh, Bo 36b.
"Canaanite Myth and Hebrew Epic" by Frank Moore Cross, pp. 36-43, 186-190.
“The Council of Yahweh in Second Isaiah” by Frank Moore Cross.
“The Council of Yahweh” by H. Wheeler Robinson.
“God and the Gods in Assembly” by Matitiahu Tsevat.
"Assembly of the Gods: The Divine Council in Canaanite and Early Hebrew Literature" by E. Theodore Mullen.