v5
OpenAPI 3.1.02026-08-025631,1012.8 MBExecute Retriever (Auto-Optimized)
Execute a retriever and return matching documents. The pipeline is automatically optimized before execution for best performance.
Automatic Optimization: Your pipeline stages are automatically transformed for optimal performance:
- Filters pushed down to reduce expensive operations
- Redundant stages merged or eliminated
- Grouping operations pushed to database layer (10-100x faster)
- Operations reordered for efficiency
Streaming Support: Set stream=true in the request body to receive real-time stage updates via SSE:
- Response uses text/event-stream content type
- Each stage emits stage_start and stage_complete events
- Final event contains complete results and pagination
- Useful for progress tracking and debugging
Response Includes (when stream=false):
- documents: Final matching documents
- pagination: Pagination metadata
- stage_statistics: Per-stage execution metrics
- budget: Credit/time consumption
- optimization_applied: Whether optimizations were applied
- optimization_summary: Details about transformations (when applied)
Optimization Summary Example:
{
"optimization_applied": true,
"optimization_summary": {
"original_stage_count": 5,
"optimized_stage_count": 3,
"optimization_time_ms": 8.2,
"rules_applied": ["push_down_filters", "group_by_push_down"],
"stage_reduction_pct": 40.0
}
}
Use the /explain endpoint to see the optimized execution plan before running.
Path parameters
Retriever ID or name. Pipeline will be automatically optimized before execution.
Retriever ID or name. Pipeline will be automatically optimized before execution.
Query parameters
Generate presigned URLs for S3-backed blobs and url-shaped fields. Also accepted as a body field — if either source is true, presigning is enabled.
Generate presigned URLs for S3-backed blobs and url-shaped fields. Also accepted as a body field — if either source is true, presigning is enabled.
Include vector embeddings in result documents. Also accepted as a body field — if either source is true, vectors are returned.
Include vector embeddings in result documents. Also accepted as a body field — if either source is true, vectors are returned.
Return the inline explain_plan (per-stage timings + optimization summary) in the response. Also accepted as a body field — if either source is true, the plan is included.
Return the inline explain_plan (per-stage timings + optimization summary) in the response. Also accepted as a body field — if either source is true, the plan is included.
DEPRECATED. Restore the legacy results alias (a byte-for-byte copy of documents). Off by default — results previously duplicated the entire document array in every response (~half the payload). Prefer documents; use this only as a temporary migration shim.
DEPRECATED. Restore the legacy results alias (a byte-for-byte copy of documents). Off by default — results previously duplicated the entire document array in every response (~half the payload). Prefer documents; use this only as a temporary migration shim.
Bypass the execute/stage cache read for this request (a fresh execution; the result is still written to cache). Also accepted as a body field — if either source is true, the cache is skipped.
Bypass the execute/stage cache read for this request (a fresh execution; the result is still written to cache). Also accepted as a body field — if either source is true, the cache is skipped.
Request body
Example request
{
"description": "Simple query",
"inputs": {
"query": "artificial intelligence trends",
"top_k": 25
}
}Response
Execution results with documents, pagination, statistics, and optimization details. When stream=true, returns Server-Sent Events. When stream=false, returns JSON response.