Skip to content
Discussion options

You must be logged in to vote

@gusmally I would recommend using other memory store, since current implementation for Sqlite fetches all DB records during search operation which is not the best approach in terms of performance:

await foreach (var record in this.GetAllAsync(collectionName, cancellationToken).ConfigureAwait(false))
{
if (record is not null)
{
double similarity = TensorPrimitives.CosineSimilarity(embedding.Span, record.Embedding.Span);
if (similarity >= minRelevanceScore)
{
var entry = withEmbeddings ? record : MemoryRecord.FromMetadata(record.Metadata

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gusmally
Comment options

Answer selected by gusmally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants