VectorStore
protocol VectorStoreStorage backend for vector embeddings, multimodal part handles, and record metadata.
-
Deletes all records matching
ids, along with any associated child rows.Declaration
Swift
func delete(ids: [String]) throws -
Deletes all records matching every
metadataFilterpair, along with associated child rows.Declaration
Swift
func delete(metadataFilter: [String: String]) throws -
Deletes every record in the store.
Declaration
Swift
func deleteAllRecords() throws -
Returns the stored record matching
id, ornilif not found.Declaration
Swift
func record(id: String) throws -> RetrievalRecord? -
Returns the stored record matching
id, ornilif not found.Declaration
Swift
func record(id: String) throws -> RetrievalRecord? -
Returns all top-level record identifiers in the store (excluding child chunk or part rows).
Declaration
Swift
func recordIdentifiers() throws -> [String] -
Returns all stored records matching
ids.Declaration
Swift
func records(ids: [String]) throws -> [RetrievalRecord] -
Searches for up to
limitnearest records with a minimum similarity threshold of0.Declaration
Swift
func search(embedding: [Float], limit: Int = 5, metadataFilter: [String: String]? = nil) throws -> [RetrievalRecord] -
Searches for up to
limitnearest records whose similarity is at leastminSimilarity.Declaration
Swift
func search(embedding: [Float], limit: Int = 5, minSimilarity: Float) throws -> [RetrievalRecord] -
Searches for up to
limitrecords whose similarity toembeddingis at leastminSimilarity, optionally restricted to records matching everymetadataFilterpair.Declaration
Swift
func search(embedding: [Float], limit: Int, minSimilarity: Float, metadataFilter: [String: String]?) throws -> [RetrievalRecord] -
Searches for up to 5 nearest records matching
minSimilarityandmetadataFilter.Declaration
Swift
func search(embedding: [Float], minSimilarity: Float, metadataFilter: [String: String]?) throws -> [RetrievalRecord] -
Inserts or replaces
recordsin the store.Declaration
Swift
func upsertRecords(_ records: [RetrievalRecord]) throws