Enable Retool-managed Vectors on self-hosted deployments
Learn how to configure and enable Retool-managed Vectors for self-hosted Retool 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 variable | Value |
---|---|
LICENSE_KEY | Your self-hosted Retool license key. |
OPENAI_PROXY_HOST | Set to https://spb8yl7d3j.execute-api.us-west-2.amazonaws.com . |
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. |
OPENAI_SECRET_KEY | Set 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.
- Click the next to Database.
- Click Connection and copy the connection string you want to use (PSQL or Postgres).
- Use the connection string to connect to the database created.
- Retry creating the Vector resource in Retool.