CommunityToolkit.VectorData.PgVector 1.0.1

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

CommunityToolkit.VectorData.PgVector

This connector uses Postgres to implement Semantic Memory. It requires the pgvector extension to be installed on Postgres to implement vector similarity search.

What is pgvector?

pgvector is an open-source vector similarity search engine for Postgres. It supports exact and approximate nearest neighbor search, L2 distance, inner product, and cosine distance.

How to install the pgvector extension, please refer to its documentation.

This extension is also available for Azure Database for PostgreSQL - Flexible Server and Azure Cosmos DB for PostgreSQL.

Quick start

  1. To install pgvector using Docker:
docker run -d --name postgres-pgvector -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword pgvector/pgvector
  1. Create a database and enable pgvector extension on this database
docker exec -it postgres-pgvector psql -U postgres

postgres=# CREATE DATABASE sk_demo;
postgres=# \c sk_demo
sk_demo=# CREATE EXTENSION vector;

Note, "Azure Cosmos DB for PostgreSQL" uses SELECT CREATE_EXTENSION('vector'); to enable the extension.

For more information, see the Microsoft.Extensions.VectorData documentation.

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.