RAG’s Hidden Power-Ups for 2025: Sentence Window Retrieval, Meta-data Filtering and More
- Part 2
Last week, we’ve introduced query enhancement techniques and indexing enhancement techniques to power up your vanilla RAG system. (You can revisit the details below!)
This week, we’ll explore another set of techniques that includes retriever, generator, and general pipeline enhancement.
Why Your AI Might Be Suffering from "Middle Child Syndrome"
Remember yourself (at least for me 😜) as a student in a crowded classroom. We are usually attentive at the beginning of the lesson and perk up again at the end, but everything in the middle? It's a blur to our memory. This phenomenon, known as the "lost in the middle" problem, is a real challenge for Large Language Models (LLMs) - just like for us! As Mehdi explains:
"LLMs usually pay attention to the beginning and end of the context. So they do not pay as much attention to the middle of this context."
This insight is crucial because it highlights a fundamental flaw in how traditional RAG systems process information. But there are ways to mitigate this so that you can ensure your AI catches every important detail, no matter where it's placed.
Sentence Window Retrieval: Giving Your AI Perfect Vision
One of the advanced techniques this week is sentence window retrieval. Think of this as giving your AI a pair of adjustable binoculars. Instead of focusing on a single chunk of text, it can now look at the surrounding context, capturing a more comprehensive view of the information.
This technique allows the system to:
Look at chunks before and after the most relevant one
Adjust the "window size" to include more or less context as needed
Provide a more nuanced understanding of the information
By implementing sentence window retrieval, you're essentially teaching your AI to read between the lines, capturing subtleties that might otherwise be missed.
Curious to learn more?
In the following video, we also covered -
Sentence Window Retrieval
Meta-data Filtering
Compressing the LLM Prompt
Adjust chunks sorting in prompt
Self Reflection
Query Routing
Watch the full episode here! 🤓:
👇
Before we go on…a quick announcement -
🚀 Join Our New YouTube Membership Community!
For many of you following us on YouTube. thank you so much for your support! 🦄
In addition to our regular updates, I’m excited to announce the launch of our membership community! Whether you’re looking to master Retrieval-Augmented Generation (RAG), AI Agents, or dive deep into advanced AI projects and tutorials through AI Unbound, there’s something for everyone passionate about AI.
By joining, you’ll gain exclusive content, stay ahead of the curve, and reduce AI FOMO while building real-world skills. Ready to take your AI journey to the next level?
Let’s build, learn, and innovate together!
🛠️✨ Happy practicing and happy building! 🚀🌟
Thanks for reading our newsletter. You can follow us here: Angelina Linkedin or Twitter and Mehdi Linkedin or Twitter.
Source of image:
SWR: https://milvus.io/docs/v2.5.x/assets/advanced_rag/sentence_window.png
🌈 Our RAG course: https://maven.com/angelina-yang/mastering-rag-systems-a-hands-on-guide-to-production-ready-ai
📚 Also if you'd like to learn more about RAG systems, check out our book on the RAG system: You can download for free on the course site:
https://maven.com/angelina-yang/mastering-rag-systems-a-hands-on-guide-to-production-ready-ai
🦄 Any specific contents you wish to learn from us? Sign up here: https://noteforms.com/forms/twosetai-youtube-content-sqezrz
🧰 Our video editing tool is this one!: https://get.descript.com/nf5cum9nj1m8
📽️ Our RAG videos: https://www.youtube.com/@TwoSetAI
📬 Don't miss out on the latest updates - Subscribe to our newsletter: