kbeaugrand / SemanticKernel.Connectors.Memory.SqlServer

SQL Server connector for Semantic Kernel plugin and Kernel Memory
MIT License
47 stars 10 forks source link

Add document filter to retrieval query to improve results on large sets #126

Closed ErikNorenRG closed 8 months ago

ErikNorenRG commented 8 months ago

Description

What's new?

The [similarity] CTE does not filter its query which is filling up the TOP results with data that gets dropped in the query that follows it. This is pushing out usable results in favor of more similar matches that are then filtered out and this is causing INFO NOT FOUND in cases where we know it should not. Duplicating the filter in the CTE seems to resolve this.

What kind of change does this PR introduce?