@vivantel/virage-core
    Preparing search index...

    Interface VectorStore

    interface VectorStore {
        name: string;
        batchDelete?(ids: string[]): Promise<void>;
        close?(): Promise<void>;
        deleteBySourceFile(sourceFiles: string[]): Promise<void>;
        deleteCollection?(collection: string): Promise<void>;
        deleteOrphanedChunks?(
            sourceFile: string,
            keepHashes: string[],
        ): Promise<void>;
        existingHashes?(hashes: string[]): Promise<string[]>;
        getCurrentState(collection?: string): Promise<Map<string, string>>;
        getIndexStats?(): Promise<IndexStats>;
        getQueryPerfReport?(timeframeHours: number): Promise<QueryPerfReport>;
        getStats?(): Promise<{ collections: string[]; documentCount: number }>;
        initialize(): Promise<void>;
        listAll?(
            opts?: { includeVectors?: boolean; limit?: number; offset?: number },
        ): Promise<ListedDocument[]>;
        readMeta?(): Promise<VectorStoreMeta | null>;
        search(
            queryEmbedding: number[],
            topK: number,
            collection?: string,
            options?: SearchOptions,
        ): Promise<VectorSearchResult[]>;
        upsert(documents: VectorDocument[]): Promise<void>;
        writeMeta?(meta: VectorStoreMeta): Promise<void>;
    }
    Index
    name: string

    Store name

    • Optional: delete chunks for sourceFile whose id is NOT in keepHashes. Called after uploading new chunks to remove stale embeddings without wiping the whole file first (enables existingHashes caching to work).

      Parameters

      • sourceFile: string
      • keepHashes: string[]

      Returns Promise<void>

    • Optional: check which of the given denseTextHash values already exist in the store. Used by the orchestrator to skip re-embedding unchanged chunks across runs. Returns the subset of hashes that are already stored.

      Parameters

      • hashes: string[]

      Returns Promise<string[]>

    • Get current state (sourceFile → commitHash) for change detection

      Parameters

      • Optionalcollection: string

      Returns Promise<Map<string, string>>