- exact and approximate nearest neighbor search,
- L2 distance, inner product, and cosine distance,
- any language with a Postgres client,
- ACID compliance, point-in-time recovery, JOINs, and all of the other great features of Postgres.
Connection
This handler usespgvector
Python library.
To connect to a PGVector instance, use the following statement:
host
: The host name or IP address of the postgres instance.port
: The port to use when connecting.database
: The database to connect to.user
: The user to connect as.password
: The password to use when connecting.distance
: It defines how the distance between vectors is calculated. Available methods include cosine (default), l1, l2, ip, hamming, jaccard. Learn more here.
Usage
Installing the pgvector extension
where you have postgres installed run the following commands to install the pgvector extensioncd /tmp git clone --branch v0.4.4 https://github.com/pgvector/pgvector.git cd pgvector make make install
Installing the pgvector python library
Ensure you install all from requirements.txt in the pgvector_handler folderCreating a database connection in MindsDB
You can create a database connection like you would for a regular postgres database, the only difference is that you need to specify the engine aspgvector