# Implementation SD-9 - Enable pgvector extension if available

Project: Stream Smart Discovery
Status: review approved
URL: https://community.openproject.org/work_packages/SD-9

## OPEN POINTS

_No work packages_

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Designer |  |
| Developers | Joel Koch |

## Technical details

| Attribute | Value |
| --- | --- |
| Target versions |  |
| Module |  |
| Requires doc change | Yes |

## Belongs to

_No work packages_

## Previous chunks

_No work packages_

## Next chunks

_No work packages_

## Estimates

| Attribute | Value |
| --- | --- |
| Effort (shirt size) |  |
| Work |  |

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| % Complete |  |
| Category |  |
| Sprint |  |
| Backlog bucket |  |
| Priority | Medium |
| List |  |
| Pull preview |  |
| Labels |  |

## Description

Vector search is based on the [`pgvector` extension](https://github.com/pgvector/pgvector). As this is a third party extension we want to keep it optional and don&#x27;t let the upgrade fail when it&#x27;s not available. Instead we will disable features that depend on `pgvector` if it is not available.&nbsp;

## Documentation

*   document that OpenProject requires `pgvector` extension
    
    *   `pgvector` is not bundled with regular postgres but available on many hosted postgres providers
        
    *   `pgvector` must be available on postgres `search_path`, otherwise migrations/queries which uses its types will fail
        

## Deployment

*   update deployment artifacts to include `pgvector`
    
    *   package
        
    *   docker AIO (all-in-one)
        
    *   docker compose
        
    *   helm
        
*   update dev environment to include `pgvector`
    
    *   docker compose
        

## Implementation

We must first test whether the `pgvector` extension is available and store the result.

If `pgvector` is available:

*   enable pgvector extension, using `Extensions::Base`
    

if `pgvector` is not available:

*   show a warning during upgrade/migrations
    
*   disable all features that depend on `pgvector`
    
*   show a warning in the UI explain why features are not available
