Search Debug

A powerful troubleshooting tool that visualizes the entire search pipeline — see exactly how your query flows through vector search, BM25, and fusion scoring without making an LLM call.

Who can access this?

analyst manager superadmin

Overview

The Search Debug page runs the exact same search algorithm as production queries but skips the LLM call. This lets you inspect every stage of the pipeline to understand why certain results rank higher, why some are filtered out, and how to improve search quality.

When to Use
  • A user reports that a query isn't returning expected results
  • You want to verify a newly uploaded document is searchable
  • You're tuning relevance threshold, top-k, or search method settings
  • You want to understand how pricing/spec keyword detection works

Debug Controls

ControlDescription
Query input Type the search query to debug
Top-K Number input — override the top-k value for this debug session
Sim Threshold Slider + number input — visually re-filter results at a different threshold (simulation only, doesn't affect stored settings)
Sim Method Radio buttons — simulate using a different search method (Hybrid / Vector / BM25)
Debug controls
Screenshot: Search debug controls — query input, top-k, threshold slider, method radio buttons

The 9 Debug Sections

Debug results are displayed in 9 collapsible sections, each showing a different stage of the pipeline:

1. Configuration Banner

Shows the current search settings used for this debug run:

2. Query Detection

Shows whether pricing keywords or spec keywords were detected in the query. Displays the matched keywords with highlights.

3. Summary Cards

Seven metric cards at a glance:

CardMeaning
To LLMNumber of results that would be sent to the LLM
PassedResults that passed the relevance threshold
HybridTotal hybrid fusion results (before filtering)
VectorRaw vector search result count
BM25Raw BM25 search result count
PricingPricing database matches (if pricing keywords detected)
SpecsProduct spec matches (if spec keywords detected)

4. LLM Context Sources

The final top-K ranked list of results that would be sent to the LLM as numbered sources. This is the most important section — it shows exactly what the AI would "see".

5. Threshold Filter

Shows every result with its score and whether it passed or failed the relevance threshold. Useful for understanding why certain results were excluded.

6. Hybrid Fusion

The combined scoring table showing how vector and BM25 scores were merged:

final_score = (vector_weight × vector_score) + (bm25_weight × bm25_score)

Each row shows the individual vector score, BM25 score, and final combined score.

7. Vector Search (Raw)

Raw vector similarity scores from ChromaDB. Shows the embedding query that was sent and cosine similarity for each result.

8. BM25 Search (Raw)

Raw BM25 ranks from SQLite FTS5. Shows the tokenized query and BM25 rank for each result.

9. Pricing & Specs Results

If pricing or spec keywords were detected, this section shows the matched records from those databases.

Debug visualization
Screenshot: Full debug output showing all 9 sections with score bars, pass/fail indicators, and color-coded results

Score Visualization

Scores are displayed as colored progress bars with the numeric value:

ColorScore RangeInterpretation
Green bar≥ 0.5Strong match — highly relevant
Yellow bar≥ 0.3Moderate match — likely relevant
Red bar< 0.3Weak match — may be filtered out

Troubleshooting Tips

Common Issues & Solutions
  • 0 results — Check if documents are uploaded and VectorDB is synced. Verify the query doesn't contain only stop words.
  • Low scores — Consider re-indexing documents with smaller chunk sizes for better precision, or adjust the relevance threshold down.
  • Pricing not detected — Verify the query contains at least one pricing keyword (harga, price, berapa, etc.).
  • Wrong results ranking high — Check FTS weights in the Schema Editor. Consider adjusting vector/BM25 weight balance.