• MATCH
  • DRIFT
  • DATA
  • HUMAN

How to debug RAG similarity search with your AI

Connect Supabase Vector to your AI client to inspect how embeddings drive your search results.

Ask AI about this page

Short answer

How can I debug RAG similarity search with my AI?

Your AI identifies the closest vector matches and then pulls the corresponding row data to check the actual text. This lets you see if the math is pulling the right context. You'll get a clear view of why certain documents are surfacing.

Debugging outcomes.

Where your insights land.

The AI translates vector math into readable data.

MATCH

Identify top hits

The AI finds the most relevant rows using vector distance. You see exactly which chunks are surfacing for a specific query.

DRIFT

Spot embedding drift

Compare the query vector against stored embeddings. This helps you see if your model is drifting from your actual data.

DATA

Inspect raw content

The AI pulls the text associated with specific vector IDs. You can verify if the retrieved text actually contains the info you need.

HUMAN

Manual tuning

The AI flags problematic vectors that need re-indexing. You decide when to update your model or clean your database.

The workflow

What your AI does when the query arrives.

The AI moves from mathematical matching to data inspection.

  1. Find similar vectors

    The AI calculates which embeddings in your database are closest to your input text.

    match_vectors
  2. Fetch matching rows

    The AI pulls the specific rows that the vector search identified as relevant.

    query_table_rows
  3. Deep dive into content

    The AI looks at a single specific row to check the exact metadata or text content.

    get_table_row
  4. Analyze results

    The AI compares the retrieved text against your original question to find mismatches.

    query_table_rows

Try it

Copy these to start.

Use these prompts to begin your debugging session.

Starting points

Swap out the table and column names for your own Supabase schema.

Supabase Vector Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_r2cwX4M1GouGmm6VnqY7CUQyTiHKovu2fp0L81jN/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Supabase Vector capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "supabase-vector-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_r2cwX4M1GouGmm6VnqY7CUQyTiHKovu2fp0L81jN/mcp"
    }
  }
}
Copy into chat04
  • Find the top 5 rows in my 'documents' table that match this query: 'How do I reset my password?'

  • Compare the embedding of this query to the vectors in my 'embeddings' table and tell me why the distance is so high.

  • Get the content for the row with ID 452 to see if the text matches the vector representation.

  • Query the 'knowledge_base' table for all rows that have a similarity score above 0.8 for my current search.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Supabase Vector once, then ask.

Provide your Supabase credentials to get started. The connection is encrypted, and you can start debugging immediately in your preferred AI client.

Connect Supabase Vector to your AI

FAQ

How this task behaves.

  • 01

    Can the AI change my vector embeddings?

    No. The AI can only read and query existing data. It cannot modify or delete your embeddings.

  • 02

    Can the AI create new tables in Supabase?

    No. The AI is limited to the tools provided, which are for querying and matching existing data.

  • 03

    How does it handle large datasets?

    The AI uses the vector matching tool to filter the dataset down to the most relevant rows before inspecting them.

  • 04

    Do I need to provide the vector math?

    No. Your AI client uses the match tool to handle the similarity calculation.

  • 05

    Can the AI fix a bad embedding?

    No. The AI can identify which embeddings are poor matches, but you must perform the actual re-indexing or updates yourself.

  • More questions about Supabase Vector? The Connector page answers them. See everything the Supabase Vector Connector can do

Connect Supabase Vector to Claude, Cursor, ChatGPT & more