Skip to content
New issue

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

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

Already on GitHub? # to your account

weaviate: Add-deprecation-warning #29757

Merged
merged 11 commits into from
Feb 17, 2025

Conversation

hsm207
Copy link
Contributor

@hsm207 hsm207 commented Feb 12, 2025

  • Description: add deprecation warning when using weaviate from langchain_community
  • Issue: NA
  • Dependencies: NA
  • Twitter handle: NA

Add deprecation warnings for weaviate related classes in the langchain_community package.

Users should be using langchain-ai/langchain-weaviate now.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/hsm207/langchain?shareId=XXXX-XXXX-XXXX-XXXX).
Signed-off-by: hsm207 <hsm207@users.noreply.github.com>
Signed-off-by: hsm207 <hsm207@users.noreply.github.com>
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 12, 2025
Copy link

vercel bot commented Feb 12, 2025

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Feb 17, 2025 2:36am

@dosubot dosubot bot added community Related to langchain-community Ɑ: vector store Related to vector store module labels Feb 12, 2025
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 12, 2025
DeprecationWarning,
stacklevel=2,
)


class WeaviateHybridSearchRetriever(BaseRetriever):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do replacements for WeaviateHybridSearchRetriever and WeaviateTranslator exist in langchain-weaviate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A replacement for WeaviateHybridSearchRetriever already exists in langchain-weaviate.

WeaviateTranslator has no replacement.

Before discussing migration, what’s the intended scope of WeaviateTranslator?

  • Just simple natural language (NL) queries?, or
  • Full support for every Weaviate search feature?

Weaviate has introduced many new query features over the years (multi-tenancy, named vectors, multi-target search). If WeaviateTranslator is meant to support everything, I'm not sure LLM-based structured query generation can reliably handle this. If it’s just for basic NL queries, we can scope an update accordingly.

Thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NL queries is likely fine. WeaviateTranslator is used to support LLM-generated filters and other structured queries (see docs here). I removed the warning on that module for now. If/when it's supported in langchain-weaviate we can deprecate it in community.

Copy link
Contributor Author

@hsm207 hsm207 Feb 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ccurme What's the expected behaviour if the user NL query can't be parsed correctly? For example:

This will work:

I want to watch a movie rated higher than 8.5

But this won't, because the translator does not support parsing multi tenancy-related terms, although I see the the prompt the LLM use could theoretically be tweaked to extract it from the natural language query:

I want to watch a movie rated higher than 8.5 in tenant A

Do we just pass the query to the vector db and let it throw an exception or are there some checks being done earlier?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detecting unsupported features and raising an exception is ideal.

Letting DB throw an exception is OK. My main concern is making sure that, if there are current users of self-query retriever with weaviate and we deprecate the community integration, we can give concrete instructions about what we recommend they do.

@ccurme ccurme self-assigned this Feb 13, 2025
hsm207 and others added 4 commits February 13, 2025 09:35
…triever

Signed-off-by: hsm207 <hsm207@users.noreply.github.com>
Signed-off-by: hsm207 <hsm207@users.noreply.github.com>
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Feb 17, 2025
@ccurme ccurme merged commit 037b129 into langchain-ai:master Feb 17, 2025
19 checks passed
@hsm207
Copy link
Contributor Author

hsm207 commented Feb 17, 2025

@ccurme thanks for the review. When's the next langchain-community release planned?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
community Related to langchain-community lgtm PR looks good. Use to confirm that a PR is ready for merging. size:S This PR changes 10-29 lines, ignoring generated files. Ɑ: vector store Related to vector store module
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants