MCPcopy Index your code
hub / github.com/simstudioai/sim / getQueryStrategy

Function getQueryStrategy

apps/sim/app/api/knowledge/search/utils.ts:309–320  ·  view source on GitHub ↗
(kbCount: number, topK: number)

Source from the content-addressed store, hash-verified

307}
308
309export function getQueryStrategy(kbCount: number, topK: number) {
310 const useParallel = kbCount > 4 || (kbCount > 2 && topK > 50)
311 const distanceThreshold = kbCount > 3 ? 0.8 : 1.0
312 const parallelLimit = Math.ceil(topK / kbCount) + 5
313
314 return {
315 useParallel,
316 distanceThreshold,
317 parallelLimit,
318 singleQueryOptimized: kbCount <= 2,
319 }
320}
321
322async function executeTagFilterQuery(
323 knowledgeBaseIds: string[],

Callers 5

executeFunction · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
handleTagOnlySearchFunction · 0.85
handleVectorOnlySearchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected