ParentDocumentRetriever improves retrieval by embedding small child chunks for precise matching while returning their larger parent chunks as context. This addresses a common RAG limitation: embeddings may locate only incomplete or overly narrow passages, leaving generated answers without surrounding information. section 3.0 section 3.2
A practical implementation follows this hierarchy:
- Split the source document by structural elements such as paragraphs, sections, or titles before applying size limits. section 3.2
- Create a vector index on child embeddings so queries can match granular content while the associated parent supplies broader context. section 3.2
Einstein’s Patents and Inventions
A PDF is split into titled sections, then oversized sections are divided into 2,000-character parents. Each parent produces 500-character children whose embeddings are stored on Child nodes. PDF, Parent, and Child nodes are connected with HAS_PARENT and HAS_CHILD relationships, and a Neo4j vector index is created on child embeddings. section 3.2

