Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

langchain: enable weaviate v4 and its usage as self-query retriever #28442

Closed
wants to merge 23 commits into from

Conversation

xintoteai
Copy link
Contributor

@xintoteai xintoteai commented Dec 2, 2024

  • Weaviate v4 could not be used with SelfQueryRetriever. I added this capability in libs/langchain/retrievers/self_query/base.py, while adding a test_base.py script under libs/langchain/integration_tests/
  • I created docker-compose/weaviate.yml for the Weaviate V4 usage inside libs/langchain/tests/integration_tests
  • Issues with test_weaviate.py inside libs/commmunity/integration_tests: embedding_openai fixture was missing; certainty is almost 1 but can be off by a tiny amount. I updated them.
  • Added docs/docs/integrations/ example
  • (Almost) successfully ran make format, make lint and make test from the root of both libs/langchain and libs/community. There were still several test errors from the parts of the code base that I didn't touch.

Copy link

vercel bot commented Dec 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 8:55pm

@xintoteai xintoteai force-pushed the xintoteai/weaviate-v4 branch from 06a9385 to b51af9d Compare December 2, 2024 05:14
@xintoteai xintoteai changed the title langchain: enable weaviate v4 for self query retriever langchain: enable weaviate v4 and its usage as self-query retriever Dec 3, 2024
Copy link

vercel bot commented Dec 5, 2024

Deployment failed with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

@xintoteai xintoteai marked this pull request as ready for review December 5, 2024 17:39
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: retriever Related to retriever module labels Dec 5, 2024
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 9, 2024
@efriis
Copy link
Member

efriis commented Dec 10, 2024

hey there! Could you work with @hsm207 to put this where the weaviate team would like this (most likely in the https://github.com/langchain-ai/langchain-weaviate repo)

Once it's in, feel free to reopen with just the docs file change!

@efriis efriis closed this Dec 10, 2024
@xintoteai
Copy link
Contributor Author

I understand your point. However, what I've found is what is missing is not langchain-weaviate. Its stuff works. It is inside the langchain repo, where a critical import syntax is missing.

I screenshot this piece of code changes inside: libs/langchain/langchain/retrievers/self_query/base.py. Without such a change in important, the new weaviate v4 won't work for self query retriever - my main contribution to this repo. The rest of the PR is mainly to provide a test case inside the integration_tests/ directory.

Screenshot 2024-12-10 at 11 06 14 AM

@efriis
Copy link
Member

efriis commented Dec 10, 2024

Got it. This PR unfortunately wasn't mergable in its current state for a variety of reasons. feel free to put up a pr more like https://github.com/langchain-ai/langchain/pull/28292/files

In particular, please avoid adding any dependencies. You're welcome to skip the integration tests if @hsm207 confirms the implementation it's importing should work with the self query retriever here.

@xintoteai
Copy link
Contributor Author

I got your point. My takeaway:

  • I can supply a new but much smaller PR similar to your example.
  • I have or had no way to test the import it when I was trying to follow the langchain instructions. That is why I wrote those tests. Perhaps, I can constrain myself to submit only 1 test
  • Understand your point of not adding dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: retriever Related to retriever module size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants