[FEATURE] QA with Sources
Very nice UI!
Would be great if the VectorDB QA Chain node included the parameter returnSourceDocuments (i.e.: setting the returnSourceDocuments to true when calling the chain).
@beddows returnSourceDocuments allows you to get back the different Document chunks like this:
sourceDocuments: [
Document {
pageContent: 'somedoc..',
metadata: [Object]
},
]
Is that what you are expecting?
@HenryHengZJ Yes, that looks correct. The metadata can be used by the LLM summarizer to identify the sources of the chunks that are contributing to the final answer (and will provide the sources when prompted to do so).
@beddows do you mind to have a quick test to see if that satisfy your use cases?
In the line under this can you add chain.returnSourceDocuments = true?
My thought is that we'll have to use Output Parser if we want to see the specific source where the answer is from, not sure how to use the sourceDocuments array returned from returnSourceDocuments
@beddows do you mind to have a quick test to see if that satisfy your use cases?
In the line under this can you add
chain.returnSourceDocuments = true?
Hi Henry,
Langchain implementation of ectorDBQAWithSourcesChain is deprecated - It needed to be added in the RetrievalQA Chain
warnings.warn( "VectorDBQAWithSourcesChain is deprecated - " "please use `from langchain.chains import RetrievalQAWithSourcesChain
Perfect, this line then - https://github.com/FlowiseAI/Flowise/blob/main/packages/components/nodes/chains/RetrievalQAChain/RetrievalQAChain.ts#L43
Its now supported using ConversationalRetrievalQAChain - https://github.com/FlowiseAI/Flowise/pull/274