Skip to content

Supabase Vector Store

Supabase Vector Store is a component that lets you store documents in a Supabase database and then search those documents using vector embeddings. It’s useful when you want to keep your data in a database you already use and still get fast, AI‑powered search results.

How it Works

When you add documents, the component converts each document into a vector using the embedding model you provide. These vectors are then saved in a Supabase table. Later, when you run a search, the component sends your query to Supabase, finds the most similar vectors, and returns the matching documents. All of this happens behind the scenes, so you only need to supply the data, the embedding model, and a few settings.

Operations

This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:

  • Add: Ingest documents into the Supabase vector store.
  • Search: Find documents that are most similar to a given query.
  • Retriever: Create a retriever object that can be used by other components to fetch relevant documents on demand.

To use the component, first select the operation you need in the “Operation” field.

Inputs

  • Credential: Select a previously configured Supabase API credential.

    • Visible in: Add, Search, Retriever
  • Embedding: The embedding model that turns text into vectors.

    • Visible in: Add, Search, Retriever
  • Ingest Data: The documents you want to add to the vector store.

    • Visible in: Add
  • Operation: Choose which operation to run (Add, Search, or Retriever).

    • Visible in: Add, Search, Retriever
  • Number of Results: Number of results to return when searching.

    • Visible in: Add, Search, Retriever
  • Query Name: Optional name for the query used in Supabase.

    • Visible in: Add, Search, Retriever
  • Search Query: Enter a search query. Leave empty to retrieve all documents.

    • Visible in: Search
  • Table Name: Name of the Supabase table where vectors are stored.

    • Visible in: Add, Search, Retriever

Important: Before using this component, you must first set up a Supabase API credential in Nappai’s credentials section. The credential requires a Supabase URL and a Supabase Service Key. Once the credential is created, select it in the “Credential” field above.

Outputs

  • Retriever: A retriever object that can be passed to other components to fetch relevant documents.
  • Results: A list of documents that match the search query.
  • Vector Store: The underlying Supabase vector store object, useful for advanced configurations.

Usage Example

Adding Documents

  1. Operation: Add
  2. Credential: Select your Supabase API credential.
  3. Embedding: Choose an embedding model (e.g., OpenAI embeddings).
  4. Ingest Data: Upload or paste the documents you want to store.
  5. Table Name: Enter the name of the table (e.g., my_documents).
  6. Click Run. The component will store the documents in Supabase.

Searching Documents

  1. Operation: Search
  2. Credential: Select your Supabase API credential.
  3. Embedding: Use the same embedding model as when adding.
  4. Search Query: Type a question or keyword.
  5. Number of Results: Set how many results you want (e.g., 4).
  6. Table Name: Enter the same table used for adding.
  7. Click Run. The component returns the top matching documents.
  • Pinecone Vector Store – Store and search vectors in Pinecone.
  • Weaviate Vector Store – Use Weaviate for vector storage and retrieval.
  • OpenAI Embeddings – Generate embeddings with OpenAI models.

Tips and Best Practices

  • Keep the number of results small (e.g., 4–10) to avoid overwhelming users.
  • Use the same embedding model for both adding and searching to ensure consistent vector space.
  • If you have many documents, consider batching the ingest operation to reduce API calls.
  • Store sensitive documents in a separate Supabase table with restricted access.

Security Considerations

  • The Supabase URL and Service Key are stored in a credential; never expose them in the UI.
  • Ensure the credential has the minimum permissions needed (e.g., read/write only on the specific table).
  • Use HTTPS when connecting to Supabase to protect data in transit.