[go: up one dir, main page]

Skip to main content

Enable Retool-managed Vectors on self-hosted deployments

Organizations with self-hosted Retool deployments must configure and enable Retool-managed Vectors before use.

Install dependencies

To use Retool-managed Vectors for self-hosted deployments:

  • Configure Retool Database on your self-hosted deployment.
  • Install pgvector, an open-source PostgreSQL extension for similarity search, in the same database cluster as Retool Database. Ensure your pgvector version is compatible with your PostgreSQL version.
  • If you're using Amazon RDS, you also need to run PostgreSQL 15.2 or later.

Make sure to use Retool Database (often the retooldb-postgres container), not the Retool storage database (often postgres). The storage database tracks app info, users, audit logs, etc. Retool Database is a PostgreSQL database you can use in apps and workflows, and has a UI for creating and editing tables.

Verify installation

Once you have enabled Retool Database and pgvector, you can start using Vectors.

To verify that pgvector is installed correctly and the role you are using for Retool Database can create tables, run the following SQL statement in a query:

CREATE TABLE sample_vector_table (id serial PRIMARY KEY, embedding vector(1536));

Configure environment variables

The following section is required only if your deployment is Self-hosted and you are using a Retool-managed AI model. If you are using a self-managed model, you can skip this section.

Configure environment variables

To enable Vectors on self-hosted deployments using a Retool-managed key, set the following environment variables.

Environment variableValue
LICENSE_KEYYour self-hosted Retool license key.
OPENAI_PROXY_HOSTSet to https://spb8yl7d3j.execute-api.us-west-2.amazonaws.com.
OPENAI_PROXY_API_TOKENContact your Retool account manager (or support@retool.com if you don't have an account manager) to generate a Retool-provided token.
OPENAI_SECRET_KEYSet to an empty string.

For OPENAI_PROXY_API_TOKEN, contact your Retool account manager (or support@retool.com if you don't have an account manager) to generate a Retool-provided token. Keys provided by Retool are subject to restrictive rate limits and are not suitable for production use cases. If the rate limiting is an issue, use your own key and set it from the Settings > AI resource page.

Error handling

If you are experiencing issues creating vectors, connect to Retool Database using the available connection strings.

  1. Click the next to Database.
  2. Click Connection and copy the connection string you want to use (PSQL or Postgres).
  3. Use the connection string to connect to the database created.
  4. Retry creating the Vector resource in Retool.