Skip to main content
The PgvectorHandshake class provides seamless integration between Chonkie’s chunking system and PostgreSQL with pgvector. It uses the vecs client library from Supabase underneath to provide a higher-level API with automatic indexing, metadata filtering, and simplified connection management. Store your Chonkie chunks in PostgreSQL with vector embeddings and perform semantic search without ever leaving the Chonkie SDK.

Installation

Before using the Pgvector handshake, make sure to install the required dependencies:
You’ll also need PostgreSQL with the pgvector extension installed:

Initialization

Usage

Parameters

Optional[vecs.Client]
default:"None"
An existing vecs.Client instance. If provided, other connection parameters are ignored.
str
default:"localhost"
PostgreSQL host address.
int
default:"5432"
PostgreSQL port number.
str
default:"postgres"
PostgreSQL database name.
str
default:"postgres"
PostgreSQL username.
str
default:"postgres"
PostgreSQL password.
Optional[str]
default:"None"
Full PostgreSQL connection string. If provided, individual connection parameters are ignored.
str
default:"chonkie_chunks"
Name of the collection to store chunks in.
Union[str, BaseEmbeddings]
default:"minishlab/potion-retrieval-32M"
Embedding model to use. Can be a model name or a BaseEmbeddings instance.
Optional[int]
default:"None"
Number of dimensions for the vector embeddings. If not provided, will be inferred from the embedding model.