pgvector is an open-source vector similarity search extension for Postgres. After connecting to Postgres, runDocumentation Index
Fetch the complete documentation index at: https://docs.mem0.ai/llms.txt
Use this file to discover all available pages before exploring further.
CREATE EXTENSION IF NOT EXISTS vector; to create the vector extension.
Usage
Config
Here are the parameters available for configuring pgvector:| Parameter | Description | Default Value |
|---|---|---|
dbname | The name of the database | postgres |
collection_name | The name of the collection | mem0 |
embedding_model_dims | Dimensions of the embedding model | 1536 |
user | User name to connect to the database | None |
password | Password to connect to the database | None |
host | The host where the Postgres server is running | None |
port | The port where the Postgres server is running | None |
diskann | Whether to use diskann for vector similarity search (requires pgvectorscale) | True |
hnsw | Whether to use hnsw for vector similarity search | False |
sslmode | SSL mode for PostgreSQL connection (e.g., ‘require’, ‘prefer’, ‘disable’) | None |
connection_string | PostgreSQL connection string (overrides individual connection parameters) | None |
connection_pool | psycopg2 connection pool object (overrides connection string and individual parameters) | None |
dbname, the TypeScript client uses the database name vector_store. Python defaults to postgres for dbname, as in the table above.
Note: The connection parameters have the following priority:
connection_pool(highest priority)connection_string- Individual connection parameters (
user,password,host,port,sslmode)