Skip to content

SemanticIndex

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/agent-core/src/semantic/semantic-index.ts

Methods

MethodSignatureReturns
indexindex()Promise<IndexStats>
reindexFilesreindexFiles(files: string[])Promise<void>
searchsearch(query: string, topK: number)Promise<SearchResult[]>
isIndexedisIndexed()boolean

Where it refuses work

  • SemanticIndex stops the work with an early return when results.length >= maxFiles, in 2 places.
  • SemanticIndex stops the work with an early return when toReindex.length === 0.
  • SemanticIndex stops the work with an early return when gitFiles.
  • SemanticIndex stops the work with an early return when !includeExtensions.includes(ext).
  • SemanticIndex stops the work with an early return when !fs.existsSync(gitDir).

When something fails

  • SemanticIndex handles failure in 8 places: it discards it silently in 5, turns it into a return value in 2, and logs it and continues in 1.

Was this page helpful?

Download as PDF