Vector DBs & RAG (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
Scaling RAG to Enterprise Long-Context Documents: Parent-Child Document Retrievers and Hierarchical Summarization Indexes.
senior LevelMost AskedData Structures
In Simple Words: The Small-to-Big Retrieval Dilemma: Small chunks (100 tokens) produce accurate vector similarity matches, but lack surrounding context. Large chunks (2,000 tokens) provide rich context to the LLM, but their embeddings get diluted and yield poor search accuracy.
- Parent-Child Document Retriever:
- Chunk source documents into small child chunks (200 tokens) and link each to a larger parent chunk (1,000 tokens) or the full document.
- Index only the child chunks in the vector database.
- When a child chunk matches the user query, retrieve and inject the parent chunk into the LLM prompt.
- Delivers surgical search precision with complete, un-truncated context for the generative model.