Ananke.Postgres 0.9.1

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

Ananke.Postgres

NuGet License

PostgreSQL provider for Ananke: PostgresKnowledgeStore (IKnowledgeStore) and PostgresKnowledgeCatalog (IKnowledgeCatalog), on pgvector for embedding search and Postgres full-text search for keywords. Experimental (ANNKEEXP004).

Install

dotnet add package Ananke.Postgres

Needs Postgres with the pgvector extension available. Quickest way:

docker run -p 5432:5432 -e POSTGRES_PASSWORD=postgres pgvector/pgvector:pg17

Quick start

#pragma warning disable ANNKEEXP004
using Ananke.Orchestration.Knowledge;
using Ananke.Postgres;
using Npgsql;

await using var dataSource = NpgsqlDataSource.Create("Host=localhost;Username=postgres;Password=postgres");
var store = new PostgresKnowledgeStore(dataSource, embedder, new PostgresKnowledgeOptions { Table = "docs_chunks" });

await store.UpsertAsync([new KnowledgeDocument { Id = "0001#0", Text = "Core.Identity is built on OpenIddict" }]);

var dense = await store.SearchAsync("token server library");
var keywords = await store.SearchAsync("OpenIddict", new SearchOptions { Mode = SearchMode.Sparse });
var both = await store.SearchAsync("Which library is Core.Identity built on?", new SearchOptions { Mode = SearchMode.Hybrid });
  • Search modes. Dense ranks by cosine distance (HNSW index). Sparse matches any of the query's words in a generated tsvector column (GIN index), ranked by ts_rank_cd. Hybrid fuses both by reciprocal rank.
  • Metadata is jsonb; a KnowledgeFilter matches rows whose metadata contains every key and value given.
  • Deletes remove rows. DeleteAsync with an empty filter empties the table.
  • One embedder per table. The table is stamped with the embedder's Identity and vector length in ananke_embedders; a store whose embedder differs is refused, naming both.
  • Created on first use: the vector extension, the table and its indexes. The role needs the rights to create them, or they must already exist.

Options

Option Default What it does
Table ananke_knowledge (ananke_catalog for the catalog) The table, optionally schema-qualified; lower-case letters, digits, underscores
TextSearchConfiguration simple How keyword search reads text: simple keeps words as they are; english stems them
Dimensions from the embedder The vectors' length, when the embedder's identity doesn't say
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
0.9.1 93 11/3/2026