Skip to content

SupabaseSQL Retriever

SupabaseSQL Retriever works with a table in your Supabase project: it stores rows, runs SQL queries and, if you connect an embeddings component, offers the table as a search-by-meaning engine.

When to use it

  • Storing in Supabase the data a flow produces.
  • Querying your Supabase data with a SQL query.
  • Giving an agent a search engine over a table’s texts.

Configuration

The Operation field decides what the component does: Add (default) stores the rows in Ingest Data; SQL runs the query in Search Query; Retriever offers the table as a search engine.

The component runs its SQL through a function called execute_any_sql(sql_query text) that must exist in your Supabase project (it runs the statement and returns the rows as JSON). Retriever searches the table in Table Name, filled with Add and the same Embedding.

You need a Supabase API credential with your Supabase project address and key. See Credentials.

FieldWhat it does
Credential (required)The Supabase API credential.
OperationWhat the component does.
Table Name (required)The database table.
Search QueryWith SQL, the query to run.
Ingest DataWith Add, the data to store.
EmbeddingConnector for an embeddings component, which converts texts so they can be searched by meaning.

Advanced options

FieldWhat it does
Drop TableDeletes the table, if it exists, before storing. Off by default.
Number Of ResultsHow many results the search engine returns. Default: 10.
Search Score ThresholdIf not 0, the search engine drops results that are not similar enough.

Output

The Data output holds the rows stored or the query result. Retriever is the search engine, to connect to components that ask for one. Database Info describes the table.

Example

A startup keeps its users’ ratings in Supabase.

  1. Add SupabaseSQL Retriever with the Supabase API credential and the ratings table.
  2. Choose SQL and type in Search Query SELECT * FROM ratings WHERE score <= 2.
  3. Pass Data to an agent that summarises the complaints.