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
<PackageReference Include="ElBruno.Connectors.SqliteVec" Version="0.5.3" />
<PackageVersion Include="ElBruno.Connectors.SqliteVec" Version="0.5.3" />
<PackageReference Include="ElBruno.Connectors.SqliteVec" />
paket add ElBruno.Connectors.SqliteVec --version 0.5.3
#r "nuget: ElBruno.Connectors.SqliteVec, 0.5.3"
#:package ElBruno.Connectors.SqliteVec@0.5.3
#addin nuget:?package=ElBruno.Connectors.SqliteVec&version=0.5.3
#tool nuget:?package=ElBruno.Connectors.SqliteVec&version=0.5.3
ElBruno.Connectors.SqliteVec
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.SplitParagraphsfor 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
- 🐙 GitHub: github.com/elbruno - More cool projects and open-source contributions
- 📝 Blog: elbruno.com - Technical articles, tutorials, and insights
- 🎙️ Podcast: No Tiene Nombre - Spanish tech podcast
- 🎥 YouTube: youtube.com/elbruno - Video tutorials and demos
- 💼 LinkedIn: linkedin.com/in/elbruno - Professional updates and articles
- 🐦 Twitter/X: @elbruno - Quick tips and tech discussions
💡 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 | Versions 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. |
-
net10.0
- Microsoft.Data.Sqlite (>= 9.0.6)
- Microsoft.Extensions.AI.Abstractions (>= 9.6.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.6)
- Microsoft.Extensions.VectorData.Abstractions (>= 9.7.0)
- sqlite-vec (>= 0.1.7-alpha.2)
-
net9.0
- Microsoft.Data.Sqlite (>= 9.0.6)
- Microsoft.Extensions.AI.Abstractions (>= 9.6.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.6)
- Microsoft.Extensions.VectorData.Abstractions (>= 9.7.0)
- sqlite-vec (>= 0.1.7-alpha.2)
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 |