Wisdom literature is a genre of literature common in the ancient Near East. It consists of statements by sages and the wise that offer teachings about divinity and virtue. Although this genre uses techniques of traditional oral storytelling, it was disseminated in written form.
The literary genre of mirrors for princes, which has a long history in Islamic and Western Renaissance literature, is a secular cognate of wisdom literature. In classical antiquity, the didactic poetry of Hesiod, particularly his Works and Days, was regarded as a source of knowledge similar to the wisdom literature of Egypt, Babylonia and Israel. Pre-Islamic poetry is replete with many poems of wisdom, including the poetry of Zuhayr bin Abī Sūlmā (520–609).
Wisdom literature from Sumeria and Babylonia are among the most ancient in the world, with the Sumerian documents dating back to the third millennium BC and the Babylonian dating to the second millennium BC. Many of the extant texts uncovered at Nippur are as ancient as the 18th-century BC. Most of these texts are wisdom in the form of dialogues or hymns, such as the Hymn to Enlil, the All-Beneficent from ancient Sumer.
Proverbs were particularly popular among the Sumerians, with many fables and anecdotes therein, such as the Debate Between Winter and Summer, which Assyriologist Samuel Noah Kramer has noted as paralleling the story of Cain and Abel in the Book of Genesis (Genesis 4:1–16) and the form of disputation is similar to that between Job and his friends in the Book of Job (written c. 6th-century BC).
My lord, I have reflected within my reins, [...] in [my] heart. I do not know what sin I have committed. Have I [eaten] a very evil forbidden fruit? Does brother look down on brother? — Dialogue between a Man and His God, c. 19th–16th centuries BC
Several other ancient Mesopotamian texts parallel the Book of Job, including the Sumerian Man and his God (remade by the Old Babylonians into Dialogue between a Man and His God, c. 19th–16th centuries BC) and the Akkadian text, The Poem of the Righteous Sufferer; the latter text concerns a man who has been faithful his whole life and yet suffers unjustly until he is ultimately delivered from his afflictions. The ancient poem known as the Babylonian Theodicy from 17th to 10th centuries BC also features a dialogue between a sufferer and his friend on the unrighteousness of the world.
The 5th-century BC Aramaic story Words of Ahikar is full of sayings and proverbs, many similar to local Babylonian and Persian aphorisms as well as passages similar to parts of the Book of Proverbs and others to the deuterocanonical Wisdom of Sirach.
Main article: Ancient Egyptian philosophy
In ancient Egyptian literature, wisdom literature belonged to the sebayt ("teaching") genre which flourished during the Middle Kingdom of Egypt and became canonical during the New Kingdom. Notable works of this genre include the Instructions of Kagemni, The Maxims of Ptahhotep, the Instructions of Amenemhat, the Loyalist Teaching, and the Corpus Hermeticum. Hymns such as A Prayer to Re-Har-akhti (c. 1230 BC) feature the confession of sins and appeal for mercy:
Do not punish me for my numerous sins, [for] I am one who knows not his own self, I am a man without sense. I spend the day following after my [own] mouth, like a cow after grass.
Much of the surviving wisdom literature of ancient Egypt was concerned with the afterlife. Some of these take the form of dialogues, such as The Debate Between a Man and his Soul from 20th-18th centuries BC, which features a man from the Middle Kingdom lamenting about life as he speaks with his ba. Other texts display a variety of views concerning life after death, including the rationalist skeptical The Immortality of Writers and the Harper's Songs, the latter of which oscillates between hopeful confidence and reasonable doubt.
Further information: Hermetica
The Corpus Hermeticum is a piece of Egyptian-Greek wisdom literature in the form of a dialogue between Hermes Trismegistus and a disciple. The majority of the text date to the 1st-4th century AD, though the original materials the texts may be older; recent scholarship confirms that the syncretic nature of Hermeticism arose during the times of Roman Egypt, but the contents of the tradition parallel the older wisdom literature of Ancient Egypt, suggesting origins during the Pharaonic Age. The Hermetic texts of the Egyptians mostly dealt with summoning spirits, animating statues, Babylonian astrology, and the then-new practice of alchemy; additional mystical subjects include divine oneness, purification of the soul, and rebirth through the enlightenment of the mind.
The wisdom literature of Egyptian Hermeticism ended up as part of Islamic tradition, with his writings considered by the Abbasids as sacred inheritance from the Prophets and Hermes himself as the ancestor of the Prophet Muhammad. In the version of the Hermetic texts kept by the Ikhwan al-Safa, Hermes Trismegistus is identified as the ancient prophet Idris; according to their tradition, Idris traveled from Egypt into heaven and Eden, bringing the Black Stone back to earth when he landed in India. The star-worshipping sect of the Sabaeans also believed their doctrine descended from Hermes Trismegistus.
Main article: Poetic Books
Further information: Chokhmah
The most famous examples of wisdom literature are found in the Bible. Wisdom[a] is a central topic in the Sapiential Books [b], i.e., Proverbs, Psalms, Job, Song of Songs, Ecclesiastes, Book of Wisdom, Wisdom of Sirach, and to some extent Baruch. Not all the Psalms are usually regarded as belonging to the Wisdom tradition. Others such as Epistle of Aristeas, Pseudo-Phocylides and 4 Maccabees are also considered sapiential.
The later Sayings of the Fathers, or Pirkei Avot in the Talmud follows in the tradition of wisdom literature, focusing more on Torah study as a means for achieving a reward, rather than studying wisdom for its own sake. 
Further information: Mirrors for princes
Scholars generally locate the theoretical Hermetica, 100 to 300 CE; most would put C.H. I toward the beginning of that time. [...] [I]t should be noted that Jean-Pierre Mahe accepts a second-century limit only for the individual texts as they stand, pointing out that the materials on which they are based may come from the first century CE or even earlier. [...] To find theoretical Hermetic writings in Egypt, in Coptic [...] was a stunning challenge to the older view, whose major champion was Father Festugiere, that the Hermetica could be entirely understood in a post-Platonic Greek context.
Lutherans and Anglicans used it only for ethical / devotional matters but did not consider it authoritative in matters of faith.