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.
Installation
Firstly, you will need to install specific dependencies necessary for working with Postgres and PGVector:
pip install "cognee[postgres]"
# or for binary version
pip install "cognee[postgres-binary]"
Setup
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:
VECTOR_DB_PROVIDER=pgvector
VECTOR_DB_NAME=<your_db_name>
VECTOR_DB_URL=127.0.0.1
VECTOR_DB_PORT=5432
VECTOR_DB_USERNAME=<your_db_username>
VECTOR_DB_PASSWORD=<your_db_password>
For the server setup, you can use the one from the Cognee docker-compose.yml file, or your own:
docker compose --profile postgres up
Usage
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:
VECTOR_DATASET_DATABASE_HANDLER="pgvector"