Description
It seems the langchain SelfQueryRetriever still generates the filters as per Weaviate Client v3. The filter follows the v3 format, which, for unknown reasons, changed in v4. This is the error: _HybridQueryAsync.hybrid() got an unexpected keyword argument ‘where_filter’.
Server Setup Information
- Weaviate Server Version: Weaviate Cloud
- Deployment Method: NA
- Multi Node? Number of Running Nodes: NA
- Client Language and Version:
- Multitenancy?: NA
Any additional Information
This is the error: _HybridQueryAsync.hybrid() got an unexpected keyword argument ‘where_filter’
Name: weaviate-client
Version: 4.14.1
Name: langchain
Version: 0.3.24
Hi!
I believe that this retriever is deprecated 
Here is the docs for the current integration, and here a recipe we have on how to use Weaviate with Langchain
Let me know if this helps!
Thanks!
Hi Duda,
Not sure why the SelfQueryRetriever should be obsolete. We use it with other vector stores, including Weaviate (Client v3) and the advantage is that it abstracts the underlying databases.
If not supported in Client v4, this is in fact may be due to LangChain not Weaviate, just let me know and I will add a custom retreiever just for Weaviate, whereas the other vectors DB we use will keep working fine with the SelfQueryRetriever.
hi @atolto-pirla !
I am sorry, I believe I mistaken the classes 
Actually, this is the deprecated one: WeaviateHybridSearchRetriever — 🦜🔗 LangChain documentation
This is considering that Weaviate python V3 client is definitely deprecated
So all integrations based on v3 client is now obsolete / deprecated.
Based on that recipe, let me know what you are attempting on doing, and I can try helping!
Thanks!
So, Langchain doesn’t support integrtion with Client v4, and it is not clear when (or if) it will be supported. The only solution is to stick with v3. Or to change database if one wants to keep the software generic, Pinecone, Chrome and various others are fully supported.
HI @DudaNogueira ,
Many thanks for following up. For clarity, although Langchain supports the client v4, their integration doesn’t. So, the choices are:
- Write your own integration - possible but will need to be maintained
- Wait for Langchain to release their integration
- Use alternatives
I think the breaking changes between v4 and v3 are causing some of us to move away from Weaviate, it is just not reassuring that, due to a client version change, existing users have to throw away existing working software and restart work, as if they had to start using a completely new product/database.
Regards
hi @atolto-pirla !
What do you mean on “their integration”? I am not sure I am following 
Can you provide some code or steps to reproduce? I would love to understand it more.
The breaking change from v3 to v4 was inevitable
however, the new client is way better now, both from performance and from a DX perspective.
Thanks!
Hi,
Essentially langchain generate a hybrid search syntax using v3 syntax: where_filter… which is not correct in version v4. So, one has to implement a custom integration for weaviate v4, when most other databases are supported by Langchain.
Additionally, the client v4 can be instantiated with legacy_constructor, presumably to support some v3 backward compatibility, but it does that only in part.
So, if one wants to run some trivial graphQL queries, the v3 calls won’t work, there is a new call to execute: client.graphql_raw_query(query), which however returns a wrapper, that has to be further parsed.
The full v4 client should work with client.graphql.raw(query) but I am concerned to see what happens when I try to parse the response.
Moving from v3 to v4 is causing so much trouble and wasted time that it may be quicker to change database vendor altogether…