This repository contains a Retool application that provides a frontend for searching a BigQuery database using both keyword search and semantic vector search.
newsletter_search_app.json: The exported Retool application (JSON).keyword_search.sql: The SQL query used for the keyword search functionality.vector_search.sql: The SQL query used for the vector search functionality.BIGQUERY_SETUP.md: Detailed instructions on how to set up the BigQuery database and Vector Search.
- Log in to your Retool account.
- On the Apps page, click Create new -> From JSON.
- Upload the
newsletter_search_app.jsonfile from this repository. - Name your app (e.g., "BigQuery Search").
- Click Create app.
The app requires a BigQuery resource to connect to your data.
- In Retool, go to Resources.
- Create a new BigQuery resource.
- Name the resource
YOUR_BIGQUERY_RESOURCE(or update the resource name in the app to match your created resource). - Configure the authentication (Service Account is recommended) to allow access to your Google Cloud Project.
- Important: Ensure the service account has permissions to run BigQuery jobs and access the dataset where your data and models reside.
- Open the imported app in Retool.
- You may see errors initially because the resource name or project IDs might not match.
- If you named your resource differently than
YOUR_BIGQUERY_RESOURCE, you will need to update the resource for each query (keywordSearch,vectorSearchQuery,paginationTestQuery,query1). - The SQL queries in the app contain placeholders
YOUR_PROJECT_IDandYOUR_DATASET_ID. You must replace these with your actual GCP Project ID and BigQuery Dataset ID.- Select the
keywordSearchquery and update the SQL. - Select the
vectorSearchQueryquery and update the SQL. - Select the
paginationTestQueryquery and update the SQL.
- Select the
- Keyword Search: Filters results based on text matches in title, summary, source, and various entity fields.
- Vector Search: Uses BigQuery's
ML.DISTANCEfunction to find semantically similar records based on embeddings.