Skip to main content
Version: 8.0

Vector Database

Robi AI uses a vector database to store documentation embeddings, which it uses as a knowledge base when answering questions about UAC. You must set up the vector database before installing the AI Service.

Robi AI supports PGVector, a PostgreSQL extension for vector similarity search.

Prerequisites​

Before setting up PGVector, ensure the following are in place:

  • PostgreSQL 17 installed and running
  • PGVector extension installed on the PostgreSQL server
  • A database created for the AI Service
  • A database user with permissions to create extensions, tables, and insert data
  • Network connectivity to the PostgreSQL server from both the machine running the SQL import and the machine that will run the AI Service

Installing PGVector​

Follow the PGVector installation guide to install the PGVector extension into your PostgreSQL instance.

The AI Service connects to the vector database using the following defaults:

Setting

Value

Table name

vector_store

Index name

HNSW

Distance Type

COSINE_DISTANCE

Dimensions

1536

Schema

public

warning

Do not change any of these values. The pre-computed documentation embeddings (below) rely on these settings.

Importing Documentation Embeddings​

Once PGVector is installed, import the pre-computed documentation embeddings provided by Stonebranch.

warning

The import will drop and recreate the vector_store table. Any existing data in the table will be lost.

  1. Download the provided SQL dump file, ai-{release}-{build}-vector_db_dump.sql.

  2. Run the following command to import the embeddings into your database:

    psql -h <HOST> -U <USER> -d <DATABASE> -f ai-{release}-{build}-vector_db_dump.sql

    Replace <HOST>, <USER>, and <DATABASE> with the appropriate values for your environment (for example, localhost, postgres, and ai_db).