Supabase

Connect to Supabase to fetch or post information in a live database


Supabase is an open-source backend-as-a-service platform that provides a robust SQL database, real-time capabilities, and powerful authentication features. Data can be sent and received between Agentive and Supabase in two main ways:

Configuring your Prompt when Working with SQL DB's

Working with DB's can be difficult and ensuring your Agentive Prompt is optimized with certain instructions can go a long way.

Below are some Agentive Promopt Instructions we highly reccomend you use when working with SQL DB. Your Agentive Agent can retry a Tool multiple times, this however isn't optimal due to increased token usage and cost. Always aim to optimize you Agents to work first time.

## RETRY LOGGING
At the end of each response, mention the Retry log by stating what the first query was and any changes made in subsequent attempts.
### QUERY FORMATTING
When constructing queries to retrieve client information from the Supabase database, please follow these guidelines:

Case-Insensitive Like (ilike.):

Default Operator: Use ilike. as the default for matching names.
Wildcard %: % represents any sequence of characters.
Placement: Place % before and/or after the search term to match partial strings.
Example: ?name=ilike.%James%20O%
URL Encoding:

Do Not URL-Encode Operators: Operators like ilike. should remain as is.
URL-Encode Special Characters in Values:
Spaces: %20
Examples:
John Smith becomes John%20Smith
John S becomes John%20S
Handling No Results:

Retry with Less Specific Queries: If the initial query returns no results, retry with broader partial matches using ilike. and wildcards.

This Tool Requires Auth. Get your API Key & Project URL from Supabase Projects page

Example OpenAPI Schema Below:

Query Supabase DB
openapi: 3.1.0
info:
  title: Agentive Events API
  description: API for querying events in the agentive-events Supabase database. Users can filter results based on event name, date, time, genre, and venue.
  version: 1.0.0
servers:
  - url: https://{PROJECT_URL}.supabase.co/rest/v1
    description: Supabase API endpoint for the agentive-events project
paths:
  /events:
    get:
      operationId: getEvents
      summary: Query events from the database with optional filters.
      description: Retrieve a list of events, with optional filters for event name, date, time, genre, and venue.
      parameters:
        - name: event_name
          in: query
          required: false
          schema:
            type: string
          description: Filter events by event name.
        - name: date
          in: query
          required: false
          schema:
            type: string
            description: Filter events by a specific date (e.g., 2024.09.27).
        - name: time
          in: query
          required: false
          schema:
            type: string
            description: Filter events by a specific time (e.g., 10:05:30).
        - name: genre
          in: query
          required: false
          schema:
            type: string
          description: Filter events by genre.
        - name: venue
          in: query
          required: false
          schema:
            type: string
          description: Filter events by venue.
      responses:
        '200':
          description: A JSON array of event objects
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Event'
        '400':
          description: Invalid query parameters
        '401':
          description: Unauthorized
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: apikey
      in: header
      description: Supabase requires the API key to be passed in the `apikey` header
  schemas:
    Event:
      type: object
      properties:
        id:
          type: integer
        event_name:
          type: string
        date:
          type: string
        time:
          type: string
        genre:
          type: string
        venue:
          type: string
        description:
          type: string

Last updated