Open nikkla opened 2 weeks ago
Hi @nikkla ! While we investigate this issue, I would recommend trying newly updated NoSQL connector which allows to work with your custom schema. You can try it now by downloading SK v1.17.2: https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.AzureCosmosDBNoSQL/1.17.2-alpha
Class to operate with collections is AzureCosmosDBNoSQLVectorStoreRecordCollection
:
https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLVectorStoreRecordCollection.cs
Would be great to receive your feedback, thanks!
Hi @dmytrostruk thank you for your answer. As a mentioned in the bug description, I'm currently using the newest version of the AzureCosmosDBNoSQL which is 1.18.0-alpha referring to Nuget https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.AzureCosmosDBNoSQL.
I'm using no custom schema, the collection was created by Semantic Kernel. I just added the vector index with semantic kernel based on the documentation I could found. Based on the error calling stack it seems like the error is not in the vector index, because the upsert failed. May Semantic Kernel not passing the correct arguments.
Describe the bug AzureCosmosDBNoSQLMemoryStore can not save Information to Azure NoSQL Cosmos DB because CosmosDb Method UpsertItemAsync() fails to execute with following message:
To Reproduce Steps to reproduce the behavior:
var indexPolicy = new IndexingPolicy { VectorIndexes = new() { new() { Path = embedding.Path, Type = VectorIndexType.QuantizedFlat } } };
new MemoryBuilder() .WithOpenAITextEmbeddingGeneration("text-embedding-3-small", Environment.GetEnvironmentVariable("openAiKey")!) .WithMemoryStore(new AzureCosmosDBNoSQLMemoryStore(comsmosClient, "memoryDb", new VectorEmbeddingPolicy([embedding]), indexPolicy)) .Build();
Expected behavior The Semantic Text Memory stores the information correctly without errors in the Azure NoSQL Cosmos DB.
Screenshots
Platform
Additional context Semantic Kernel correctly creates the container and also adds the vector index. The error only occurs when storing the information.