|
1 | 1 | ## Vectorstores
|
2 |
| -PrivateGPT supports [Qdrant](https://qdrant.tech/) and [Chroma](https://www.trychroma.com/) as vectorstore providers. Qdrant being the default. |
| 2 | +PrivateGPT supports [Qdrant](https://qdrant.tech/), [Chroma](https://www.trychroma.com/) and [PGVector](https://github.com/pgvector/pgvector) as vectorstore providers. Qdrant being the default. |
3 | 3 |
|
4 |
| -In order to select one or the other, set the `vectorstore.database` property in the `settings.yaml` file to `qdrant` or `chroma`. |
| 4 | +In order to select one or the other, set the `vectorstore.database` property in the `settings.yaml` file to `qdrant`, `chroma` or `pgvector`. |
5 | 5 |
|
6 | 6 | ```yaml
|
7 | 7 | vectorstore:
|
@@ -47,4 +47,39 @@ To enable Chroma, set the `vectorstore.database` property in the `settings.yaml`
|
47 | 47 | poetry install --extras chroma
|
48 | 48 | ```
|
49 | 49 |
|
50 |
| -By default `chroma` will use a disk-based database stored in local_data_path / "chroma_db" (being local_data_path defined in settings.yaml) |
| 50 | +By default `chroma` will use a disk-based database stored in local_data_path / "chroma_db" (being local_data_path defined in settings.yaml) |
| 51 | + |
| 52 | +### PGVector |
| 53 | + |
| 54 | +To enable PGVector, set the `vectorstore.database` property in the `settings.yaml` file to `pgvector` and install the `pgvector` extra. |
| 55 | + |
| 56 | +```bash |
| 57 | +poetry install --extras pgvector |
| 58 | +``` |
| 59 | + |
| 60 | +PGVector settings can be configured by setting values to the `pgvector` property in the `settings.yaml` file. |
| 61 | + |
| 62 | +The available configuration options are: |
| 63 | +| Field | Description | |
| 64 | +|---------------|-----------------------------------------------------------| |
| 65 | +| **host** | The server hosting the Postgres database. Default is `localhost` | |
| 66 | +| **port** | The port on which the Postgres database is accessible. Default is `5432` | |
| 67 | +| **database** | The specific database to connect to. Default is `postgres` | |
| 68 | +| **user** | The username for database access. Default is `postgres` | |
| 69 | +| **password** | The password for database access. (Required) | |
| 70 | +| **embed_dim** | The dimensionality of the embedding model (Required) | |
| 71 | +| **schema_name** | The database schema to use. Default is `private_gpt` | |
| 72 | +| **table_name** | The database table to use. Default is `embeddings` | |
| 73 | + |
| 74 | +For example: |
| 75 | +```yaml |
| 76 | +pgvector: |
| 77 | + host: localhost |
| 78 | + port: 5432 |
| 79 | + database: postgres |
| 80 | + user: postgres |
| 81 | + password: <PASSWORD> |
| 82 | + embed_dim: 384 # 384 is for BAAI/bge-small-en-v1.5 |
| 83 | + schema_name: private_gpt |
| 84 | + table_name: embeddings |
| 85 | +``` |
0 commit comments