Mandrakes are mentioned once in the bible when Leah trades them to Rachel in exchange for a night with Yaakov.
Rachel, we're led to believe from the context, wanted the flowers because she thought they would help her conceive. This is the view of Rashi (who, in fact, thought the flowers were jasmines, not mandrakes) and Sfrorno. Both men thought the flowers were fertility-charms, similar to garlic, an herb the Sforno additionally notes, "...our Sages suggested be eaten Friday nights by men."
[Off-color aside: How many of you men in the audience think going to bed with a mouthful of garlic is good for conception?]
This discussion of mandrakes introduces a larger issue. It's clear that Rashi and some other Rishonim thought that the flowers had medicinal (or even magical) properties. To be blunt, it's equally clear they were wrong. Mandrakes aren't fertility aids. Was Our Mother Rachel, who eagerly desired the powerless mandrake, from among who the Rambam called"...fools and stupid people [scholim u'chasrei daa't]... the category of [people] who have incomplete mental facilities?"
The same question might be asked of OurFather Yaakov. Later in the sedra he exerts an inordinate amount of effort putting peeled branches into the watering troughs of his sheep. He thinks this will encourage the flock to bear speckled offspring. In the view of Samson Raphael Hirsch, however, Yaakov was wrong:
"What Yaakov attempted with the sticks would have been a fully justified means of self-aid even if it could be considered as a proven expedient which experiments which have been made show hardly to be the case... the result must be considered purely as Divine Intervention."
In other words, Yaakov's dabbled in superstition because he thought it might do some good, but ultimately he was wrong: it was Divine Intervention, and not the sticks, which caused the flocks to produce specked sheep, just as it was Divine Intervention, and not the mandrakes, which caused Rachel to conceive. And it's worth noting that in the next section, when Yaakov explains the source of his wealth to Rachel and Leah, he says nothing about the sticks. Instead, he gives all credit to God. This leades Robert Alter to suggest that the business with the sticks was just a dodge to popular beliefs and even Yaakov doubted their eficacy.
This, however, is not the view of the non-rationalist rishonim, like Rashi. In their mind, magic works, so Rachel (with the mandrakes) and Yakov (with the sticks) made use of it. Unfortunately, the non-rationalist rishonim are, to put it bluntly, wrong: Magic is nonsense. So why are Jacob and Rachel messing around with it? Why do we pray in the merits of people who's knowledge of God was imperfect? Wouldn't we better off praying in the merit of someone like the Rambam, who knew that God alone controls the world and that his sovreignty isn't shared with sticks and flowers?
A possible answer, suggested by Balabusta, is that Yakov and Rivka weren't dabbling in magic but in medicine - flawed medicine, but medicine all the same. Do we destroy the reputation of Yakov and Rachel if we say they made use of the science of their times? Is using flawed medicine a spiritual failing? No. Of course not. But if it isn't a spiritual failing, it is an intellectual failing.
And the implications of this intellectual failing are troubling. We venerate the Sages despite their imperfect science [Moreh Nevuchim (3:14)] because they are our great teachers of Jewish law. But if you follow Rashi, Yackov and Rachel knew less about the world than we did; if you follow Rashi, what's left to venerate? If Jacob and Rachel were, intellectually speaking, ordinary men and women of the Bronze Age, who, as it happens, taught us no Torah, why are they worthy of being remembered at all?
The Ramban, thank god, will have none of Rashi's quack-medicine. He believes "Rachel wanted the duda'im for delight and pleasure, for Rachel was visited with children through prayer, not by medicinal methods." He's also done his homework:"...people say [the mandrake] is an aid to pregnancy... but I have not seen this in any of the medicinal books discussing mandrakes." The Rambam's view, therefore, is that the plants had no power.