Need Help on VectorStore Retriever

#4
by akha96 - opened

My agent question always got below error with vector store:
{'message': 'JSON could not be generated', 'code': 405, 'hint': 'Refer to full message for details', 'details': "b''"}

I follow the similar other people vector integration:

build a retriever

embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
supabase: Client = create_client(
supabase_url=os.getenv("SUPABASE_URL"),
supabase_key=os.getenv("SUPABASE_SERVICE_KEY")
)
vector_store = SupabaseVectorStore(
client=supabase,
embedding=embeddings,
table_name="documents",
query_name="match_documents_langchain",
)
create_retriever_tool = create_retriever_tool(
retriever=vector_store.as_retriever(),
name="retriever",
description="A tool to retrieve relevant documents from a vector store.",
)

I also import "supabase_docs.csv" in supabase.

Anything I missed?

I think this issue likely stems from the match_documents_langchain function in Supabase. Make sure it’s defined, deployed, and handles vector similarity searches with JSON output that LangChain expects. Also, check that your documents table schema aligns with supabase_docs.csv, the vector column supports 768-dimensional embeddings from sentence-transformers/all-mpnet-base-v2, and your SUPABASE_SERVICE_KEY has proper permissions.

Thanks for reply. I didn't realize we need to define match_documents_langchain in Supabase. Let me explore it!

Did you ever figure it out?

Sign up or log in to comment