Store web page text in Retool Vectors
Learn how to store web page text in a Retool-managed vector database for use with AI models.
You can use Retool Vectors to store and generate AI-related vector data for text from publicly accessible web pages. Retool then crawls the specified URLs and fetches the text content. Retool can then provide AI models with related information when performing AI actions.
Create URL Vector
You can create a URL Vector and add URLs for publicly accessible web pages manually or query the Retool Vectors resource in apps or workflows. You only need to specify a base URL, such as https://docs.retool.com
—Retool crawls the URL and fetches text for any pages at this location.
- Manually
- Using an app or workflow
- Navigate to the Resources settings and click Retool Vectors.
- Click Add Vector.
- Click Add URLs.
- Specify the web pages in the Links to crawl field.
Retool crawls the specified URLs and automatically fetches the text content and creates embeddings for each.
- Set Resource to Retool Vectors.
- Set Vector action to Create URL Vector.
- Specify a name for the vector Vector name.
- Specify the URL to include in the Urls field.
Refresh a URL vector
If the content of crawled web pages has changed, use the Refresh URL Vector action to crawl the URLs again. Retool updates existing embeddings with any new content and calculates new vector data automatically.
- Set Vector action to Refresh URL Vector.
- Specify the vector to refresh in the Vector field.
List all URLs in a vector
Use the List URLs action to retrieve a list of all crawled URLs within the specified vector.
- Set Vector action to List URLs.
- Specify the vector to refresh in the Vector field.
Get URL chunks
Use the List URLs action to get a list of URLs within a vector in a separate query. You can then reference a specific URL using {{ }}
notation, such as {{ listUrls.data[2] }}
.
Use the Get URL chunks action to retrieve the chunked text for a specified URL in a vector.
- Set Vector action to Get URL chunks.
- Specify the vector to use in the Vector field.
- Specify the URL for which to get chunks in the url name field.