Find answers from the community

Updated 3 months ago

How to Use Supabase VectorStore for Document Processing and Question Answering

At a glance

The community member is seeking help on how to use Supabase VectorStore to process documents and use the vector store to answer questions. They previously created table embeddings and used SQL similarity search within Supabase. The community members discuss the collection_name parameter and whether it refers to the embedding table. They also reference the Supabase VectorStore documentation and source code, but there is no explicitly marked answer.

Useful resources
hello devs, a bit lost with how to use Supabase VectorStore, i need to process the document once in the Upload, and then use the vector store to answer the questions. most of the examples didn't explain how can be done.
before i was creating table embeddings, and save the embedded document inside it and use sql similarity search inside Supabase.
L
m
5 comments
@Logan M what is collection_name? is it the embedding table i have which is look like this:
Plain Text
CREATE TABLE book_embeddings (
    id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, 
    title TEXT NOT NULL,                           
    author TEXT,                                   
    content TEXT,                                  
    embedding VECTOR(1536),                        
    metadata JSONB,                                
    created_at TIMESTAMP DEFAULT NOW()             
);

now all i need is to put the name of my table in collection_name ~?
Plain Text
vector_store = 
SupabaseVectorStore(
    postgres_connection_string=(
        "postgresql://:@:/"
    ),
    collection_name="book_empeddings",
)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_documents(
    documents, storage_context=storage_context
)

i am confused because even i write any other name in collection_name it still will work πŸ˜΅β€πŸ’«
I never use supabase, so all i can do is reference the notebook and code here lol
thank u logan yeah thats help a lot
Add a reply
Sign up and join the conversation on Discord