Contextual Retrieval
Key point
Contextual Retrieval leverages contextual information to improve RAG retrieval failure rates by up to 67%.
Details
For AI models to work usefully in specific domains, background knowledge is required, and RAG (Retrieval-Augmented Generation) is widely used for this. However, conventional RAG loses context during the chunking and encoding process, resulting in a limitation where it fails to retrieve the information actually needed.
Contextual Retrieval proposes two sub-technologies to solve this problem: Contextual Embeddings and Contextual BM25. Adopting this approach can reduce retrieval failure rates by 49%, and when combined with Reranking technology, the failure rate can be significantly lowered to 67%.
The optimal strategy varies depending on the size of the knowledge base.
- Under 200K tokens: Instead of RAG, the entire knowledge base is directly included in the prompt. Using Claude's Prompt Caching here can reduce costs by up to 90% and increase speed by more than 2x.
- Large-scale knowledge bases: A hybrid approach combining BM25 (exact keyword matching) and Embedding (semantic similarity search) is used.
The hybrid RAG process is as follows.
- Split the knowledge base into small units.
- Generate TF-IDF encoding and semantic embeddings for each chunk.
- Find exact matches with BM25 and semantically similar items with Embedding.
- Combine the two results through Rank Fusion technology and remove duplicates to extract the optimal information.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.