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
<PackageReference Include="Sylin.Koan.Data.Vector.Connector.PgVector" Version="1.0.92" />
<PackageVersion Include="Sylin.Koan.Data.Vector.Connector.PgVector" Version="1.0.92" />
<PackageReference Include="Sylin.Koan.Data.Vector.Connector.PgVector" />
paket add Sylin.Koan.Data.Vector.Connector.PgVector --version 1.0.92
#r "nuget: Sylin.Koan.Data.Vector.Connector.PgVector, 1.0.92"
#:package Sylin.Koan.Data.Vector.Connector.PgVector@1.0.92
#addin nuget:?package=Sylin.Koan.Data.Vector.Connector.PgVector&version=1.0.92
#tool nuget:?package=Sylin.Koan.Data.Vector.Connector.PgVector&version=1.0.92
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.
Usage: save and search
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
_vectoranchor 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 | 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. |
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.10)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.10)
- Microsoft.Extensions.Configuration.Json (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Hosting (>= 10.0.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Console (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.10)
- Newtonsoft.Json (>= 13.0.4)
- Npgsql (>= 10.0.3)
- Sylin.Koan.Core (>= 1.0.39 && < 2.0.0)
- Sylin.Koan.Data.Abstractions (>= 1.0.41 && < 2.0.0)
- Sylin.Koan.Data.Core (>= 1.0.73 && < 2.0.0)
- Sylin.Koan.Data.Vector (>= 1.0.49 && < 2.0.0)
- Sylin.Koan.Data.Vector.Abstractions (>= 1.0.33 && < 2.0.0)
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 |