{% extends "base.html" %} {% from "_page_header.html" import page_header %} {% from "_components.html" import badge, field %} {% block content %} {{ page_header("Query Lab", "Run a query through the production retrieval pipeline and see why each chunk was found and why it ranks where it does: authorization, dense and sparse candidates, RRF fusion, context assembly, answerability and per-stage timings. Scores are ranking signals, not probabilities.") }}
{{ form_error }}
{% endif %} {% if not catalog.available %}Selector lists could not be loaded from the control plane; use the Advanced fields below to target spaces, sources or documents by ID.
{% endif %}Run a query above to inspect the retrieval pipeline.
{% else %} {#- Summary -#}Answerability
{{ badge(trace.answerability.status | replace("_", " "), "ok" if trace.answerability.status == "answerable" else ("warn" if trace.answerability.status in ("partially_answerable", "conflicting_evidence") else "neutral")) }}Evidence count
{{ trace.answerability.evidence_count }}Candidates
{{ trace.dense_candidates | length }} dense · {{ trace.sparse_candidates | length }} sparseFused
{{ trace.fusion.candidates | length }}{% if trace.fusion.suppressed_count %} ({{ trace.fusion.suppressed_count }} suppressed){% endif %}Degraded
{{ badge("Yes", "error") if trace.degraded else badge("No", "ok") }}Latency
{{ "%.1f" | format(trace.timings_ms.values() | sum) }} msprofile {{ trace.profile }}
Degraded run. Codes: {{ trace.degradation_codes | join(", ") if trace.degradation_codes else "none" }}
{% endif %} {% if not trace.fusion.candidates and not trace.degraded %}Zero results: no published chunk in the effective spaces matched the query and filters.
{% endif %} {#- Authorization & filters -#}Requested spaces: {{ trace.effective_filters.requested_space_ids | join(", ") or "all granted" }}
Effective spaces (server-computed): {{ trace.effective_filters.effective_space_ids | join(", ") or "none" }}
Denied / not granted: {{ trace.effective_filters.denied_space_ids | join(", ") or "none" }}
Trust-required spaces: {{ trace.effective_filters.trust_required_space_ids | join(", ") or "none" }}
Content types applied: {{ trace.effective_filters.applied_content_types | join(", ") or "none" }}
Languages applied: {{ trace.effective_filters.applied_languages | join(", ") or "none" }}
Source, document and trust-level filters are applied server-side in the same Qdrant filter as the space scope.
RRF score = Σ 1 / (k + rank) over the backends that returned the chunk. A chunk found by both backends outranks one found by only one at the same rank. This fused order is the real ranking: no reranker is active in this deployment.
{% set candidate_list = trace.fusion.candidates %}{% set fused = true %} {% include "query_lab/_candidate_table.html" %}Degradation code: {{ trace.rerank.degradation_code }}
{% endif %} {% set candidate_list = trace.rerank.candidates %}{% set fused = false %} {% include "query_lab/_candidate_table.html" %}Token budget: {{ trace.context.token_count }} / {{ trace.context.max_context_tokens }} · Blocks: {{ trace.context.block_count }} · Citations in context: {{ trace.context.citation_ids | length }}
Parent expansions applied: {{ trace.parent_expansion.expanded_count }} · Skipped: {{ trace.parent_expansion.skipped_count }} · Expansion tokens: {{ trace.parent_expansion.total_expansion_tokens }}
| Provenance | Excerpt |
|---|---|
|
{{ citation.display or citation.document_title or ("Document " ~ (citation.document_id | string)[:8] ~ "…") }} {% if citation.source_name %}{{ citation.source_name }} · {% endif %}{{ citation.source_uri }} doc {{ (citation.document_id | string)[:8] }}… · chunk {{ (citation.chunk_id | string)[:8] }}… |
{{ citation.excerpt_preview }}{% if citation.excerpt_truncated %} … (truncated){% endif %} |
| No citations. | |
{{ badge(trace.answerability.status | replace("_", " "), "ok" if trace.answerability.status == "answerable" else "neutral") }} (a category, not a confidence percentage)
Reason codes: {{ trace.answerability.reasons | join(", ") }}
Evidence count: {{ trace.answerability.evidence_count }} · Document diversity: {{ trace.answerability.document_diversity }} · Source independence: {{ trace.answerability.source_independence }} · Facet coverage: {{ "%.2f" | format(trace.answerability.facet_coverage_ratio) }} · Thresholds version: {{ trace.answerability.thresholds_version }}
Generation is not run by Query Lab: it inspects retrieval and answerability; /v1/answers produces grounded answers from the same context.
| {{ name }} | {{ "%.1f" | format(value) }} ms |
|---|
Retrieval run ID: {{ trace.retrieval_run_id }}