Skip to main content
Summarize stage showing LLM-powered document summarization
The Summarize stage uses language models to generate summaries from document sets. It can create single summaries from multiple documents, per-document summaries, or answer questions based on the retrieved content.
Stage Category: REDUCE (Aggregates documents)Transformation: N documents → 1 summary document (or N documents with summaries)

When to Use

When NOT to Use

Parameters

Available Models

Set provider and model_name together. If provider is omitted, it is inferred from model_name (defaults to google / gemini-2.5-flash-lite).

Configuration Examples

Grouping

Single Summary (default)

With no group_by, all documents are combined into one summary (N→1):

Per-Group Summaries

Set group_by to a field path to produce one summary per unique group value (N→M). Use {{GROUP_VALUE}} in the prompt to reference the current group:

Output Schema

The summary is written to output_field (default summary). When include_sources is true, source_document_ids is added; when include_metadata is true, document_count and tokens_used are added.

Single Summary (no group_by)

Per-Group (with group_by)

One summary document per unique group value:

Performance

Summarization calls the LLM and incurs API costs. Use rag_prepare if you only need to format content for external LLM calls.

Common Pipeline Patterns

Full RAG Pipeline

Multi-Document Synthesis

Preview Summaries

Comparison: summarize vs rag_prepare

Error Handling