memorix icon indicating copy to clipboard operation
memorix copied to clipboard

[Feature request] Make LLM rerank timeout configurable

Open FurryWolfX opened this issue 7 months ago • 2 comments

Problem

The LLM rerank timeout is hardcoded to 5 seconds (RERANK_TIMEOUT_MS = 5000 in src/store/orama-store.ts). This causes frequent "LLM rerank failed or timed out, using original order" messages when the LLM API is slow or under load.

Context

  • The timeout was reduced from 10s to 5s (per code comment: "was 10s")
  • Reranking is best-effort — on timeout it falls back to original order
  • Users with slower LLM APIs or higher latency environments cannot adjust

Request

Make the rerank timeout configurable via:

  1. Environment variable (e.g., MEMORIX_RERANK_TIMEOUT_MS)
  2. Or memorix.yml config option

FurryWolfX avatar Apr 05 '26 16:04 FurryWolfX

Thanks for opening this. We agree rerank timeout should be configurable, and we plan to address this in the next release. We’re treating this together with the wider LLM timeout family so the final fix is coherent instead of exposing only one timeout in isolation.

AVIDS2 avatar Apr 08 '26 03:04 AVIDS2

Fixed rerank timeout is now configurable via MEMORIX_RERANK_TIMEOUT_MS env var (default 5000ms). Set it higher for slow LLM APIs.

AVIDS2 avatar Apr 14 '26 14:04 AVIDS2