Skip to main content
The SummaryIndex (formerly ListIndex) maintains documents in sequential order without embeddings. It’s ideal for summarization tasks and small document collections.

When to Use SummaryIndex

Use SummaryIndex when:
  • Summarizing documents: Generate summaries by processing all nodes
  • Small datasets: When you have a limited number of documents
  • No embeddings needed: Want to avoid embedding costs
  • Sequential processing: Need to process documents in order
  • Complete context: Want to ensure all documents are considered
Don’t use SummaryIndex when:
  • You have large document collections (use VectorStoreIndex instead)
  • You need semantic similarity search
  • You want selective retrieval based on relevance

Building Summary Indices

From Documents

From Nodes

With Storage Context

Querying Strategies

Default Retriever

The default retriever returns all nodes in the index:

LLM Retriever

Use the LLM to select relevant nodes:
How LLM Mode Works:
  1. Sends batches of nodes to the LLM
  2. LLM evaluates relevance to the query
  3. Returns only the selected nodes with relevance scores

Query Engine

Basic Query Engine

With Custom Response Synthesizer

Available Response Synthesizers:
  • compact - Concatenate nodes until context limit
  • tree_summarize - Build summary tree recursively
  • simple_summarize - Truncate to fit context
  • refine - Iteratively refine answer with each node

Chat Engine

Default Chat Mode

With LLM Retrieval Mode

Examples

Summarization Example

Shared Storage with VectorStoreIndex

SummaryIndex and VectorStoreIndex can share the same storage context:

Inserting and Deleting Nodes

Custom LLM Retriever Configuration

Complete Working Example

Performance Considerations

Default Mode:
  • ✅ Fast - no LLM calls for retrieval
  • ❌ Sends all nodes to response synthesis (expensive for large datasets)
  • Best for: Small document sets (< 20 nodes)
LLM Mode:
  • ✅ More efficient for large datasets
  • ✅ Better relevance through LLM selection
  • ❌ Additional LLM calls for retrieval
  • Best for: Medium document sets where selective retrieval helps
When to Switch to VectorStoreIndex:
  • Document count > 100
  • Need semantic similarity search
  • Want faster retrieval at scale