You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a C# service that uses Semantic Kernel’s SqliteVectorStore together with GoogleAIEmbeddingGenerator (models/embedding-001) to store and search embeddings.
I’m running into a compilation issue when attempting to call GetNearestMatchesAsync on a SqliteVectorStoreRecordCollection.
Environment Details
NuGet Package Versions (from dotnet list package):
Package
Version
Microsoft.SemanticKernel
1.51.0
Microsoft.SemanticKernel.Connectors.Sqlite
1.51.0-preview
Microsoft.SemanticKernel.Connectors.Google
1.52.0-alpha
Microsoft.Extensions.VectorData.Abstractions
9.0.0-preview.1.25229.1
Environment:
Windows Server 2022
.NET SDK 8.0.401
Visual Studio 2022
Minimal Reproducible Code:
using Microsoft.SemanticKernel.Connectors.Google;
using Microsoft.SemanticKernel.Connectors.Sqlite;
using Microsoft.Extensions.VectorData;
using Microsoft.Extensions.VectorData.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace VectorSearchRepro
{
public class SqliteVectorRecord : IVectorStoreRecord
{
public string Id { get; set; } = string.Empty;
public string Text { get; set; } = string.Empty;
public ReadOnlyMemory Vector { get; set; }
public ReadOnlyMemory<float> GetVector() => Vector;
public void SetVector(ReadOnlyMemory<float> vector) => Vector = vector;
}
public class Program
{
private static SqliteVectorStore _vectorStore;
private static IVectorStoreVectorCollection<string, SqliteVectorRecord> _collection;
private static GoogleAIEmbeddingGenerator _generator;
public static async Task Main()
{
string dbPath = "semantic_vectors.db";
string geminiApiKey = Environment.GetEnvironmentVariable("GEMINI_API_KEY");
_vectorStore = new SqliteVectorStore(dbPath);
_collection = new SqliteVectorStoreRecordCollection<string, SqliteVectorRecord>(
_vectorStore, "agreements");
var chunks = new List<string> { "Confidentiality clause text." };
var result = await _generator.GenerateAsync(chunks);
var embedding = result.Data.First().Vector;
var record = new SqliteVectorRecord
{
Id = "1",
Text = chunks[0],
Vector = embedding
};
await _collection.UpsertAsync(record);
// ❌ Error here:
var results = await _collection.GetNearestMatchesAsync(
embedding.ToArray(), limit: 3);
Console.WriteLine(results);
}
}
}
Error Message: 'IVectorStoreVectorCollection<string, SqliteVectorRecord>' does not contain a definition for 'GetNearestMatchesAsync'
and no accessible extension method 'GetNearestMatchesAsync' accepting a first argument of type
'IVectorStoreVectorCollection<string, SqliteVectorRecord>' could be found
(are you missing a using directive or an assembly reference?)
What I’ve Tried
Added using Microsoft.Extensions.VectorData;
Added using Microsoft.Extensions.VectorData.Core;
Verified _collection type is SqliteVectorStoreRecordCollection<string, SqliteVectorRecord>
Checked Semantic Kernel and VectorData assemblies for extension methods
No overload or extension method for nearest neighbor search appears to exist
Question
In Semantic Kernel v1.51.0 (with VectorData 9.x):
Where has the GetNearestMatchesAsync method been moved?
Which interface or class now exposes nearest-neighbor vector search for SqliteVectorStore collections?
Is there a new API (e.g., IVectorSearchCollection, IVectorQueryExecutor) that replaces this method?
If the API was refactored between 1.51.0-preview and 1.52.0-alpha, could you please point to the relevant example or PR?
Goal
I simply want to:
Generate embeddings using GoogleAIEmbeddingGenerator (models/embedding-001)
Store them in a local SQLite vector store
Perform semantic similarity search (kNN)
using Semantic Kernel’s built-in vector connectors.
Expected Behavior
_collection.GetNearestMatchesAsync() should return the top-N semantically similar text records.
Actual Behavior
Compilation fails — the method is no longer defined on IVectorStoreVectorCollection.
.NETIssue or Pull requests regarding .NET codetriage
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I'm working on a C# service that uses Semantic Kernel’s SqliteVectorStore together with GoogleAIEmbeddingGenerator (models/embedding-001) to store and search embeddings.
I’m running into a compilation issue when attempting to call GetNearestMatchesAsync on a SqliteVectorStoreRecordCollection.
Environment Details
NuGet Package Versions (from dotnet list package):
Environment:
Windows Server 2022
.NET SDK 8.0.401
Visual Studio 2022
Minimal Reproducible Code:
using Microsoft.SemanticKernel.Connectors.Google;
using Microsoft.SemanticKernel.Connectors.Sqlite;
using Microsoft.Extensions.VectorData;
using Microsoft.Extensions.VectorData.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace VectorSearchRepro
{
public class SqliteVectorRecord : IVectorStoreRecord
{
public string Id { get; set; } = string.Empty;
public string Text { get; set; } = string.Empty;
public ReadOnlyMemory Vector { get; set; }
#pragma warning disable SKEXP001
#pragma warning disable SKEXP0070
_generator = new GoogleAIEmbeddingGenerator(
modelId: "models/embedding-001",
apiKey: geminiApiKey);
#pragma warning restore SKEXP0070
#pragma warning restore SKEXP001
}
Error Message: 'IVectorStoreVectorCollection<string, SqliteVectorRecord>' does not contain a definition for 'GetNearestMatchesAsync'
and no accessible extension method 'GetNearestMatchesAsync' accepting a first argument of type
'IVectorStoreVectorCollection<string, SqliteVectorRecord>' could be found
(are you missing a using directive or an assembly reference?)
What I’ve Tried
Added using Microsoft.Extensions.VectorData;
Added using Microsoft.Extensions.VectorData.Core;
Verified _collection type is SqliteVectorStoreRecordCollection<string, SqliteVectorRecord>
Checked Semantic Kernel and VectorData assemblies for extension methods
No overload or extension method for nearest neighbor search appears to exist
Question
In Semantic Kernel v1.51.0 (with VectorData 9.x):
Where has the GetNearestMatchesAsync method been moved?
Which interface or class now exposes nearest-neighbor vector search for SqliteVectorStore collections?
Is there a new API (e.g., IVectorSearchCollection, IVectorQueryExecutor) that replaces this method?
If the API was refactored between 1.51.0-preview and 1.52.0-alpha, could you please point to the relevant example or PR?
Goal
I simply want to:
Generate embeddings using GoogleAIEmbeddingGenerator (models/embedding-001)
Store them in a local SQLite vector store
Perform semantic similarity search (kNN)
using Semantic Kernel’s built-in vector connectors.
Expected Behavior
_collection.GetNearestMatchesAsync() should return the top-N semantically similar text records.
Actual Behavior
Compilation fails — the method is no longer defined on IVectorStoreVectorCollection.
Beta Was this translation helpful? Give feedback.
All reactions