OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Perf] /api/v1/search/find rerank-dominated vector retrieval latency (~31s)

Open LeoooKang opened this issue 2 months ago • 1 comments

/api/v1/search/find rerank-dominated vector retrieval costs ~31 s per call (87 scored → 43 passed → 3 returned; 31,812 rerank tokens vs 7 embedding tokens). An embedding cache would recover only ~7 %.

Telemetry Evidence

Measured on OpenViking server with FindRequest telemetry enabled:

{
  "summary": {
    "operation": "search.find",
    "status": "ok",
    "duration_ms": 35226.488,
    "tokens": {
      "total": 33525,
      "embedding": {
        "total": 7
      },
      "rerank": {
        "total": 33518
      },
      "stages": {
        "embed_query": {
          "embedding": {
            "total": 7
          }
        },
        "rerank": {
          "rerank": {
            "total": 33518
          }
        }
      }
    },
    "vector": {
      "searches": 13,
      "scored": 87,
      "passed": 44,
      "returned": 3,
      "scanned": 87
    },
    "search": {
      "embed_query": {
        "duration_ms": 1399.002
      },
      "vector_retrieval": {
        "duration_ms": 30473.631
      }
    }
  }
}

Candidate Levers

  • Rerank short-circuit for high-confidence hits (score threshold early-exit before full rerank sweep).
  • Rerank batching / candidate pre-filtering / per-target rerank budgets (addressing 11–13 serial rerank calls pattern).
  • Expose an async find (202 Accepted + task id, poll or webhook), matching the existing /api/v1/tasks pattern.

LeoooKang avatar Sep 11 '26 13:09 LeoooKang

Thanks for the telemetry! The reported find behavior is covered by #4463 and its merged fix #4472. VikingFS.find() now explicitly selects QUICK retrieval, whose result path does not call the reranker. The multi-round rerank path shown in this trace is therefore no longer the current /api/v1/search/find implementation.

Closing as covered by that resolved issue. This is specific to find; it does not claim that reranking latency in /api/v1/search/search is solved.

If a deployment containing #4472 still records rerank calls for the exact find endpoint, please reopen, or comment requesting reopening, with the server build/version, sanitized request and complete operation telemetry. Those details would identify a different path or a regression rather than assuming the old fix covers it.

qin-ctx avatar Sep 18 '26 08:09 qin-ctx