microsoft / semantic-kernel

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

.Net: [QUERY] How to retrive data from Semantic Kernel vector store? #9141

Open jsquire opened 1 day ago

jsquire commented 1 day ago

Issue Transfer

This issue has been transferred from the Azure SDK for .NET repository, #46443.

Please be aware that @dotcom-gosahi is the author of the original issue and include them for any questions or replies.

Details

Library name and version

Microsoft.SemanticKernel.Core

Query/Question

I am able to ingest the data in the semantic kernel vector store. But I am exactly not sure how to retrive it. I am builing a web application using .net 8. I am injecting kernel in dependency injection. Referring to this document https://learn.microsoft.com/en-us/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/volatile-connector?pivots=programming-language-csharp

Environment

No response

westey-m commented 15 hours ago

Hi @dotcom-gosahi, thanks for the question.

I assume you mean how do you do vector searches? I realize that is still a big gap, but we are still working on it, and we are aiming to release that functionality next week with documentation, so keep an eye out for our release next week.

If you are interested in seeing what we have been doing, you can check out our feature branch here: https://learn.microsoft.com/en-us/semantic-kernel/concepts/vector-store-connectors

And here is a link to one of the samples: https://github.com/microsoft/semantic-kernel/blob/feature-vector-search/dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_MultiStore_Common.cs

dotcom-gosahi commented 12 hours ago

Thanks @westey-m. Yes, I was looking for this only, how to perform vectorized search on these stores. This is that piece of code. image

Right now I am getting error in this line var searchResult = await collection.VectorizedSearchAsync(searchVector, new() { Top = 1 }); image

Just to be sure, after release next week, this gap will be addressed?

westey-m commented 10 hours ago

@dotcom-gosahi, yes, this gap will be closed with next week's release. You are getting the error because we haven't released this code to the public nuget yet.