agent功能开发增加MCP后端

This commit is contained in:
2025-11-08 10:17:48 +08:00
parent dff37adbbc
commit 6228bef5ad
2 changed files with 131 additions and 47 deletions

View File

@@ -490,7 +490,7 @@ def build_hybrid_knn_query(
"field": "description_embedding",
"query_vector": embedding,
"k": k,
"num_candidates": min(k * 2, 500),
"num_candidates": max(k + 50, min(k * 2, 10000)), # 确保 num_candidates > k最大 10000
"boost": semantic_weight
}
}
@@ -591,7 +591,7 @@ async def search_concepts(request: SearchRequest):
"field": "description_embedding",
"query_vector": embedding,
"k": effective_search_size, # 使用有效搜索大小
"num_candidates": min(effective_search_size * 2, 1000)
"num_candidates": max(effective_search_size + 50, min(effective_search_size * 2, 10000)) # 确保 num_candidates > k
},
"size": effective_search_size
}