gaocegege / pgvecto.rs

Vector database plugin for Postgres, written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pgvectors

Postgres vector similarity search extension.

Development

Usage

cargo pgrx run
-- install the extension
DROP EXTENSION IF EXISTS vectors;
CREATE EXTENSION vectors;
-- check the extension related functions
\df+

-- call the distance function through operators

-- square Euclidean distance
SELECT array[1, 2, 3] <-> array[3, 2, 1];
-- dot product distance
SELECT array[1, 2, 3] <#> array[3, 2, 1];
-- cosine distance
SELECT array[1, 2, 3] <=> array[3, 2, 1];

About

Vector database plugin for Postgres, written in Rust

License:Apache License 2.0


Languages

Language:Rust 100.0%