Querying the Exisitng Cluster in Weavaite

We are working on creating a retriever to query data within the Weaviate cluster using the Langchain Framework.

Initially, we create embeddings for the documents and store them in Weaviate. However, processing them each time is time-consuming. It would be more efficient if we could create a retriever with the existing documents within the cluster.

Is there a way to achieve this?

hi @ksaimohan2k !! Welcome to our community! :hugs:

We have just the recipe for this:

TLDR: You can instantiate your Weaviate VectorStore in langchain like so:

embeddings = OpenAIEmbeddings()
db = WeaviateVectorStore.from_documents([], embeddings, client=client, index_name="WikipediaLangChain")

Note that on this recipe, we create the collection outside Langchain and specify a vectorizer. Now you can query your collection using Langchain or even directly.

Let me know if this helps!

Thanks!

1 Like

Thank You @DudaNogueira for your info, It worked.