Great wisdom was needed for building the ark, which was to have space for all beings on earth, even the spirits. Only the fishes did not have to be provided for. Noah acquired the necessary wisdom from the book given to Adam by the angel Raziel, in which all celestial and all earthly knowledge is recorded.
While the first human pair were still in Paradise, it once happened that Samael, accompanied by a lad, approached Eve and requested her to keep a watchful eye upon his little son until he should return. Eve gave him the promise. When Adam came back from a walk in Paradise, he found a howling, screaming child with Eve, who, in reply to his question, told him it was Samael's. Adam was annoyed, and his annoyance grew as the boy cried and screamed more and more violently. In his vexation he dealt the little one a blow that killed him. But the corpse did not cease to wail and weep, nor did it cease when Adam cut it up into bits. To rid himself of the plague, Adam cooked the remains, and he and Eve ate them. Scarcely had they finished, when Samael appeared and demanded his son. The two malefactors tried to deny everything; they pretended they had no knowledge of his son. But Samael said to them: "What! You dare tell lies, and God in times to come will give Israel the Torah in which it is said, 'Keep thee far from a false word'?"
While they were speaking thus, suddenly the voice of the slain lad was heard proceeding from the heart of Adam and Eve, and it addressed these words to Samael: "Go hence! I have penetrated to the heart of Adam and the heart of Eve, and never again shall I quit their hearts, nor the hearts of their children, or their children's children, unto the end of all generations."
Samael departed, but Adam was sore grieved, and he put on sackcloth and ashes, and he fasted many, many days, until God appeared unto him, and said: "My son, have no fear of Samael. I will give thee a remedy that will help thee against him, for it was at My instance that he went to thee." Adam asked, "And what is this remedy?" God: "The Torah." Adam: "And where is the Torah?" God then gave him the book of the angel Raziel, which he studied day and night. After some time had passed, the angels visited Adam, and, envious of the wisdom he had drawn from the book, they sought to destroy him cunningly by calling him a god and prostrating themselves before him, in spite of his remonstrance, "Do not prostrate yourselves before me, but magnify the Lord with me, and let us exalt His Name together." However, the envy of the angels was so great that they stole the book God had given Adam from him, and threw it in the sea. Adam searched for it everywhere in vain, and the loss distressed him sorely. Again he fasted many days, until God appeared unto him, and said: "Fear not! I will give the book back to thee," and He called Rahab, the Angel of the Sea, and ordered him to recover the book from the sea and restore it to Adam. And so he did.
Upon the death of Adam, the holy book disappeared, but later the cave in which it was hidden was revealed to Enoch in a dream. It was from this book that Enoch drew his knowledge of nature, of the earth and of the heavens, and he became so wise through it that his wisdom exceeded the wisdom of Adam. Once he had committed it to memory, Enoch hid the book again.
Now, when God resolved upon bringing the flood on the earth, He sent the archangel Raphael to Noah, as the bearer of the following message: "I give thee herewith the holy book, that all the secrets and mysteries written therein may be made manifest unto thee, and that thou mayest know how to fulfil its injunction in holiness, purity, modesty, and humbleness. Thou wilt learn from it how to build an ark of the wood of the gopher tree, wherein thou, and thy sons, and thy wife shall find protection."
Noah took the book, and when he studied it, the holy spirit came upon him, and he knew all things needful for the building of the ark and the gathering together of the animals. The book, which was made of sapphires, he took with him into the ark, having first enclosed it in a golden casket. All the time he spent in the ark it served him as a time-piece, to distinguish night from day. Before his death, he entrusted it to Shem, and he in turn to Abraham. From Abraham it descended through Jacob, Levi, Moses, and Joshua to Solomon, who learnt all his wisdom from it, and his skill in the healing art, and also his mastery over the demons.