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.
| Field | What it does |
|---|---|
| Credential (required) | The Supabase API credential. |
| Operation | What the component does. |
| Table Name (required) | The database table. |
| Search Query | With SQL, the query to run. |
| Ingest Data | With Add, the data to store. |
| Embedding | Connector for an embeddings component, which converts texts so they can be searched by meaning. |
Advanced options
| Field | What it does |
|---|---|
| Drop Table | Deletes the table, if it exists, before storing. Off by default. |
| Number Of Results | How many results the search engine returns. Default: 10. |
| Search Score Threshold | If 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.
- Add SupabaseSQL Retriever with the Supabase API credential and the
ratingstable. - Choose
SQLand type in Search QuerySELECT * FROM ratings WHERE score <= 2. - Pass Data to an agent that summarises the complaints.
Related components
- Supabase Vector Store: vector database in Supabase.