InMemoryVectorStore

public final class InMemoryVectorStore

In-memory VectorStore implementation backed by a SQLite :memory: database.

Public Constructors

InMemoryVectorStore(int embeddingDimension)
Creates an in-memory vector store with the specified embedding dimension.

Public Methods

void
upsertRecords(List<RetrievalRecord> records)
Inserts or updates a list of records in memory.
List<RetrievalRecord>
search(float[] queryEmbedding, int topK, Map<String, String> metadataFilter)
Searches the top-K nearest records in memory.
void
delete(List<String> ids)
Deletes records matching the specified IDs.
void
deleteByMetadata(Map<String, String> metadataFilter)
Deletes records matching the specified metadata filter.
void
deleteAllRecords()
Deletes all records from the in-memory store.
List<String>
getAllRecordIds()
Returns all unique top-level record identifiers.
void
close()
Closes the in-memory vector store.

Inherited Methods

Public Constructors

public InMemoryVectorStore (int embeddingDimension)

Creates an in-memory vector store with the specified embedding dimension.

Public Methods

public void upsertRecords (List<RetrievalRecord> records)

Inserts or updates a list of records in memory.

public List<RetrievalRecord> search (float[] queryEmbedding, int topK, Map<String, String> metadataFilter)

Searches the top-K nearest records in memory.

public void delete (List<String> ids)

Deletes records matching the specified IDs.

public void deleteByMetadata (Map<String, String> metadataFilter)

Deletes records matching the specified metadata filter.

public void deleteAllRecords ()

Deletes all records from the in-memory store.

public List<String> getAllRecordIds ()

Returns all unique top-level record identifiers.

public void close ()

Closes the in-memory vector store.