Find answers from the community

Updated 22 hours ago

How to Use Supabase VectorStore for Document Processing and Question Answering

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