Skip to content

Commit 5fd06bb

Browse files
committed
perf(retrieve): increase GLOBAL_SEARCH_TOPK from 5 to 10
More vector candidates for reranker to evaluate = better precision. With Cohere rerank-v3.5, 10 candidates gives the cross-encoder enough material to find the best match without excessive latency. none
1 parent 08b7685 commit 5fd06bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openviking/retrieve/hierarchical_retriever.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class HierarchicalRetriever:
4848
MAX_RELATIONS = 5 # Maximum relations per resource
4949
SCORE_PROPAGATION_ALPHA = 0.5 # Score propagation coefficient
5050
DIRECTORY_DOMINANCE_RATIO = 1.2 # Directory score must exceed max child score
51-
GLOBAL_SEARCH_TOPK = 5 # Global retrieval count
51+
GLOBAL_SEARCH_TOPK = 10 # Global retrieval count (more candidates = better rerank precision)
5252
HOTNESS_ALPHA = 0.2 # Weight for hotness score in final ranking (0 = disabled)
5353
LEVEL_URI_SUFFIX = {0: ".abstract.md", 1: ".overview.md"}
5454

0 commit comments

Comments
 (0)