microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
21.31k stars 3.13k forks source link

.Net: Extend ISemanticTextMemory.SearchAsync to support multiple collections #2169

Closed Nurgo closed 1 year ago

Nurgo commented 1 year ago

Hi,

I've been using SemanticKernel and really appreciate the work that has gone into this project.

I've noticed that the ISemanticTextMemory.SearchAsync method currently only supports searching within a single collection at a time. This means that when you want to search across multiple collections, you have to call SearchAsync multiple times. This leads to unnecessary calls to OpenAI's APIs, as the embedding vector for the query is recreated for each call.

Would it be possible to modify ISemanticTextMemory.SearchAsync to take "IEnumerable\<string> collections" as a parameter, instead of "string collection"? This way, users can search across multiple collections in a single call, which should increase efficiency and reduce the number of calls to OpenAI's APIs.

Thank you for considering this suggestion.

evchaki commented 1 year ago

@Nurgo I am closing this one as it is a dup of #2268