Vector Troubleshooting

Vector systems fail in quiet ways. Search still returns results, but the results look wrong, arrive slowly, or miss documents you know exist. A clear diagnostic routine saves hours of guessing.

The Doctor Analogy

A doctor asks about symptoms, runs tests, and narrows down the cause before prescribing a treatment. Apply the same discipline. Describe the symptom precisely, test one cause at a time, and change one setting at a time.

Symptom Guide

SymptomLikely CausesFirst Check
Results look random or unrelatedDifferent embedding models for documents and queries, wrong distance metricConfirm one model name and version on both sides
Correct document never appearsPoor chunking, content missing, restrictive filterSearch without filters and look up the document by ID
Queries run slowlyNo index, high search width, memory pressureCheck the index type and memory use
Recall dropped after a data loadIndex needs a rebuild, many deletionsCompare against a flat index test
Memory keeps climbingGrowing data, replicas, large index settingsCalculate expected memory and compare
New documents stay invisibleFailed inserts, delayed indexingRead insert responses and wait for indexing to finish
Filtered searches return too few resultsFilter too strict, missing metadataCount how many vectors match the filter alone

A Step-by-Step Diagnosis

DIAGNOSIS FLOW

  Problem reported
        |
        v
  1. Reproduce it with one exact query
        |
        v
  2. Is the target document in the database?
     No  -> fix ingestion
     Yes -> continue
        |
        v
  3. Does a flat (exact) search find it?
     No  -> embedding or chunking problem
     Yes -> index or filter problem
        |
        v
  4. Does the result appear with filters removed?
     Yes -> filter or metadata problem
     No  -> index settings problem

Problem 1: Mismatched Embeddings

This mistake produces the strangest results. Documents embedded with one model and queries embedded with another live in different spaces. Check the vector dimension first, since a mismatch there usually raises an error. Matching dimensions can still hide different models, so verify the model name in your configuration and in your stored metadata.

Problem 2: Bad Chunks

Chunks that cut sentences in half, mix topics, or contain only page headers produce weak vectors. Print the actual text of the top results. Reading the chunks often reveals the issue within minutes.

CHECKLIST FOR CHUNK QUALITY

  [ ] Each chunk covers one idea
  [ ] Chunks start and end at sentence boundaries
  [ ] No repeated headers or footers
  [ ] Section titles included for context
  [ ] Chunk size fits the embedding model limit

Problem 3: Wrong Distance Metric

Each embedding model recommends a metric, usually cosine similarity. A collection created with Euclidean distance when the model expects cosine can lower result quality. Read the model documentation and match the setting.

Problem 4: Slow Queries

  1. Confirm that an approximate index exists on the collection.
  2. Lower the search width and measure the change in speed and recall.
  3. Check whether vectors spill from memory to disk.
  4. Review result size, because returning large payloads slows responses.
  5. Look at traffic spikes and add replicas if needed.

Problem 5: Degraded Index After Many Changes

Graph indexes can lose quality after heavy deletion and updates. Compare recall with a flat search on a sample of queries. A noticeable gap suggests rebuilding or optimizing the index.

Keep a Debugging Log

DEBUG LOG ENTRY

  Date:        2026-11-13
  Symptom:     Refund questions return shipping documents
  Hypothesis:  Chunks too large, topics mixed
  Change:      Chunk size 800 -> 300 words
  Result:      Recall@5 improved from 62% to 81%
  Decision:    Keep change

Prevent Problems Early

  • Run a fixed test set after every deployment.
  • Record the model name, chunk settings, and index settings with each collection.
  • Validate vector dimensions and metadata at insert time.
  • Keep a small flat index for comparison tests.

Calm, ordered troubleshooting beats random tweaking. Reproduce the issue, isolate the layer, change one thing, and measure again.