Nexttag.VectorStore.Pgvector
1.0.0
dotnet add package Nexttag.VectorStore.Pgvector --version 1.0.0
NuGet\Install-Package Nexttag.VectorStore.Pgvector -Version 1.0.0
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="Nexttag.VectorStore.Pgvector" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nexttag.VectorStore.Pgvector" Version="1.0.0" />
<PackageReference Include="Nexttag.VectorStore.Pgvector" />
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 Nexttag.VectorStore.Pgvector --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Nexttag.VectorStore.Pgvector, 1.0.0"
#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 Nexttag.VectorStore.Pgvector@1.0.0
#: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=Nexttag.VectorStore.Pgvector&version=1.0.0
#tool nuget:?package=Nexttag.VectorStore.Pgvector&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Nexttag.VectorStore.Pgvector
Implementação pgvector (PostgreSQL) de Nexttag.VectorStore (IVectorStore). Útil quando você já tem Postgres — evita rodar um banco vetorial separado. O NpgsqlDataSource é construído pelo host; o VectorFilter genérico vira WHERE em jsonb, parametrizado (sem injeção).
dotnet add package Nexttag.VectorStore.Pgvector
using Npgsql;
using Nexttag.VectorStore;
using Nexttag.VectorStore.Pgvector;
// Host constrói o data source — PRECISA habilitar o tipo vector:
var ds = new NpgsqlDataSourceBuilder("Host=...;Database=...").UseVector().Build();
IVectorStore store = new PgVectorStore(ds);
await store.EnsureCollectionAsync("documentos", 3072); // cria extensão + tabela
await store.UpsertAsync("documentos", pontos);
var hits = await store.SearchAsync("documentos", vetor, topK: 5,
filtro: VectorFilter.In("setor", setoresDoUsuario.Cast<object>().ToList()));
A partir daqui, todo o uso é via IVectorStore — veja o pacote base Nexttag.VectorStore.
Particularidades
- Pré-requisito: extensão
vectorno Postgres (oEnsureCollectionAsyncrodaCREATE EXTENSION IF NOT EXISTS vector— o usuário do banco precisa de permissão). - Obrigatório:
NpgsqlDataSourceBuilder(...).UseVector()no host (mapeia o tipovector). - Cada coleção é uma tabela
(id uuid, embedding vector(dim), payload jsonb). Dimensão fixa na criação. - Similaridade por cosseno (
<=>);score = 1 - distância. Para escala, crie um índice HNSW/IVFFlat comvector_cosine_ops. - Filtros (
Eq/In/And/Or) viramWHEREsobrepayload->>'campo'(texto), chave e valor parametrizados. DeleteAsyncexige filtro (nunca apaga a coleção inteira).
Licença: uso livre do binário; código-fonte proprietário da Nexttag (ver LICENSE.txt).
| 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
- Nexttag.VectorStore (>= 1.0.0)
- Npgsql (>= 9.0.3)
- Pgvector (>= 0.3.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.0 | 45 | 6/7/2026 |