Skip to main content
The Raptor RAG node builds a hierarchical tree of documents by organizing them into multiple levels through clustering and automatic summarization. Lower levels contain the original document chunks, while upper levels contain summaries that capture main themes. During search, the node navigates through the tree combining detailed information and general context for more comprehensive answers. Raptor RAG node overview

Overview

Raptor RAG (Recursive Abstractive Processing for Tree-Organized Retrieval) creates a multi-level representation of your documents:
  1. Level 0 (Leaves) — Original document chunks with full detail
  2. Higher Levels — Progressively summarized clusters of related content
  3. Tree Navigation — Searches traverse from summaries down to specific details
This hierarchical approach provides:
  • Better context — Summaries capture themes that individual chunks might miss
  • Multi-granularity retrieval — Combines high-level understanding with specific details
  • Improved coherence — Related information is grouped together through clustering

When to Use Raptor RAG

Choose Raptor RAG when:
  • Documents cover multiple related topics that benefit from summarization
  • Questions require both high-level understanding and specific details
  • You need to understand relationships between document sections
  • Document collections are large and benefit from hierarchical organization
Consider alternatives when:
  • Documents are simple and don’t need hierarchical summarization
  • You need faster processing (Raptor RAG requires more computation)
  • Questions only need specific facts without broader context

Configuration Options

Double-click the Raptor RAG node to open settings: Raptor RAG settings

Top K

Number of results to return per query (1-100).
ValueUse Case
3-5Focused answers with key information
6-10Balanced coverage for most questions
10+Comprehensive retrieval for complex topics

Max Level

Maximum depth of the hierarchical tree (1-10).
ValueDescription
2-3Shallow tree, faster processing, less summarization
4-5Balanced depth for most document collections
6+Deep tree for large collections with many sub-topics
Higher max levels require more processing time as the system must cluster and summarize at each level.

Add Metadata

When enabled, includes document metadata (file name, page number, etc.) in the chunk content. This helps the LLM understand the source context when generating responses.

Add Page Annotation

Includes page-level annotations in chunk content. Only works with documents parsed using the Graphor method.

Add Document Annotation

Includes document-level annotations in chunk content. Only works with documents parsed using the Graphor method.
Enable annotations when your documents were parsed with the Graphor method to leverage rich structural information in retrieval.

How Raptor RAG Works

Tree Building Phase

  1. Chunking — Documents are split into chunks (Level 0)
  2. Embedding — Each chunk is converted to a vector
  3. Clustering — Similar chunks are grouped together
  4. Summarization — Each cluster is summarized by an LLM
  5. Repeat — Summaries become the next level, process repeats up to Max Level

Retrieval Phase

  1. Query — User question is embedded
  2. Top-down Search — Starts at the highest level (summaries)
  3. Tree Traversal — Follows relevant branches down to leaf chunks
  4. Result Combination — Combines information from all relevant levels

Pipeline Connections

Input Nodes

Source NodePurpose
DatasetProvides documents for tree building
QuestionSingle query for testing
TestsetMultiple queries for evaluation

Output Nodes

Target NodePurpose
RerankingLLM-based reordering of results
LLMGenerate natural language responses
AnalysisEvaluate retrieval quality
ResponseOutput results directly

Pipeline Examples

Basic Raptor RAG Pipeline

Dataset → Raptor RAG → LLM → Response

           Question
Best for: Multi-topic documents requiring hierarchical understanding.

Raptor RAG with Reranking

Dataset → Raptor RAG → Reranking → LLM → Response

           Testset
Best for: Maximum precision with LLM-based result reordering.

Evaluation Pipeline

NodeConnection
Dataset→ Raptor RAG
Testset→ Raptor RAG
Raptor RAG→ Analysis
Best for: Measuring retrieval quality with ground-truth answers.

Viewing Results

After running the pipeline (click Update Results):
  1. Go to the Results tab
  2. View retrieved documents organized by question
  3. Each result shows:
    • Content — Combined text from multiple tree levels
    • Score — Relevance score
    • Level information — Which tree levels contributed to the result

Understanding Multi-Level Results

Results from Raptor RAG combine information from different tree levels:
  • High-level summaries provide thematic context
  • Leaf-level chunks provide specific details
  • Combined text is formatted to show which level each part came from

Comparison with Other RAG Nodes

FeatureRaptor RAGSmart RAGGraph RAGAgentic RAG
Hierarchical structure✅ Tree levels❌ Flat✅ Knowledge graph❌ Flat
Automatic summarization✅ Per cluster❌ No❌ No❌ No
Processing timeSlowerFastSlowerFast
Best forMulti-topic docsGeneral useEntity relationshipsAdaptive queries
ConfigurationTop K, Max LevelTop K, annotationsTop K, annotationsNone

Best Practices

Document Preparation

  1. Use quality parsing — Better parsing leads to better chunking and summarization
  2. Consider document size — Very large documents may benefit from higher Max Level
  3. Related content — Raptor RAG works best when documents have related sub-topics

Configuration Tips

  1. Start with defaults — Max Level 3, Top K 5 works for most cases
  2. Increase Max Level for larger document collections
  3. Enable annotations if documents were parsed with Graphor method
  4. Test with representative questions to validate tree structure

Performance Optimization

  1. Reduce Max Level if processing is too slow
  2. Limit dataset size during initial testing
  3. Use Testset for systematic evaluation before deployment

Troubleshooting

If Raptor RAG returns no results:
  • Verify a Question or Testset node is connected
  • Check that Dataset contains processed documents
  • Ensure documents have status “Processed”
  • Wait for tree building to complete (may take longer than other RAG types)
Tree building requires clustering and LLM summarization at each level:
  • Reduce Max Level for faster processing
  • Reduce number of documents in Dataset
  • Consider Smart RAG for faster alternatives
  • Processing time scales with document volume and Max Level
If summaries don’t capture document themes well:
  • Check that documents are properly parsed
  • Verify document content is coherent and well-structured
  • Consider using documents with clearer topic organization
If the tree has fewer levels than Max Level:
  • This is normal when document volume is small
  • Clustering stops when clusters become too small
  • Add more documents or reduce Max Level expectation
If page/document annotations don’t appear:
  • Verify documents were parsed with Graphor method
  • Enable the corresponding checkbox in settings
  • Reprocess documents with Graphor if needed

Next Steps