In Paulo Coelho's The Alchemist, dreams are the things that lead one to find his or her Personal Legend. In Santiago's case, his dreams seem to be calling him to the Pyramids where he will find treasure. However, personal treasure in this story does not refer first and foremost to literal treasure. Santiago finds treasure at the end of the story, but by then it is a secondary reward. He achieves his Personal Legend and falls in love with Fatima. The treasure he discovers when he returns home is an added bonus.
The recurring dream that Santiago has drives him toward the places where he will meet those whose actions will move him closer to achieving his Personal Legend. First he sees the Gypsy. When he starts to explain that he does not want his palm read, she already knows:
"You came so that you could learn about your dreams," said the old woman. "And dreams are the language of God."
As the woman speaks of the boy's dreams, she mentions that God speaks to one through dreams. Then the boy tells of his dream. (If what she says is accurate, then Santiago's recurring dream has been sent by God.)
The child [played] with my sheep for quite a while...And suddenly [he] took me by both hands and transported me to the Egyptian Pyramids...Then, at the Egyptian Pyramids...the child said to me, "If you come here, you will find a treasure."
The woman has little else to tell him. When the boy meets Melchizedek, he soon realizes that the old man is much more than he appears. And he knows about Santiago's dream. He explains that one's Personal Legend is "what you have always wanted to accomplish."
Melchizedek goes on to explain...
Everyone, when they are young, knows what their Personal Legend is...They are not afraid to dream...
The crystal merchant's failure to follow his dream of reaching Mecca remains only a dream; it does little else than keeping him alive. However, as Santiago continues on his journey, meeting the Englishman (who helps the boy realize what he does not want or believe in), Fatima and eventually the alchemist, his dream remains alive. In not losing sight of his dream (as so many others do, even—as Melchizedek mentioned—when they are standing a breath away from achieving their Personal Legend), Santiago survives in the desert; arriving at the Pyramids, it is one of the robbers who casually discredits his dream that makes Santiago take note:
Two years ago, right here on this spot, I had a recurrent dream too. I dreamed that I should travel to the fields of Spain and look for a ruined church where shepherds and their sheep slept. In my dream there was a sycamore growing out of the ruins of the sacristy, and I was told that if I dug at the roots of the sycamore, I would find hidden treasure. But I'm not so stupid as to cross and entire desert just because of a recurrent dream.
This segment explains the function of dreams. Santiago follows his dream which will lead him to his Personal Legend. He has to go through the entire process and achieve his objective. Had he not met the robbers, he would not know that the other man's dream was also a message to Santiago. For Santiago knows the place in the man's dream: it is his home, where he began his journey. The other man dismisses the dream, dismisses God's voice, and will not find his Personal Legend or his treasure. Santiago listens to his heart and his dreams (God speaking) and finds his treasure.
Dreams—sent by God—lead us to what we most want in the world.