I am writing a fantasy story in a medieval-like time. There is a lot of information I want to share with my readers, but I feel if I incorporate it all in the main story it will make it to long and tedious to read. So the idea I'm having now is to start each chapter with a few lines to explain things and this will be in the form of pieces of a fictional book that exists in that world. Is this a good thing to do, or will readers get irritated by the snippets? I will make them relevant to the chapters they are in.
This is something that has been done successfully in the past by authors like Douglas Adams and Frank Herbert, but it has to be done just right or you'll run the risk of annoying readers, like you said.
If you end a chapter in a cliffhanger, and then begin the next chapter with a five paragraph essay on the boll weevil and its habitat, you'll probably find that people will skip it.
You should go ahead and write out the rough draft the way you want it, and then send it through your beta readers and see what their reaction is. If they universally hate it, then you'll have your answer.
Readers are unlikely to get irritated. This is a fairly well-known practice, and if you keep it short, so the intro doesn't detract from the actual story, it works quite well.
There are several variations you can use on this theme, in fact. For example, Orson Scott Card's classic Ender's Game was written in a third-person limited viewpoint following Ender around, but each chapter began with a conversation between third parties talking about Ender and the situation he was in, giving the reader some context. Decades later, when Card wrote Pathfinder, which is thematically similar in many ways to Ender's Game, he took the basic idea and changed it around quite a bit: The intro to each chapter is a small snippet of a secondary story that's completely separate from the actual main Pathfinder story, and not until the end of the book do you realize how they're related.
But I think my favorite use of the "quasi-related intro text" trope has to come from Brandon Sanderson's The Way of Kings. Every chapter has a little intro to it, and different sections of the story have different themes. One is a letter from one mysterious entity to another, talking about differences in opinion between the two of them over big-picture stuff. One consists of research notes by one of the main characters into the workings of magic. But the ones that will really blow your mind are the death quotes.
Several chapters simply begin with a transcript of the last words of various people, quoted with formal, dry annotations. (Stuff like "Recorded 37 seconds prior to death. Subject was the third daughter of a minor noble house.") They seem mildly interesting, if a bit morbid, and if you've been paying attention you can pick up on a few details based on what various people say, but at the end of the book you find out who's collecting and annotating these last words and why, and it totally changes your perspective on them and then you have to go back over it and read through them all again!
Off the top of my head I can't think of any examples of using this device as a form of direct exposition instead of infodumping all over the reader, but it could almost certainly be done in an interesting and enjoyable manner.
As long as "a few words" is less than 50, sure, go for it. It's additional interstitial information which can be useful to the reader, or can at least add background and flavor.
More than two paragraphs about the Merovingian boll weevil will probably annoy people, so keep it brief. If you need more than that, either make it a prologue or find some way for a cabbagehead character to look up the information.
Opening extracts or poems give a slightly old-fashioned feel to a book, so if that's the goal, it could work. In Dune, the extracts are a constant reminder that this is a story of an epic struggle in future history. However, if the point is to shoehorn in more information, the beginning of a chapter is not the best place to do it. If the information is vital, demonstrate it in the body of the story somehow.
Authors often add lengthy exposition because "the reader needs to know this." But it's surprising how much the reader can infer without being told, and removing such long, dry passages can greatly improve the pace of your novel.