Skip to main content

Retool-managed Vectors tutorial

Learn how to store and retrieve data for AI models using Retool's managed vector database.

Retool-managed Vectors is a hosted vector database that enables you to store unstructured text from documents and web pages for use with AI models through Retool. Retool abstracts away the complexities of preparing text and automatically generates the required data for AI models to make decisions using your data.

You can include related information from Retool-managed Vectors to provide more context. This allows you to instruct AI models to use your own data when making decisions, such as responding to a customer with context from support articles.

The following guide explains how to add text to Retool-managed Vectors and use it with the Generate text AI Action. To get started, navigate to the Resources tab in your organization and select Retool Vectors.

Each vector you create can contain either document text or URLs, not both.

1. Create a Vector

You can create two types of Vectors:

  • Document Vector: Store plain text that you enter manually or extract from uploaded PDF documents.
  • URL Vector: Store text fetched from publicly accessible web pages.

The following instructions cover both Vector types. To continue with this guide, create a URL Vector.

To create a Document Vector:

  1. Navigate to the Resources settings and click Retool Vectors.
  2. Click Add Vector.
  3. Specify a name and select Document.
  4. Click Create.

2. Add embeddings

Click Add document and select whether to upload a PDF file or add plain text manually. Retool extracts text from PDF documents automatically.

3. Use Retool-managed Vectors in AI Actions

You can include context from Retool-managed Vectors in apps and workflows using the Generate text and Generate chat response AI Actions. This step assumes you have created a URL Vector using https://docs.retool.com.

  1. Navigate to the Query Library tab and click + New.
  2. Set Resource to Retool AI.
  3. Select the Generate text action.
  4. Enter What is a resource? as the Input.
  5. Enable Use Retool Vectors to provide more context to your query and select the URL Vector you created.
  6. Click ▶︎ to run the query.

Retool automatically includes relevant context to the AI model from the specified Vector.

Wrap up

You have now created a new vector store using Retool-managed Vectors, added text content, and performed an AI Action with Vector context.