Sylin.Koan.Data.Vector.Connector.PgVector 1.0.92

dotnet add package Sylin.Koan.Data.Vector.Connector.PgVector --version 1.0.92
                    
NuGet\Install-Package Sylin.Koan.Data.Vector.Connector.PgVector -Version 1.0.92
                    
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="Sylin.Koan.Data.Vector.Connector.PgVector" Version="1.0.92" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sylin.Koan.Data.Vector.Connector.PgVector" Version="1.0.92" />
                    
Directory.Packages.props
<PackageReference Include="Sylin.Koan.Data.Vector.Connector.PgVector" />
                    
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 Sylin.Koan.Data.Vector.Connector.PgVector --version 1.0.92
                    
#r "nuget: Sylin.Koan.Data.Vector.Connector.PgVector, 1.0.92"
                    
#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 Sylin.Koan.Data.Vector.Connector.PgVector@1.0.92
                    
#: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=Sylin.Koan.Data.Vector.Connector.PgVector&version=1.0.92
                    
Install as a Cake Addin
#tool nuget:?package=Sylin.Koan.Data.Vector.Connector.PgVector&version=1.0.92
                    
Install as a Cake Tool

Sylin.Koan.Data.Vector.Connector.PgVector

Use PostgreSQL's vector extension through Koan's Entity-first vector API. An application that already operates PostgreSQL can add semantic search without adopting another data service.

Declare the space

dotnet add package Sylin.Koan.Data.Vector.Connector.PgVector
public sealed class Article : Entity<Article>;

services.AddKoan(koan => koan.Data
    .Source("Search")
    .Vector<Article>(space => space
        .Name("content")
        .Dimensions(1536)
        .Metric(VectorMetric.Cosine)
        .Visibility(VectorVisibility.Session)));

Reference the package, call AddKoan() once, and use the ordinary Vector<TEntity> operations. No PostgreSQL client, table bootstrap, or provider registration belongs in application code.

await Vector<Article>.Save(article.Id, embedding, new
{
    article.Category,
    article.Language
});

var matches = await Vector<Article>.Search(embedding, query => query
    .Top(12)
    .Where(Filter.All(
        Filter.Eq("Category", "support"),
        Filter.In("Language", ["en", "fr"]))));

Awaited saves and deletes are visible immediately in Session mode. Similarity is normalized to [0,1], where larger always means closer, for cosine, Euclidean, and dot-product spaces.

Configure placement

PgVector honors source-specific placement. A source declared as postgres/postgresql/npgsql reuses that PostgreSQL route directly; a PgVector-owned source honors its own connection before falling back to the selected PostgreSQL record placement:

{
  "Koan": {
    "Data": {
      "PgVector": {
        "ConnectionString": "Host=localhost;Port=5432;Database=Koan;Username=postgres;Password=use-a-secret-provider"
      }
    }
  }
}

The PostgreSQL server must make the vector extension available. Managed sources enable it idempotently; a role that cannot do so receives a corrective error naming the administrator command. Source-specific placement and standard Access or StorageLifecycle policy use Koan:Data:Sources:{name}.

Guarantees and limits

  • Managed writes create a missing table and validate every existing table against the immutable space dimensions, metric, model, and name. Reads never create storage.
  • Exact SQL search uses pgvector's native distance operators and native JSONB metadata prefilters.
  • Neutral metadata round-trips losslessly; a separate JSONB projection preserves filter semantics.
  • Vector tables use a deterministic _vector anchor suffix, so the record and vector planes can share one PostgreSQL database for the same Entity without colliding.
  • Source, partition, and row scopes protect reads and mutations. Clear removes only the active scope and keeps shape.
  • Batches use one set-based PostgreSQL statement, preserve ordered per-item outcomes, and conservatively report BatchAtomicity.NotGuaranteed.
  • Eventual visibility, hybrid search, continuations, streaming export, multiple vectors per Entity, and atomic batches are declined explicitly.

PgVectorOptions bounds command duration, metadata bytes, batch points, and search rows. See TECHNICAL.md for native shape and failure semantics.

Product 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.

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.92 156 9/13/2026
1.0.89 113 9/12/2026
1.0.86 110 9/12/2026
1.0.84 110 9/10/2026
1.0.80 107 9/10/2026
1.0.76 111 9/9/2026
1.0.72 107 9/9/2026
1.0.69 113 9/9/2026
1.0.64 110 9/9/2026
1.0.62 113 9/9/2026
1.0.57 108 9/5/2026
1.0.56 136 8/30/2026
1.0.54 106 8/30/2026
1.0.53 109 8/28/2026
1.0.52 103 8/28/2026
1.0.51 121 8/28/2026
1.0.50 100 8/28/2026
1.0.49 109 8/28/2026
1.0.48 115 8/27/2026
1.0.43 126 8/25/2026
Loading failed