From the course: Making Your AI Results More Predictable

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Adding re-rank to RAG systems

Adding re-rank to RAG systems

- [Instructor] If you notice that a RAG system leaves out too much relevant information, you may want to examine something called Re-rank. RAG with Re-rank is similar to traditional RAG, but with an extra step. Once the vector DB retrieves information, you have a dedicated component which assesses what's the most relevant information. Normally we check what's relevant based on semantic similarity using a calculation like cosine similarity. A Re-ranker actually uses a language model's inference to make this assessment, so you can have more results from the vector DB, and the Re-Ranker is usually going to do a better job at determining which results are going to be more appropriate for the prompt. Now, once again, this is an optimization, and you only want to implement it if you notice that things that are relevant are left out and perhaps things that are less relevant are making it into the prompt in your RAG system.

Contents