Vector DBs & RAG (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
What is Contextual Compression and Sentence Window Retrieval?
senior LevelData Structures
In Simple Words:
- Contextual Compression: Passes retrieved text through an extractive model that discards sentences irrelevant to the query before stuffing into the LLM context.
- Sentence Window Retrieval: Embeds small atomic units (single sentences) for high vector search precision, but retrieves the sentence plus a window of 3 preceding and 3 succeeding sentences to provide full context to the LLM.