Replies: 3 comments
-
🤖 Hello @pi-curst! 👋 To achieve your goal of having the Retrieval QA return the exact documents used for answering a query, you can utilize the Here's how you can set it: const chain = RetrievalQAChain.fromLLM(model, vectorStore.asRetriever(), {
returnSourceDocuments: true, // Can also be passed into the constructor
}); In the response from the chain, the You can find more details in the examples/src/chains/retrieval_qa_sources_legacy.ts file. Also, it's worth noting that the I hope this helps! If you have any other questions or need further clarification, feel free to ask. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
How do we know which of those source documents that LLM extracted the answer from? Retrieval QA uses k documents which are semantically similar to generate the answer. The answer need not be in all the k documents, how do we know which documents out of the k documents the answer is extracted from? |
Beta Was this translation helpful? Give feedback.
-
Was there a solution found for the same? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm creating a QA bot with RAG and aiming to provide the specific documents from which the answers are extracted. While Retrieval QA retrieves all source documents via the retriever, it uses only a subset to answer a question. How can I extract these specific documents from Retrieval QA? Is there a method for achieving this?
Beta Was this translation helpful? Give feedback.
All reactions