ElBruno.Connectors.SqliteVec 0.5.3

dotnet add package ElBruno.Connectors.SqliteVec --version 0.5.3
                    
NuGet\Install-Package ElBruno.Connectors.SqliteVec -Version 0.5.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ElBruno.Connectors.SqliteVec" Version="0.5.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ElBruno.Connectors.SqliteVec" Version="0.5.3" />
                    
Directory.Packages.props
<PackageReference Include="ElBruno.Connectors.SqliteVec" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ElBruno.Connectors.SqliteVec --version 0.5.3
                    
#r "nuget: ElBruno.Connectors.SqliteVec, 0.5.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ElBruno.Connectors.SqliteVec@0.5.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ElBruno.Connectors.SqliteVec&version=0.5.3
                    
Install as a Cake Addin
#tool nuget:?package=ElBruno.Connectors.SqliteVec&version=0.5.3
                    
Install as a Cake Tool

ElBruno.Connectors.SqliteVec

NuGet NuGet Downloads Build Status License: MIT GitHub stars Twitter Follow

A MEAI-native VectorStoreCollection implementation for sqlite-vec, based on the original Semantic Kernel implementation. Store, query, and search vector embeddings using SQLite with full support for the Microsoft.Extensions.VectorData abstractions.

Features

  • VectorStoreCollection implementation — full CRUD + vector similarity search
  • Dependency injection — register collections with AddSqliteVecCollection<TKey, TRecord>
  • Attribute-based mapping — use [VectorStoreKey], [VectorStoreData], [VectorStoreVector]
  • Filtered retrieval — query records with LINQ-style expressions
  • Text splitting — built-in TextSplitter.SplitParagraphs for chunking documents
  • Optional embedding generation — works with IEmbeddingGenerator<string, Embedding<float>> or raw float vectors
  • Multi-target — supports .NET 9 and .NET 10

Installation

dotnet add package ElBruno.Connectors.SqliteVec

Quick Start

Define your record type

using Microsoft.Extensions.VectorData;

public class GlossaryEntry
{
    [VectorStoreKey]
    public string Key { get; set; } = string.Empty;

    [VectorStoreData]
    public string Term { get; set; } = string.Empty;

    [VectorStoreData]
    public string Definition { get; set; } = string.Empty;

    [VectorStoreVector(Dimensions: 4)]
    public ReadOnlyMemory<float> Embedding { get; set; }
}

Register and use the collection

using ElBruno.Connectors.SqliteVec;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.VectorData;

var services = new ServiceCollection();
services.AddSqliteVecCollection<string, GlossaryEntry>(
    collectionName: "glossary",
    connectionString: "Data Source=mydata.db");

var provider = services.BuildServiceProvider();
var collection = provider.GetRequiredService<VectorStoreCollection<string, GlossaryEntry>>();

// Create the collection
await collection.EnsureCollectionExistsAsync();

// Upsert a record
await collection.UpsertAsync(new GlossaryEntry
{
    Key = "1",
    Term = "Embedding",
    Definition = "A numerical representation of data in a vector space.",
    Embedding = new ReadOnlyMemory<float>([0.1f, 0.2f, 0.3f, 0.4f])
});

// Get by key
var entry = await collection.GetAsync("1");

// Vector similarity search
var query = new ReadOnlyMemory<float>([0.1f, 0.2f, 0.3f, 0.4f]);
await foreach (var result in collection.SearchAsync(query, top: 5))
{
    Console.WriteLine($"{result.Record.Term}: {result.Score:F4}");
}

Text splitting

using ElBruno.Connectors.SqliteVec;

var chunks = TextSplitter.SplitParagraphs(
    new[] { "Your long document text goes here..." },
    maxWordsPerChunk: 100);

API Reference

Type Description
SqliteVecVectorStoreCollection<TKey, TRecord> Core collection class — implements VectorStoreCollection<TKey, TRecord>
SqliteVecServiceCollectionExtensions DI extension method AddSqliteVecCollection
TextSplitter Static helper to split text into word-based chunks

Key Methods

Method Description
EnsureCollectionExistsAsync() Creates the SQLite table and vec virtual table
EnsureCollectionDeletedAsync() Drops the tables
UpsertAsync(record) Insert or replace a single record
UpsertAsync(records) Batch insert or replace (transactional)
GetAsync(key) Retrieve a record by key
GetAsync(filter, top) Retrieve records matching a filter expression
SearchAsync(vector, top) Vector similarity search
DeleteAsync(key) Delete a record by key

Samples

  • BasicSample — CRUD operations and vector search with raw float vectors
  • IntermediateSample — TextSplitter, multiple collections, filtered retrieval, and embedding generation

License

This project is licensed under the MIT License — see the LICENSE file for details.


👨‍💻 About the Author

Bruno Capuano (aka El Bruno) is a passionate developer, AI enthusiast, and content creator who loves building practical solutions and sharing knowledge with the community.

🌐 Connect & Explore

💡 Support This Project

If you find this library useful:

  • Star this repo on GitHub
  • 📢 Share it with your network
  • 🐛 Report issues or suggest features
  • 🤝 Contribute via pull requests

Happy coding! 🚀

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.5.3 80 2/28/2026
0.5.2 76 2/27/2026
0.5.1-preview 67 2/23/2026