MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / rankChunksHybrid

Function rankChunksHybrid

src/context/retrieval.ts:296–306  ·  view source on GitHub ↗
(
  queryEmbedding: number[],
  query: string,
  chunks: Chunk[],
  topK: number,
)

Source from the content-addressed store, hash-verified

294 * queries (function names, error strings) while keeping semantic recall.
295 */
296export async function rankChunksHybrid(
297 queryEmbedding: number[],
298 query: string,
299 chunks: Chunk[],
300 topK: number,
301): Promise<ScoredChunk[]> {
302 // Semantic candidate pool — take a wide slice so fusion has material to work with.
303 const semantic = rankChunks(queryEmbedding, chunks, Math.max(topK * 3, 50));
304 const { hybridRank } = await import('./hybrid-search.js');
305 return hybridRank(chunks, semantic, query, topK);
306}
307
308export interface RankedFile {
309 file: string;

Callers 1

searchPersistedFunction · 0.85

Calls 2

rankChunksFunction · 0.85
hybridRankFunction · 0.85

Tested by

no test coverage detected