1. Register an account for Supabase

  2. Click New project\

  1. Input required fields Name, name of the project to be created. (e.g. convosuite) Database Password, password to your postgres database. (e.g. click Generate a password)\

  1. Click Create new project and wait for the project to finish setting up

  2. Click SQL Editor\

  1. Click New query\

  1. Copy & Paste query and run it by Ctrl + Enter or click RUN Table name: documents Query name: match_documents

    -- Enable the pgvector extension to work with embedding vectors
    create extension vector;
    -- Create a table to store your documents
    create table documents (
      id bigserial primary key,
      content text, -- corresponds to Document.pageContent
      metadata jsonb, -- corresponds to Document.metadata
      embedding vector(1536) -- 1536 works for OpenAI embeddings, change if needed
    -- Create a function to search for documents
    create function match_documents (
      query_embedding vector(1536),
      match_count int DEFAULT null,
      filter jsonb DEFAULT '{}'
    ) returns table (
      id bigint,
      content text,
      metadata jsonb,
      similarity float
    language plpgsql
    as $$
    #variable_conflict use_column
      return query
        1 - (documents.embedding <=> query_embedding) as similarity
      from documents
      where metadata @> filter
      order by documents.embedding <=> query_embedding
      limit match_count;


  1. Click Project Settings\Project Setting

  2. Get your Project URL & API Key

  1. Document can be connect with any node under Document Loader category

  2. Embeddings can be connect with any node under Embeddings category


Last updated