MCPcopy Create free account
hub / github.com/agenticsorg/edge-agents / searchVectorStore

Function searchVectorStore

scripts/sparc2/src/vector/vectorStore.ts:364–383  ·  view source on GitHub ↗
(
  query: string,
  maxResults: number = 10,
)

Source from the content-addressed store, hash-verified

362 }
363}
364export async function searchVectorStore(
365 query: string,
366 maxResults: number = 10,
367): Promise<VectorSearchResult[]> {
368 // Split the max results between logs and diffs
369 const halfResults = Math.ceil(maxResults / 2);
370
371 // Search both logs and diffs
372 const [logResults, diffResults] = await Promise.all([
373 searchLogEntries(query, halfResults),
374 searchDiffEntries(query, halfResults),
375 ]);
376
377 // Combine and sort results by score
378 const combinedResults = [...logResults, ...diffResults]
379 .sort((a, b) => b.score - a.score)
380 .slice(0, maxResults);
381
382 return combinedResults;
383}

Callers 2

startMCPServerFunction · 0.50
startMCPServerStdioFunction · 0.50

Calls 2

searchLogEntriesFunction · 0.70
searchDiffEntriesFunction · 0.70

Tested by

no test coverage detected