Skip to content

Conversation

@BobMerkus
Copy link

Asynchronous support for WeaviateVectorStore

This PR adds adds an optional WeaviateAsyncClient to WeaviateVectorStore.client_async in order to fully support the asynchronous methods implemented by the base VectorStore.
Closes: #207

Description

There is no proper support for the asynchronous methods on the WeaviateVectorStore, as mentioned in Async client support #207 . The VectorStore currently uses the run_in_executor langchain utility on all the synchronous methods of the WeaviateVectorStore, leading to a lot of resource warnings when used inside async context. This implementation should solve these issues and lead to overall efficiency improvements when used inside async context. The async tests run about 2x as fast compared to the original tests (48s vs. 23s for me), even though there are more of them.

I've attempted to implement this with backwards compatibility, so when no client_async is passed along the default client, the methods still call the synchronous methods in the same way the base vector store currently does. Overall the test coverage has been increased to 98.66% through mocking and error asserts.

Please let me know if any changes are required, there still seems to be some room for improvements regarding shared logic between the sync/async implementation. Another approach would be to support client: WeaviateClient | WeaviateAsyncClient and decide which implementation to use based on the type of client supplied. I took a brief look at this, but it requires a lot of refactoring of the current implementation. This approach will arguably result in cleaner and more efficient code as it avoids the need to pass a sync client along with the async client.

@BobMerkus
Copy link
Author

@hsm207 Could you take a look at this?

@a1ekseev
Copy link

@BobMerkus There are conflicts that need to be resolved.

@hsm207
Copy link
Collaborator

hsm207 commented Jun 18, 2025

Hey @BobMerkus,

Appreciate the contribution!

Just FYI, I’m not with Weaviate anymore so I have zero say on this integration these days. Honestly, I don’t even know who’s running the show or what the maintenance policy is for this integration now.

You’ll probably get a quicker answer if you ping the Weaviate community manager in the Weaviate Community Slack channel.

Good luck! 🚀

@BobMerkus BobMerkus force-pushed the feat/async-weaviate branch from adf54bd to 1c238cf Compare June 19, 2025 13:58
@BobMerkus
Copy link
Author

@BobMerkus There are conflicts that need to be resolved.

Have rebased the branch, should be fixed now

@BobMerkus
Copy link
Author

Hey @BobMerkus,

Appreciate the contribution!

Just FYI, I’m not with Weaviate anymore so I have zero say on this integration these days. Honestly, I don’t even know who’s running the show or what the maintenance policy is for this integration now.

You’ll probably get a quicker answer if you ping the Weaviate community manager in the Weaviate Community Slack channel.

Good luck! 🚀

Hi @hsm207,

Thanks for your response! No worries, this is not really a priority to me but it seems like a nice feature to support. Thanks for the suggestion, I'll check the Weaviate Community Slack channel.

Good luck to you as well 👾

@DhruvGorasiya
Copy link

@BobMerkus Thanks for the contribution! Could you please update your branch with the latest changes from main so that the checks can run and we can proceed with the review?

@BobMerkus BobMerkus force-pushed the feat/async-weaviate branch from 1c238cf to 1937973 Compare August 26, 2025 13:05
@BobMerkus
Copy link
Author

@BobMerkus Thanks for the contribution! Could you please update your branch with the latest changes from main so that the checks can run and we can proceed with the review?

@DhruvGorasiya I have rebased the branch, should be ready for CI checks now. Please let me know if any changes are required.

@BobMerkus BobMerkus force-pushed the feat/async-weaviate branch from 1937973 to 2f477a6 Compare November 5, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Async client support

4 participants