Handler for connecting to a Postgres database with the PGVector extension, enabling multi-user mode on the Postgres database instance.
Make sure that ENABLE_BACKEND_ACCESS_CONTROL in your .env file is NOT set to False.
Multi-user mode is enabled by default, therefore ENABLE_BACKEND_ACCESS_CONTROL=True by default.
The PGVector adapter is one of Cognee’s core vector adapters, along with LanceDB. Even though PGVector is
an extension of Postgres, you can use PGVector as a vector store with other relational databases, such as SQLite.
You will need a running Postgres database instance, and the existing handler works with both local and cloud setups.
All you need to do is provide the necessary connection information, like the following example does for a local setup:
The PGVector handler is registered in Cognee by default, so all that is left to do is to let
Cognee know which handler you are using. This can be done by setting the following .env variable: