What is recursive abstractive processing for tree-organised retrieval (RAPTOR)?
RAPTOR (Recursive Abstractive Processing for Tree-Organised Retrieval) is a RAG method that embeds and clusters document chunks, summarises each cluster with a language model and repeats this on the summaries to build a multi-level tree bottom up, retrieving from any level at query time.
Unlike classic Retrieval-Augmented Generation retrieval, which fetches only short contiguous chunks and struggles with questions spanning a whole document, RAPTOR can retrieve both detailed chunks and high-level summaries. Graph Retrieval-Augmented Generation builds a knowledge graph of entities and relations; RAPTOR groups semantically similar text into a summary tree.
- Topic
- Embeddings, document processing and RAG
- Also known as
- Tree-organised retrieval
- Origin
- 2024
How recursive abstractive processing for tree-organised retrieval (RAPTOR) works
- The document is split into short chunks and each chunk is embedded.
- Embeddings are clustered; chunks in each cluster are summarised into one text by a language model.
- Summaries are embedded, clustered and summarised again, repeating up to the root.
- Queries search nodes at all levels or traverse the tree top down; retrieved nodes join the context.
In more detail
Soft clustering (UMAP and GMM) and multi-branch membership
Unlike hard clustering, RAPTOR uses UMAP dimensionality reduction followed by Gaussian Mixture Models (GMMs) so a single chunk can belong to multiple topic clusters at once. This soft clustering preserves cross-cutting themes, such as a clause mentioning both safety and environmental permits, across multiple branches of the summary tree.
Collapsed tree versus tree traversal querying
At query time, RAPTOR supports two modes: tree traversal (starting from the root and descending top-k branches) and collapsed tree retrieval (flattening all nodes from every level into a single similarity search up to a token budget). The original paper found that collapsed tree retrieval consistently outperforms step-by-step tree traversal.
Abstractive drift and permission leakage risk
Because every higher tree level is an abstractive summary of lower summaries, subtle factual errors or dropped exceptions can compound towards the root. Furthermore, when an enterprise shares different access rights across departments, summary nodes should not merge restricted documents with public ones before access checks.
Where it stands against long-context models
Since long-context models (128K, 1M+ tokens) can read a single long contract directly, RAPTOR is most valuable when queries span large multi-document collections where full-context prompting is too slow or exceeds GPU memory.
Commonly confused terms
| Term | How it differs |
|---|---|
| GraphRAG | RAPTOR builds a bottom-up multi-level abstractive summary tree using embedding similarity and clustering, whereas GraphRAG extracts an entity-relationship knowledge graph and summarises graph communities. |
| Parent-child chunking | Parent-document (hierarchical) chunking links small child chunks to their fixed enclosing parent section purely by document structure, whereas RAPTOR clusters semantically related chunks from anywhere in the corpus regardless of physical position. |
| Late chunking | RAPTOR compresses chunks with an LLM at indexing time into hierarchical summaries, whereas late chunking uses a long-context embedding model to encode the whole document before pooling token embeddings into chunks without LLM summarisation. |
Why recursive abstractive processing for tree-organised retrieval (RAPTOR) matters for on-premises AI
Many enterprise questions, such as a contract's overall obligations, draw on information spread across a document rather than one chunk. The paper introducing the method reports significant gains over classic retrieval-augmented models on several tasks and, with a strong model, a 20-point absolute accuracy gain over the best result on a long-document question answering benchmark needing multi-step reasoning. The cost is indexing: each level needs language model summaries.
An energy company indexes long technical specifications as a RAPTOR tree; a question on the project's environmental permit obligations retrieves high-level summaries, while one on a specific clause retrieves lower-level chunks.
Common questions
How does RAPTOR differ from classic RAG?
Classic RAG retrieves only short chunks. RAPTOR also retrieves summaries at different levels, answering questions spanning a document.
What does RAPTOR cost?
Indexing generates language model summaries for each cluster and level; the relevant part of the tree has to be rebuilt when documents change.
Related terms
- Retrieval-augmented generation (RAG)
- AI recursive chunking
- Parent document retrieval
- Graph retrieval-augmented generation (GraphRAG)
- AI text summarisation
- AI chunking
Sources
- RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval, 2024
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, 2020
In the glossary: Glossary, R to Z