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
Setprovider 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 nogroup_by, all documents are combined into one summary (N→1):
Per-Group Summaries
Setgroup_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 tooutput_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
Common Pipeline Patterns
Full RAG Pipeline
Multi-Document Synthesis
Preview Summaries
Comparison: summarize vs rag_prepare
Error Handling
Call summarize from the API
Add the stage to a retriever’sstages array as {"stage_name": "<your label>", "stage_type": "reduce", "config": {"stage_id": "summarize", "parameters": {...}}}. The parameters are the ones on this page.
- Create Retriever (
POST /v1/retrievers) saves a retriever that runs the stage. - Execute Ad-hoc Retriever (
POST /v1/retrievers/execute) runs stages without saving a retriever. - List Available Retriever Stages (
GET /v1/retrievers/stages) returns every stage’s parameter schema.
Related
- RAG Prepare - Format for LLM without calling
- LLM Enrich - Structured extraction
- Rerank - Improve input quality first

