Sharc.Vector
1.2.80
dotnet add package Sharc.Vector --version 1.2.80
NuGet\Install-Package Sharc.Vector -Version 1.2.80
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="Sharc.Vector" Version="1.2.80" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sharc.Vector" Version="1.2.80" />
<PackageReference Include="Sharc.Vector" />
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 Sharc.Vector --version 1.2.80
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sharc.Vector, 1.2.80"
#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 Sharc.Vector@1.2.80
#: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=Sharc.Vector&version=1.2.80
#tool nuget:?package=Sharc.Vector&version=1.2.80
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sharc.Vector
SIMD-accelerated vector similarity search for Sharc.
Features
- Zero-copy BLOB decode:
MemoryMarshal.Cast<byte, float>directly on cached page buffers - SIMD distance: Cosine, Euclidean, and Dot Product via
TensorPrimitives(AVX-512 when available) - Top-K nearest neighbor: Fixed-capacity heap selection
- Metadata pre-filtering: Apply WHERE filters before distance computation
- JitQuery integration: Reuses Sharc's pre-compiled query handles
Quick Start
using Sharc;
using Sharc.Vector;
using var db = SharcDatabase.Open("knowledge.db");
// Create a reusable vector search handle
using var vq = db.Vector("documents", "embedding", DistanceMetric.Cosine);
// Optional: metadata pre-filter (applied before distance computation)
vq.Where(FilterStar.Column("category").Eq("science"));
// Find the 10 nearest neighbors
float[] queryVector = GetEmbedding("How do quantum computers work?");
var results = vq.NearestTo(queryVector, k: 10);
foreach (var match in results.Matches)
Console.WriteLine($"Row {match.RowId}: distance={match.Distance:F4}");
Store Vectors
Vectors are stored as BLOB columns in regular SQLite tables:
byte[] vectorBlob = BlobVectorCodec.Encode(embeddingModel.Encode("Hello world"));
// Store vectorBlob as a BLOB column value via SharcWriter
Performance
| Operation | Allocation | Notes |
|---|---|---|
| Per-row distance | 0 B | Zero-copy BLOB → float reinterpret |
| 10K vectors (384-dim) | ~5-10 ms | TensorPrimitives SIMD |
| 100K vectors (384-dim) | ~50-100 ms | Linear scan baseline |
Requirements
- .NET 8.0+
System.Numerics.Tensors(included automatically)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
-
net10.0
- Sharc (>= 1.2.80)
- Sharc.Core (>= 1.2.80)
- System.Numerics.Tensors (>= 9.0.3)
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.2.80 | 83 | 2/27/2026 |
| 1.2.77 | 95 | 2/26/2026 |
| 1.2.65 | 81 | 2/26/2026 |
| 1.2.59 | 85 | 2/25/2026 |
| 1.1.2-beta | 78 | 2/24/2026 |