Skip to content

All Languages: Align memory connectors in GetNearestMatchesAsync behavior #2269

@dmytrostruk

Description

@dmytrostruk

In some cases, method GetNearestMatchesAsync in specific memory provider returns empty result set when collection doesn't exist (e.g. Qdrant). In other memory providers the method throws an exception (e.g. Chroma).

It would be great to align all memory providers to use the same flow.

My suggestion: when collection doesn't exist, method GetNearestMatchesAsync should throw an exception, in similar way how other methods work (Get, Upsert, Remove etc.). This will allow to show the consumer that something is wrong with memory setup. While empty result set should be returned only when collection exists, but it's empty.

This approach will allow to differentiate two cases in the code and react to them appropriately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    memory connectorsk team issueA tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)staleIssue is stale because it has been open for a while and has no activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions