Skip to content

Added docs for PebbloRetrievalQA chain #40

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

Closed
wants to merge 3 commits into from

Conversation

Raj725
Copy link
Collaborator

@Raj725 Raj725 commented May 21, 2024

  • Description: Added docs for PebbloRetrievalQA chain
  • Issue: NA
  • Dependencies: None
  • Unit tests: NA

@Raj725 Raj725 requested review from srics and rahul-trip May 21, 2024 05:30
Copy link

@rahul-trip rahul-trip left a comment

Choose a reason for hiding this comment

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

Please use your best judgement to cater these comments.

"metadata": {},
"outputs": [],
"source": [
"%pip install --upgrade --quiet langchain langchain-community langchain-openai qdrant_client"

Choose a reason for hiding this comment

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

remove %

"\n",
"**PebbloRetrievalQA chain supports the following vector databases:**\n",
"- Qdrant\n",
"- Pinecone\n",

Choose a reason for hiding this comment

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

Is pinecone fully supported? just checking.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes

Comment on lines 114 to 120
" \"pebblo_semantic_topics\": [\"financial-report\"],\n",
" \"pebblo_semantic_entities\": [\"us-bank-account-number\"],\n",

Choose a reason for hiding this comment

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

This should be updated?

Comment on lines 164 to 172
" llm=llm,\n",
" app_name=\"pebblo-identity-retriever-app\",\n",
" retriever=vectordb.as_retriever(),\n",
" verbose=True,\n",

Choose a reason for hiding this comment

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

owner, description should be added ?

"source": [
"auth = {\n",
" \"user_id\": \"[email protected]\",\n",
" \"authorized_identities\": [\n",

Choose a reason for hiding this comment

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

authorized_identities in AuthContext is renamed to user_auth

"> PebbloRetrievalQA is a Retrieval chain with Identity & Semantic Enforcement for question-answering\n",
"against a vector database.\n",
"\n",
"This notebook covers how to retrieve documents using Identity & Semantic Enforcement (Deny Topics/Entities).\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a sentence/link here such as "You can also visit for more details on Pebblo and its SafeRetriever feature"

link: https://daxa-ai.github.io/pebblo/retrieval_chain

"### Steps:\n",
"\n",
"1. **Loading Documents:**\n",
"We will load documents with authorization and semantic metadata into an in-memory Qdrant vectorstore. This vectorstore will be used as a retriever in PebbloRetrievalQA.\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a note here about using PebbloSafeLoader to load docs with auth & semantic metadata. We want to convey that this chain is best used with PebbloSafeLoader as the counterpart on the ingestion side.

"id": "33a8afe1-3071-4118-9714-a17cba809ee4",
"metadata": {},
"source": [
"### Using PromptTemplate to provide additional instructions\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add section number ...

Suggested change
"### Using PromptTemplate to provide additional instructions\n",
"### 3. Using PromptTemplate to provide additional instructions\n",

"source": [
"### 1. Without semantic enforcement\n",
"\n",
"Since no semantic enforcement is applied, the system should return the answer.\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"Since no semantic enforcement is applied, the system should return the answer.\n"
"Since no semantic enforcement is applied, the system should return the answer without excluding any context due to semantic labels associated with the context..\n"

@Raj725 Raj725 force-pushed the pebblo_retrieval_chain_docs branch 2 times, most recently from 734fa6e to a2bd828 Compare May 29, 2024 17:44
@Raj725 Raj725 force-pushed the pebblo_retrieval_chain_docs branch from a2bd828 to fc4c4bb Compare June 7, 2024 05:36
@Raj725 Raj725 force-pushed the pebblo_retrieval_chain_docs branch 2 times, most recently from 121e5e8 to 75bac79 Compare June 25, 2024 06:25
@Raj725 Raj725 force-pushed the pebblo_retrieval_chain_docs branch from 75bac79 to 1ab796b Compare June 25, 2024 06:36
@Raj725
Copy link
Collaborator Author

Raj725 commented Jun 26, 2024

Closing this PR as the code/docs changes are merged to Langchain master via langchain-ai#20746

@Raj725 Raj725 closed this Jun 26, 2024
@Raj725 Raj725 deleted the pebblo_retrieval_chain_docs branch June 26, 2024 07:51
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.

3 participants