The libretto is based on the Biblical story of Joseph found in Genesis chapters 38–45. The libretto is hard to read without background context because the audience of Handel's oratorios was very familiar with the stories of the Hebrew Bible and would have known the whole story of Joseph as part of their cultural knowledge. Taking advantage of this, Miller tells the story in poetical form, leaving out events and background information which give it a fragmentary feel if read straight through. The story begins when Joseph's eleven brothers, jealous that their father Jacob loved Joseph best of all of them, seize him and sell him into slavery, telling their father that he has been eaten by wild beasts. The slave traders took Joseph to Egypt, where he became a servant in the house ofPotiphar, captain of Pharaoh's guard. A good servant, Joseph eventually rose to be the head of the household servants. Potiphar's wife became attracted to Joseph and attempted to seduce him, but he rebuffed her. Because of this, she accused him of making advances on her and he was placed in jail. While in jail, Joseph interpreted the dreams of two of his prison-mates, both servants in Pharaoh's household. One of them Phanor, promised to help free Joseph from prison when he was restored to his position in Pharaoh's household, but forgot and several years pass. Act 1 opens with Joseph lamenting his lot in life, abandoned, in prison. Pharaoh has been troubled by dreams which no one can interpret for him, and Phanor remembers Joseph and fetches him. Joseph comes before Pharaoh and, calling on Jehovah, interprets Pharaoh's dreams: He says that the dreams foretell of 7 years of plenty followed by 7 years of famine and that Pharaoh should store food during the time of plenty for the time of famine. Meanwhile, Asenath, daughter of the high priest Potiphera, falls in love with the young Joseph. Pharaoh rejoices at Joseph's interpretations, makes him his prime minister to oversee the saving of food, names him "Zaphnath", and offers him Asenath's hand in marriage. Now, before act 2 begins, more biblical story needs to be inserted: After Joseph saves wisely during the seven years of plenty, the famine begins. Because Egypt is now well-positioned for food, people from afar come to purchase grain to replace their own failing crops. Among these are Joseph's brothers, who do not recognize him. He accuses them of being spies and orders them to leave one of them, Simeon, here in jail while they go home and return with their youngest brother Benjamin. Act 2 begins a year later, with Simeon still languishing in jail and his fear and guilt over having betrayed Joseph racking his brain. Joseph plays into the dramatic irony and manipulates Simeon to feel guilt for having abandoned Joseph. When his brothers return with Benjamin, they state their case again for the plight of their homeland in Canaan and he sells them grain and sends them on their way. Not mentioned in the libretto, Joseph arranges to have a silver cup of his hidden in Benjamin's things. In act 3, Joseph has the Egyptian guards catch up to and seize the brothers, bring them back, and accuses them of stealing the cup. Playing the guilt and drama to the hilt, he demands to keep Benjamin as a prisoner to test the brothers if they will abandon Benjamin as they did him all those years ago. The brothers plead for their fathers sake—the heartbreak of losing another youngest son would kill him—and Simeon offers himself in Benjamin's stead. Passing Joseph's test, he reveals himself as their long-lost brother. All sing praises to God and the country of Egypt which Joseph has so gloriously managed and Joseph and his brethren settle in this happy land.