Iciclecreek.SemanticKernel.Connectors.Files
1.0.0
dotnet add package Iciclecreek.SemanticKernel.Connectors.Files --version 1.0.0
NuGet\Install-Package Iciclecreek.SemanticKernel.Connectors.Files -Version 1.0.0
<PackageReference Include="Iciclecreek.SemanticKernel.Connectors.Files" Version="1.0.0" />
<PackageVersion Include="Iciclecreek.SemanticKernel.Connectors.Files" Version="1.0.0" />
<PackageReference Include="Iciclecreek.SemanticKernel.Connectors.Files" />
paket add Iciclecreek.SemanticKernel.Connectors.Files --version 1.0.0
#r "nuget: Iciclecreek.SemanticKernel.Connectors.Files, 1.0.0"
#addin nuget:?package=Iciclecreek.SemanticKernel.Connectors.Files&version=1.0.0
#tool nuget:?package=Iciclecreek.SemanticKernel.Connectors.Files&version=1.0.0
Iciclecreek.SemanticKernel.Connectors.Files
This library defines a file based Vector Store provider for Microsoft.Extensions.VectorData
Details
This library defines FileVectoreStore which is a Vector Store provider that uses files to store the vectors and metadata.
FileVectorStore is a wrapper around InMemoryVectorStore, but with file persistance. It is useful for unit tests and local development, but probably not appropriate for large production work loads.
🚀 Getting Started with FileVectorStore
1. Install NuGet Packages
dotnet add package Microsoft.Extensions.VectorData.Abstractions
dotnet add package Iciclecreek.SemanticKernel.Connectors.Files
2. Define Your Data Model
using Microsoft.Extensions.VectorData;
public class Hotel
{
[VectorStoreKey]
public ulong HotelId { get; set; }
[VectorStoreData(IsIndexed = true)]
public string HotelName { get; set; }
[VectorStoreData(IsFullTextIndexed = true)]
public string Description { get; set; }
[VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.CosineSimilarity, IndexKind = IndexKind.Hnsw)]
public ReadOnlyMemory<float>? DescriptionEmbedding { get; set; }
[VectorStoreData(IsIndexed = true)]
public string[] Tags { get; set; }
}
3. Instantiate a FileVectorStore
using Microsoft.SemanticKernel.Connectors.Files;
// Create a FileVectorStore instance pointing to a local directory
var vectorStore = new FileVectorStore(new FileVectorStoreOptions()
{
Path = @"C:\\path\\to\\your\\vectorstore" // Specify your directory path here,
EmbeddingGenerator =...
});
// Get a collection for Hotel records
var collection = vectorStore.GetCollection<ulong, Hotel>("skhotels");
4. Create Collection and Add Records
// Ensure collection exists
await collection.EnsureCollectionExistsAsync();
// Add a record
ulong hotelId = 1;
string description = "A place where everyone can be happy.";
await collection.UpsertAsync(new Hotel
{
HotelId = hotelId,
HotelName = "Hotel Happy",
Description = description,
Tags = new[] { "luxury", "pool" }
});
// Retrieve the record
Hotel? retrieved = await collection.GetAsync(hotelId);
5. Perform a Vector Search
await foreach (var result in collection.SearchAsync("I'm looking for a hotel where customer happiness is the priority."))
{
Console.WriteLine($"Found hotel: {result.Record.Description}");
Console.WriteLine($"Score: {result.Score}");
}
Dependency Injection extensions
This library provides extension methods to register the FileVectorStore
with Microsoft.Extensions.DependencyInjection.
using Microsoft.Extensions.DependencyInjection;
using Microsoft.SemanticKernel.Connectors.Files;
// Register the FileVectorStore with DI
services.AddFileVectorStore(options =>
{
options.Path = @"C:\\path\\to\\your\\vectorstore"; // Specify your directory path here
options.EmbeddingGenerator = ...; // Provide your embedding generator here
});
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Microsoft.Extensions.AI.Abstractions (>= 9.6.0)
- Microsoft.Extensions.VectorData.Abstractions (>= 9.6.0)
- Microsoft.SemanticKernel.Connectors.InMemory (>= 1.59.0-preview)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 43 | 7/6/2025 |