-
Notifications
You must be signed in to change notification settings - Fork 16.1k
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: Add PebbloRetrievalQA chain with Identity & Semantic Enforcement support #20641
langchain: Add PebbloRetrievalQA chain with Identity & Semantic Enforcement support #20641
Conversation
Raj725
commented
Apr 19, 2024
•
edited
Loading
edited
- Description: PebbloRetrievalQA chain introduces identity enforcement using vector-db metadata filtering
- Dependencies: None
- Issue: None
- Documentation: Adding documentation for PebbloRetrievalQA chain in a separate PR(docs: Added providers page for Pebblo and docs for PebbloRetrievalQA #20746)
- Unit tests: New unit-tests added
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
5c8f120
to
190d2db
Compare
085e5b5
to
4118a2c
Compare
cc: @eyurtsev |
Hi @Raj725, could you move this into community? The name of the retriever isn't tied conceptually to what it does, but to Pebblo. Is it provider specific or is it meant to be generic? |
@eyurtsev snippet from libs/community/scripts/lint_imports.sh :
|
@eyurtsev We want to extend Chain, but "community" doesn't allow imports from "langchain". Can you please suggest an alternative approach? |
@Raj725 we're in the process of inverting the dependency between langchain and langchain-community (~2 weeks timeline) Why do you need to use
|
@Raj725 any chance you could provide a bit of context for what this code is supposed to do ? Why should it be merged it into langchain/langchain-community? |
Context: For more context, Pebblo is an opensource project for Data Visibility & Governance for LangChain apps(LinkedIn Post by Langchain). Both Pebblo Safe DocumentLoader and PebbloRetrievalQA work in tandem to add metadata tags on the loader with corresponding filters/enforcement on the retrieval side. Given that the Pebblo SafeLoader is already in langchain-community, our common customer base will be better served with the PebbloRetrievalQA chain, also in the same pkg. References: |
@eyurtsev Thanks for sharing the timeline. We can wait for dependency inversion.
We would like to offer a governance and security solution for our existing customers who are using legacy chain-based solutions. We are also exploring LCEL. |
b2ba9b3
to
54fff06
Compare
@eyurtsev It looks like dependency inversion is complete; the lint error is gone now. However, it's still throwing the following error in the import check. Can you please guide me on the right way to import "langchain" modules into "langchain-community"?
|
The dependency inversion will only happen for the 0.2 release of langchain -- still a few weeks away |
324c3ce
to
5974b99
Compare
@eyurtsev Could you please review this PR? All checks are passing now. |
3809e12
to
b48f1ee
Compare
b48f1ee
to
2860b9b
Compare
@@ -69,6 +69,7 @@ | |||
"RetrievalQAWithSourcesChain": "langchain.chains.qa_with_sources.retrieval", | |||
"VectorDBQAWithSourcesChain": "langchain.chains.qa_with_sources.vector_db", | |||
"create_retrieval_chain": "langchain.chains.retrieval", | |||
"PebbloRetrievalQA": "langchain.chains.pebblo_retrieval.base", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"PebbloRetrievalQA": "langchain.chains.pebblo_retrieval.base", |
if TYPE_CHECKING: | ||
from langchain_community.chains.pebblo_retrieval.base import PebbloRetrievalQA | ||
|
||
__all__ = ["PebbloRetrievalQA"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should use a hard-coded list of string literals otherwise some dev tools won't be able to pick it up
…c Enforcement support (#20641) - **Description:** PebbloRetrievalQA chain introduces identity enforcement using vector-db metadata filtering - **Dependencies:** None - **Issue:** None - **Documentation:** Adding documentation for PebbloRetrievalQA chain in a separate PR(#20746) - **Unit tests:** New unit-tests added --------- Co-authored-by: Eugene Yurtsev <[email protected]>