MediaPipeTasksRetrieval Framework Reference

SqliteVectorStore

class SqliteVectorStore: NSObject, VectorStore

A vector store implementation backed by SQLite database using native SQLite vector engine.

  • Initializes the SqliteVectorStore with a local SQLite database file path and the embedding dimension.

    Declaration

    Swift

    init(databasePath: String, embeddingDimension: Int)
  • Declaration

    Swift

    var databasePath: String { get }
  • Deletes records from the vector store for the given list of IDs.

    Declaration

    Swift

    func delete(withIds ids: [String]) throws
  • Deletes records from the vector store matching the metadata filter.

    Declaration

    Swift

    func delete(withMetadataFilter metadataFilter: [String : String]) throws
  • Deletes all records from the vector store.

    Declaration

    Swift

    func deleteAllRecords() throws
  • Retrieves a single record matching the specified ID.

    Declaration

    Swift

    func getRecord(withId recordId: String) throws -> RetrievalRecord
  • Retrieves records from the vector store for the given list of IDs.

    Declaration

    Swift

    func getRecordsWithIds(_ ids: [String]) throws -> [RetrievalRecord]
  • Retrieves all unique top-level record identifiers in the vector store.

    Declaration

    Swift

    func recordIdentifiers() throws -> [String]
  • Retrieves the topK nearest records from the vector store matching the query embedding.

    Declaration

    Swift

    func search(withEmbedding queryEmbedding: [NSNumber], topK: Int) throws -> [RetrievalRecord]
  • Retrieves the topK nearest records from the vector store matching the query embedding with metadata filtering.

    Declaration

    Swift

    func search(withEmbedding queryEmbedding: [NSNumber], topK: Int, metadataFilter: [String : String]?) throws -> [RetrievalRecord]
  • Inserts or updates records in the vector store.

    Declaration

    Swift

    func upsertRecords(_ records: [RetrievalRecord]) throws