# ParentDocumentRetriever

> **Class** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/retrievers/parent_document_retriever/ParentDocumentRetriever)

Retrieve small chunks then retrieve their parent documents.

When splitting documents for retrieval, there are often conflicting desires:

1. You may want to have small documents, so that their embeddings can most
    accurately reflect their meaning. If too long, then the embeddings can
    lose meaning.
2. You want to have long enough documents that the context of each chunk is
    retained.

The ParentDocumentRetriever strikes that balance by splitting and storing
small chunks of data. During retrieval, it first fetches the small chunks
but then looks up the parent IDs for those chunks and returns those larger
documents.

Note that "parent document" refers to the document that a small chunk
originated from. This can either be the whole raw document OR a larger
chunk.

## Signature

```python
ParentDocumentRetriever()
```

## Extends

- `MultiVectorRetriever`

## Properties

- `child_splitter`
- `parent_splitter`
- `child_metadata_fields`

## Methods

- [`add_documents()`](https://reference.langchain.com/python/langchain-classic/retrievers/parent_document_retriever/ParentDocumentRetriever/add_documents)
- [`aadd_documents()`](https://reference.langchain.com/python/langchain-classic/retrievers/parent_document_retriever/ParentDocumentRetriever/aadd_documents)

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/02991cb4cf2063d51a07268edafb05fe53de1826/libs/langchain/langchain_classic/retrievers/parent_document_retriever.py#L11)