Class SqliteVectorStore
SQLite-based vector store using manual cosine similarity. For production, consider sqlite-vec extension or a dedicated vector DB.
public sealed class SqliteVectorStore : IVectorStore, IDisposable
- Inheritance
-
SqliteVectorStore
- Implements
- Inherited Members
Constructors
SqliteVectorStore(string?)
public SqliteVectorStore(string? dbPath = null)
Parameters
dbPathstring
Methods
CountAsync(CancellationToken)
Returns the total number of stored entries.
public Task<long> CountAsync(CancellationToken ct = default)
Parameters
Returns
DeleteAsync(IReadOnlyList<string>, CancellationToken)
Deletes entries by IDs.
public Task DeleteAsync(IReadOnlyList<string> ids, CancellationToken ct = default)
Parameters
idsIReadOnlyList<string>ctCancellationToken
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
SearchAsync(float[], int, string?, CancellationToken)
Searches for similar entries by embedding vector.
public Task<IReadOnlyList<MemorySearchResult>> SearchAsync(float[] queryEmbedding, int topK = 5, string? categoryFilter = null, CancellationToken ct = default)
Parameters
queryEmbeddingfloat[]topKintcategoryFilterstringctCancellationToken
Returns
UpsertAsync(IReadOnlyList<MemoryEntry>, CancellationToken)
Upserts entries with their embeddings.
public Task UpsertAsync(IReadOnlyList<MemoryEntry> entries, CancellationToken ct = default)
Parameters
entriesIReadOnlyList<MemoryEntry>ctCancellationToken