liveBook · Manning

Collapsed tree

As explained in Retrieval Augmented Generation, The Foundational Ideas

Collapsed Tree is a retrieval approach that performs a single-shot vector search over a flattened tree representation rather than traversing its layers.

Collapsed Tree keeps RAPTOR retrieval as a single vector search while adding summaries and root nodes to the index. It preserves standard RAG’s familiar lookup pattern and avoids the sequential searches required by tree traversal. section 10.5

The hierarchy is flattened into one vector collection containing leaves, intermediate summaries, and root summaries. Embeddings select the retrieval resolution: thematic questions can return summaries, while specific factual questions can return leaves. Structural metadata such as level, leaf status, and child count preserves useful hierarchy for filtering or ranking. section 10.5.1

Use the tradeoffs to decide when the flat index is appropriate:

  • Prefer it for one-search latency, straightforward infrastructure, and compatibility with ordinary vector stores. section 10.5
  • Expect weaker results when embeddings cannot distinguish a request for a summary from a request for a leaf. section 10.5
  • Watch for noisier top-k results as the index grows beyond roughly one million nodes. section 10.5
  • Retain the flat node registry during tree construction so indexing can process every node without reconstructing the hierarchy. section 10.4.4

One index, two retrieval resolutions

For “What is the moral arc of the story?”, the index can return a level-1 summary describing the broader narrative. For “What did the fairy godmother turn into a carriage?”, it returns leaf passages naming the pumpkin and related transformation. The query path is identical; only embedding similarity selects the abstraction level. section 10.5.1

Figure 10.5 Indexing and Retrieval Strategies.

Compare collapsed retrieval with tree traversal: one flattened search versus repeated, branch-scoped searches. section 10.5

How Retrieval Augmented Generation, The Foundational Ideas covers it

How deep it goes
Explains flattening, abstraction-level selection, metadata filtering, tradeoffs, and scaling limits, but not embedding internals.
Examples
Demonstrates thematic and factual Cinderella queries returning summaries or leaf passages from one index.
What it assumes
Assumes familiarity with standard RAG, vector stores, similarity search, embeddings, and hierarchical nodes.
What you can do after
Apply it via Chroma by indexing leaves and summaries together with structural metadata.
How it connects
Connects vector search with RAG, embeddings, hierarchical retrieval, summaries, leaves, and tree traversal.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Retrieval Augmented Generation, The Foundational Ideas. The section links point to the parts of the book it draws on.