Skip to content

Conversation

@SaxonF
Copy link
Contributor

@SaxonF SaxonF commented Apr 28, 2025

What kind of change does this PR introduce?

  • Updates the Assistant to use the Supabase MCP as a library
  • Updates AI SDK
  • Updates to use Bedrock with Sonnet 4
  • Updates to system prompt to temporarily include condensed version of old RLS and Edge Function knowledge. In future, we may re-introduce knowledge retrieval tools to MCP

There is a side effect of this change. The MCP supports running queries directly then reading and interpreting the results. This is different to the current behaviour where all queries are run outside the context of the Assistant (QueryBlock runs the query and renders results). This creates a couple of challenges:

  • Ideally the results that are run do not need to be output by the model and can instead just be referenced. This is why we are wrapping the execute_sql tool to include a unique id with results that the model can include when calling displayBlock tool. We use this ID to retrieve results on the front-end.
  • We are now sending not just schema information to OpenAI but also actual data. We are currently looking in to the best way to handle this from a privacy perspective to make sure the user has full control and visibility over what happens with their data. We cannot merge this PR until we have a solution.

What is the current behavior?

Uses tools built in in Studio

What is the new behavior?

Uses Supabase MCP

How to test

  1. Set up AWS ENV variables

    AWS_REGION=us-east-1
    AWS_PROFILE=supabase-dev
  2. Switch to infra PR

  3. Open Assistant and test:

    • Make sure old chats still work and charts are still visible
    • Listing tables
    • Performing a read query and notice results shown in chat
    • Ask the Assistant to interpret the results
    • Ask to create a write query (e.g. create a table) and notice query needs to be run manually
    • Ask to create an edge function
    • Ask to create RLS policies
    • Open SQL editor and use the inline assistant

Other questions

  • Do we need to remove OpenAI from title generation and old sql debugging?

Infrastructure

This work requires adding a tag to API via https://github.com/supabase/infrastructure/pull/22828

@vercel
Copy link

vercel bot commented Apr 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
studio-self-hosted ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2025 3:28am
studio-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2025 3:28am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cms ⬜️ Ignored (Inspect) Jun 26, 2025 3:28am
studio ⬜️ Ignored (Inspect) Visit Preview Jun 26, 2025 3:28am
design-system ⬜️ Skipped (Inspect) Jun 26, 2025 3:28am
docs ⬜️ Skipped (Inspect) Jun 26, 2025 3:28am
ui-library ⬜️ Skipped (Inspect) Jun 26, 2025 3:28am
zone-www-dot-com ⬜️ Skipped (Inspect) Jun 26, 2025 3:28am

@supabase
Copy link

supabase bot commented Apr 28, 2025

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel vercel bot temporarily deployed to Preview – design-system April 28, 2025 04:10 Inactive
@vercel vercel bot temporarily deployed to Preview – zone-www-dot-com April 28, 2025 04:10 Inactive
@vercel vercel bot temporarily deployed to Preview – ui-library April 28, 2025 04:10 Inactive
@vercel vercel bot temporarily deployed to Preview – docs April 28, 2025 04:10 Inactive
@vercel vercel bot temporarily deployed to Preview – ui-library April 28, 2025 05:44 Inactive
@vercel vercel bot temporarily deployed to Preview – design-system April 28, 2025 05:44 Inactive
@vercel vercel bot temporarily deployed to Preview – docs April 28, 2025 05:44 Inactive
@vercel vercel bot temporarily deployed to Preview – zone-www-dot-com April 28, 2025 05:44 Inactive
@joshenlim joshenlim merged commit 3a50dd1 into master Jun 26, 2025
20 of 27 checks passed
@joshenlim joshenlim deleted the feature/assistant-mcp branch June 26, 2025 04:13
joshenlim added a commit that referenced this pull request Jun 26, 2025
joshenlim added a commit that referenced this pull request Jun 26, 2025
Revert "Feature/assistant mcp (#35318)"

This reverts commit 3a50dd1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants