curl --request POST \
--url https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Namespace: <api-key>' \
--data '
{
"description": "Simple query",
"inputs": {
"query": "artificial intelligence trends",
"top_k": 25
}
}
'import requests
url = "https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute"
payload = {
"description": "Simple query",
"inputs": {
"query": "artificial intelligence trends",
"top_k": 25
}
}
headers = {
"Authorization": "Bearer <token>",
"X-Namespace": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Namespace': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: 'Simple query',
inputs: {query: 'artificial intelligence trends', top_k: 25}
})
};
fetch('https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Simple query',
'inputs' => [
'query' => 'artificial intelligence trends',
'top_k' => 25
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Namespace: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute"
payload := strings.NewReader("{\n \"description\": \"Simple query\",\n \"inputs\": {\n \"query\": \"artificial intelligence trends\",\n \"top_k\": 25\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Namespace", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute")
.header("Authorization", "Bearer <token>")
.header("X-Namespace", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Simple query\",\n \"inputs\": {\n \"query\": \"artificial intelligence trends\",\n \"top_k\": 25\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Namespace"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Simple query\",\n \"inputs\": {\n \"query\": \"artificial intelligence trends\",\n \"top_k\": 25\n }\n}"
response = http.request(request)
puts response.read_body{
"execution_id": "exec_abc123def456",
"status": "completed",
"retriever_id": "ret_abc123def456",
"documents": [
{
"document_id": "doc_123",
"payload": {
"metadata": {
"category": "AI"
},
"text": "Sample content"
},
"score": 0.95
},
{
"document_id": "doc_456",
"payload": {
"metadata": {
"category": "ML"
},
"text": "Another document"
},
"score": 0.88
},
{
"document_id": "moment_vid_A_12000",
"moments": [
{
"document_ids": [
"frame_41",
"frame_42",
"frame_43"
],
"duration_ms": 6500,
"end_ms": 18500,
"match_count": 3,
"score": 0.91,
"start_ms": 12000
}
],
"parent_id": "vid_A",
"score": 0.91
}
],
"results": [
{}
],
"pagination": {
"has_next": false,
"limit": 25,
"method": "cursor",
"returned": 25,
"total": 25
},
"stage_statistics": {
"stages": {},
"total_time_ms": 0,
"credits_used": 0,
"server_service_ms": 1
},
"facets": [
{}
],
"budget": {
"credits_remaining": 99.5,
"credits_used": 0.5,
"time_used_ms": 150
},
"cached_at": 123,
"warnings": [
"<string>"
],
"interpretation": {},
"error": "Retriever execution failed: Collection not found",
"optimization_applied": true,
"optimization_summary": {
"optimization_time_ms": 8.2,
"optimized_stage_count": 3,
"original_stage_count": 5,
"rules_applied": [
"push_down_filters",
"group_by_push_down"
],
"stage_reduction_pct": 40
},
"learned_fusion_context": {},
"cache_hit": false,
"enrichment_skipped": false,
"enrichment_skipped_stages": [
"<string>"
],
"enrichment_skip_reason": "<string>",
"diagnostics": {},
"explain_plan": {}
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Execute 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.
curl --request POST \
--url https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Namespace: <api-key>' \
--data '
{
"description": "Simple query",
"inputs": {
"query": "artificial intelligence trends",
"top_k": 25
}
}
'import requests
url = "https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute"
payload = {
"description": "Simple query",
"inputs": {
"query": "artificial intelligence trends",
"top_k": 25
}
}
headers = {
"Authorization": "Bearer <token>",
"X-Namespace": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Namespace': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: 'Simple query',
inputs: {query: 'artificial intelligence trends', top_k: 25}
})
};
fetch('https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Simple query',
'inputs' => [
'query' => 'artificial intelligence trends',
'top_k' => 25
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Namespace: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute"
payload := strings.NewReader("{\n \"description\": \"Simple query\",\n \"inputs\": {\n \"query\": \"artificial intelligence trends\",\n \"top_k\": 25\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Namespace", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute")
.header("Authorization", "Bearer <token>")
.header("X-Namespace", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Simple query\",\n \"inputs\": {\n \"query\": \"artificial intelligence trends\",\n \"top_k\": 25\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/retrievers/{retriever_id}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Namespace"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Simple query\",\n \"inputs\": {\n \"query\": \"artificial intelligence trends\",\n \"top_k\": 25\n }\n}"
response = http.request(request)
puts response.read_body{
"execution_id": "exec_abc123def456",
"status": "completed",
"retriever_id": "ret_abc123def456",
"documents": [
{
"document_id": "doc_123",
"payload": {
"metadata": {
"category": "AI"
},
"text": "Sample content"
},
"score": 0.95
},
{
"document_id": "doc_456",
"payload": {
"metadata": {
"category": "ML"
},
"text": "Another document"
},
"score": 0.88
},
{
"document_id": "moment_vid_A_12000",
"moments": [
{
"document_ids": [
"frame_41",
"frame_42",
"frame_43"
],
"duration_ms": 6500,
"end_ms": 18500,
"match_count": 3,
"score": 0.91,
"start_ms": 12000
}
],
"parent_id": "vid_A",
"score": 0.91
}
],
"results": [
{}
],
"pagination": {
"has_next": false,
"limit": 25,
"method": "cursor",
"returned": 25,
"total": 25
},
"stage_statistics": {
"stages": {},
"total_time_ms": 0,
"credits_used": 0,
"server_service_ms": 1
},
"facets": [
{}
],
"budget": {
"credits_remaining": 99.5,
"credits_used": 0.5,
"time_used_ms": 150
},
"cached_at": 123,
"warnings": [
"<string>"
],
"interpretation": {},
"error": "Retriever execution failed: Collection not found",
"optimization_applied": true,
"optimization_summary": {
"optimization_time_ms": 8.2,
"optimized_stage_count": 3,
"original_stage_count": 5,
"rules_applied": [
"push_down_filters",
"group_by_push_down"
],
"stage_reduction_pct": 40
},
"learned_fusion_context": {},
"cache_hit": false,
"enrichment_skipped": false,
"enrichment_skipped_stages": [
"<string>"
],
"enrichment_skip_reason": "<string>",
"diagnostics": {},
"explain_plan": {}
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Authorizations
Mixpeek API key, sent as Authorization: Bearer mxp_sk_.... Create one in Studio under Settings → API Keys, or with an admin key via POST /v1/organizations/users/{user_email}/api-keys. A missing header returns 403; an invalid or revoked key returns 401.
Namespace id (ns_...), not the namespace name. This scopes the request rather than authenticating it, and it is required on every operation marked x-mixpeek-namespace-scoped.
Path Parameters
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.
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.
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.
Body
Execution request with inputs, filters, pagination, and optional stream parameter. Set stream=true to receive real-time stage updates via Server-Sent Events.
Runtime inputs for the retriever mapped to the input schema. Keys must match the retriever's input_schema field names. Values depend on field types (text, vector, filters, etc.). REQUIRED unless all retriever inputs have defaults.
Common input keys:
- 'query': Text search query
- 'embedding': Pre-computed vector for search
- 'top_k': Number of results to return
- 'min_score': Minimum relevance threshold
- Any custom fields defined in input_schema
Template Syntax (Jinja2):
Namespaces (uppercase or lowercase):
INPUT/input: Query inputs (e.g.,{{INPUT.query}})DOC/doc: Document fields (e.g.,{{DOC.payload.title}})CONTEXT/context: Execution contextSTAGE/stage: Stage configurationSECRET/secret: Vault secrets (e.g.,{{SECRET.api_key}})
Accessing Data:
- Dot notation:
{{DOC.payload.metadata.title}} - Bracket notation:
{{DOC.payload['special-key']}} - Array index:
{{DOC.items[0]}},{{DOC.tags[2]}} - Array first/last:
{{DOC.items | first}},{{DOC.items | last}}
Array Operations:
- Iterate:
{% for item in DOC.tags %}{{item}}{% endfor %} - Extract key:
{{DOC.items | map(attribute='name') | list}} - Join:
{{DOC.tags | join(', ')}} - Length:
{{DOC.items | length}} - Slice:
{{DOC.items[:5]}}
Conditionals:
- If:
{% if DOC.status == 'active' %}...{% endif %} - If-else:
{% if DOC.score > 0.8 %}high{% else %}low{% endif %} - Ternary:
{{'yes' if DOC.enabled else 'no'}}
Built-in Functions: max, min, abs, round, ceil, floor, utc_now, time_ago
Time Functions: {{utc_now()}} returns current UTC as ISO-8601, {{time_ago(minutes=5)}} returns UTC minus duration
Custom Filters: slugify (URL-safe), bool (truthy coercion), tojson (JSON encode)
S3 URLs: Internal S3 URLs (s3://bucket/key) are automatically presigned when accessed via DOC namespace.
{ "query": "artificial intelligence", "top_k": 25 }
{ "min_score": 0.7, "query": "customer feedback", "top_k": 50 }
{ "category": "blog", "embedding": [0.1, 0.2, 0.3], "top_k": 10 }
Optional ad-hoc filters applied at execution time. Merged (AND) with any filters already defined in the retriever's stages. Uses the standard LogicalOperator format: {"AND": [{"field": "brand", "operator": "eq", "value": "Acme"}]}. Supports operators: eq, ne, in, nin, gt, gte, lt, lte, contains, exists, is_null.
{ "AND": [ { "field": "brand", "operator": "eq", "value": "Acme" } ] }
Offset-based pagination using page number sizing.
Best for: Traditional page UIs with page number navigation
How it works:
- Uses page numbers (1, 2, 3...) and page size
- Calculates offset as: (page_number - 1) * page_size
- Simple and familiar for users
- Can jump to any page directly
Tradeoffs:
- Can have "page drift" if data changes between requests
- Example: Items added/deleted causes duplicates or gaps
- Less efficient for large offsets (database must skip N rows)
Use when:
- Building traditional page-numbered UIs
- Users need to jump to specific pages
- Result set is relatively stable
- Working with smaller datasets
Example: Page 1: {"method": "offset", "page_size": 25, "page_number": 1} Page 2: {"method": "offset", "page_size": 25, "page_number": 2}
- OffsetPaginationParams
- CursorPaginationParams
- ScrollPaginationParams
- KeysetPaginationParams
Show child attributes
Show child attributes
DEPRECATED alias for the pagination page size — prefer 'pagination' (e.g. {"method": "cursor", "limit": 100}). Previously accepted-and-IGNORED: results silently capped at the default page size (10) regardless of the value, and out-of-range values didn't even 422 (FRUSTRATIONS 2026-07-23). Now: when 'pagination' is absent, 'limit' is honored as the default cursor pagination's page size; when both are provided and disagree, pagination wins and a top-level response warning names the conflict.
1 <= x <= 100null
Enable streaming execution to receive real-time stage updates via Server-Sent Events (SSE). NOT REQUIRED - defaults to False for standard execution.
When stream=True:
- Response uses text/event-stream content type
- Each stage completion emits a StreamStageEvent
- Events include: stage_start, stage_complete, stage_error, execution_complete
- Clients receive intermediate results and statistics as stages execute
- Useful for progress tracking, debugging, and partial result display
When stream=False (default):
- Response returns after all stages complete
- Returns a single RetrieverExecutionResponse with final results
- Lower overhead for simple queries
Use streaming when:
- You want to show real-time progress to users
- You need to display intermediate results
- Pipeline has many stages or long-running operations
- Debugging or monitoring pipeline performance
Example streaming client (JavaScript):
const eventSource = new EventSource('/v1/retrievers/ret_123/execute?stream=true'); eventSource.onmessage = (event) => { const stageEvent = JSON.parse(event.data); if (stageEvent.event_type === 'stage_complete') { console.log(`Stage ${stageEvent.stage_name} completed`); console.log(`Documents: ${stageEvent.documents.length}`); } };
Example streaming client (Python):
import requests response = requests.post('/v1/retrievers/ret_123/execute', json={'inputs': {...}, 'stream': True}, stream=True) for line in response.iter_lines(): if line.startswith(b'data: '): event = json.loads(line[6:]) print(f"Stage {event['stage_name']}: {event['event_type']}")
false
true
OPTIONAL. List of fields containing document IDs to resolve inline. Referenced documents are fetched and attached under an '_expanded' key in each result document. Supports dot-notation for nested fields (e.g., 'items.product_id'). Max 50 unique references per request. Depth is limited to 1 (no recursive expansion).
["customer_id"]
OPTIONAL. Bypass stage result cache for this execution. When True, all stages execute fresh without cache lookup. Useful after corpus updates, retriever config changes, or engine deploys. Results are still written to cache for future requests.
false
true
Generate presigned URLs for S3-backed blobs and url-shaped fields in result documents. Also accepted as a return_presigned_urls query parameter; if either source is true, presigning is enabled.
false
true
Include vector embeddings in result documents. Also accepted as a return_vectors query parameter; if either source is true, vectors are returned.
false
true
OPTIONAL. Pass the write_token returned by a prior direct upsert (options.write_token=true) to get read-your-writes consistency: the read is routed to the primary shard, where your just-written document is immediately searchable, instead of an eventually-consistent replica that can lag several seconds behind. Omit for normal (eventual) reads.
OPTIONAL. When true, the response includes explain_plan — the query profile for THIS execution: per-stage timings + input/output counts, MVS execution stats, and the optimizer summary (and, once wired, the shard ExecutionTrace: chosen legs, fusion, push-downs, nprobe, served/shadow planner). Analogous to SQL EXPLAIN ANALYZE — the query still runs and returns documents; the plan is attached alongside. The same profile is auto-logged for every execution regardless of this flag (so Studio can read it); explain=true simply returns it inline in the response.
Response
Execution results with documents, pagination, statistics, and optimization details. When stream=true, returns Server-Sent Events. When stream=false, returns JSON response.
Response from retriever execution (non-streaming mode).
This response is returned when stream=False (the default). For streaming execution, the response is a Server-Sent Events stream of StreamStageEvent objects instead of this model.
Contains:
- execution_id: Unique identifier for this execution
- status: Execution status ('completed', 'failed', etc.)
- documents: Final document results after all stages complete
- pagination: Pagination metadata for result navigation
- stage_statistics: Per-stage execution metrics
- budget: Resource consumption (credits, time, tokens)
- optimization_applied: Whether pipeline was optimized
- optimization_summary: Details of optimization transformations
For streaming responses (stream=True), see StreamStageEvent model which contains event_type, stage progress, intermediate results, and statistics as each stage executes.
REQUIRED. Unique identifier for this execution run. Use this ID to track execution status, retrieve execution details, or query execution history. Format: 'exec_' prefix followed by alphanumeric token.
"exec_abc123def456"
"exec_xyz789"
REQUIRED. Execution status indicating current state. Common values: 'completed', 'failed', 'processing', 'pending'. Check this field to determine if execution succeeded or requires retry.
"completed"
"failed"
"processing"
The retriever that was executed. Use this to link interactions back to the retriever for learned fusion.
"ret_abc123def456"
REQUIRED. Final document results after retriever completion, and the canonical result key: read documents, not results (the latter is a deprecated byte-for-byte alias, off unless include_legacy_results=true, and its ABSENCE on a normal response must not be read as zero results). Contains documents that passed through all retriever stages. Each document may include: document_id, payload (full document data), score (relevance score), metadata (collection-specific fields), and any fields added by enrichment/join stages. The moment_group reduce stage annotates each document with a moments array of merged time ranges; each moment has start_ms, end_ms, duration_ms, score, match_count and document_ids (see the moment-annotated example). Empty array indicates no documents matched the query criteria. Note: Legacy format may use 'final_results' instead of 'documents'.
[ { "document_id": "doc_123", "payload": { "metadata": { "category": "AI" }, "text": "Sample content" }, "score": 0.95 }, { "document_id": "doc_456", "payload": { "metadata": { "category": "ML" }, "text": "Another document" }, "score": 0.88 }, { "document_id": "moment_vid_A_12000", "moments": [ { "document_ids": ["frame_41", "frame_42", "frame_43"], "duration_ms": 6500, "end_ms": 18500, "match_count": 3, "score": 0.91, "start_ms": 12000 } ], "parent_id": "vid_A", "score": 0.91 } ]
DEPRECATED alias for documents. Previously a computed field that duplicated documents byte-for-byte in every response (~half the payload). It is no longer populated by default to cut response size; pass ?include_legacy_results=true to restore it during migration. Prefer documents — it is and has always been the canonical field. OMITTED from the response when unpopulated while documents has data (an empty results next to populated documents misled readers into 'no results' — 2026-07-06 and again 2026-07-08). When present it is ALWAYS a JSON array, never null. See FRUSTRATIONS.md 2026-04-02 / 2026-06-29 / 2026-06-30.
REQUIRED. Pagination metadata structure. Format varies by pagination method: Offset: {method, page_number, page_size, returned, total, has_next}, Cursor: {method, limit, returned, total, cursor, has_next}, Scroll: {method, scroll_id, limit, returned, total, has_next}, Keyset: {method, limit, returned, total, after}. Every method reports 'total', the number of documents the pipeline computed for this execution BEFORE the page slice, so compare total against returned to detect that a page is a subset. Use this to navigate through result pages.
{ "has_next": false, "limit": 25, "method": "cursor", "returned": 25, "total": 25 }
{ "has_next": true, "method": "offset", "page_number": 1, "page_size": 10, "returned": 10, "total": 40 }
REQUIRED. Per-stage execution statistics including timing, document counts, cache hit rates, and stage-specific metrics. Use this to understand retriever performance and identify bottlenecks.
Show child attributes
Show child attributes
Facet value-lists + counts computed by the feature_search stage(s), surfaced at the TOP LEVEL for discoverability: each entry is a FacetResult (a facet key plus value/count buckets). The same data also appears per-stage under stage_statistics.stages.<stage>.metadata.facets; this field is the predictable place a facet consumer looks. When more than one stage computes facets, the last stage's facets are surfaced here. None when no facets were requested.
REQUIRED. Budget usage snapshot for this execution. Contains: credits_used (credits consumed), credits_remaining (remaining budget), time_used_ms (execution time), and budget limits. Use this to track resource consumption and enforce budget limits.
{ "credits_remaining": 99.5, "credits_used": 0.5, "time_used_ms": 150 }
Unix timestamp when this result was stored in the retriever cache. Present (non-null) only on cache hits; null on fresh executions, so a caller can tell how old a cached page is.
OPTIONAL. Execution warnings that did not prevent results but indicate potential issues — e.g. filtering on unindexed fields. Empty when there are no warnings.
OPTIONAL. What the platform UNDERSTOOD from your request, so a correction or relaxation is visible instead of silent. Keys: provided_input_keys (the inputs you sent), inferred_inputs (schema defaults applied because you omitted the field — name: value), ignored_input_keys (inputs nothing in the pipeline consumes; they had no effect), and relaxations (filter conditions removed because the input they reference was not provided — each names the field, the template, and where it sat; the result set is BROADER than the literal filter when this is non-empty). The literal query text is used AS PROVIDED — no spell-correction step exists; semantic search is typo-tolerant by embedding, which this block does not alter. Stage-level rewrites (e.g. query_expand) report their expansions in stage_statistics.stages..metadata.
OPTIONAL. Retriever-level error message if execution failed. Only present when status='failed'. Contains human-readable error description to help diagnose the failure. Check stage_statistics for stage-specific errors.
"Retriever execution failed: Collection not found"
OPTIONAL. Whether automatic pipeline optimizations were applied before execution. Mixpeek automatically optimizes retrieval pipelines for performance by reordering stages, merging operations, and pushing work to the database layer. Optimizations preserve logical equivalence - you get the same results, just faster. When true, see optimization_summary for details about what changed.
true
false
OPTIONAL. Summary of pipeline optimizations applied before execution. Only present when optimization_applied=true. Contains: - original_stage_count: Number of stages in your original pipeline - optimized_stage_count: Number of stages after optimization - optimization_time_ms: Time spent optimizing (typically <100ms) - rules_applied: List of optimization rules that fired - stage_reduction_pct: Percentage reduction in stage count Use this to understand how the optimizer improved your pipeline. See OptimizationRuleType enum for detailed rule descriptions.
{ "optimization_time_ms": 8.2, "optimized_stage_count": 3, "original_stage_count": 5, "rules_applied": ["push_down_filters", "group_by_push_down"], "stage_reduction_pct": 40 }
OPTIONAL. Learned fusion context when the retriever uses learned fusion (auto-tune) for weight optimization. Contains: context_key (resolution level used), sampled_weights (per-feature weight vector), feature_uris (features that were weighted), effective_exploration (Thompson sampling exploration rate), context_level ('personal', 'segment', or 'global'). Only present when learned fusion is active on this retriever.
True when this response was served from the retriever-level execute cache (cached_at then carries the storage timestamp); false on fresh executions. This is the canonical cache-hit signal: prefer it over inferring a hit from per-stage statistics, which on a cache hit reflect the original fresh run and read as cache_hit:false.
Whether any enrichment stages were skipped due to credit limits.
Names of enrichment stages that were skipped.
Reason enrichment stages were skipped (e.g., credit limit reached).
Agent-facing self-debugging aid: a human summary, per-stage input/output counts, and next_actions. Populated especially when a filter stage reduces candidates to zero so a caller can tell whether the field path was wrong, the field was absent, or values simply did not match — instead of guessing at a silent empty result.
Query profile for this execution, populated only when the request set explain=true. Contains per-stage timings + input/output counts, MVS execution stats (from build_execution_diagnostics), and the optimizer summary; extended with the shard ExecutionTrace (contributing partitions, served/shadow planner) as that wiring lands. The same structure is auto-logged as a retriever_query_profile event on every execution. Stable, additive contract — consumers should tolerate new keys.
Was this page helpful?

