Skip to content
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

Example of RAG with link to reference or source/context also returned? #3

Open
asmith26 opened this issue Feb 14, 2024 · 8 comments
Open
Labels
enhancement New feature or request

Comments

@asmith26
Copy link

asmith26 commented Feb 14, 2024

Hi, just wondering do you have any examples of using PhiData with RAG where a link/context is also returned, possibly something like:

image

Thanks for any help!

@asmith26 asmith26 changed the title Examples RAG with link to reference/source? Examples RAG with link to reference/source/context? Feb 14, 2024
@asmith26 asmith26 changed the title Examples RAG with link to reference/source/context? Example of RAG with link to reference or source/context also returned? Feb 14, 2024
@ashpreetbedi
Copy link
Contributor

@asmith26 yes 100% -- we store all the metadata in the knowledge base so its easy to build. Give me a week to get that setup?

@ashpreetbedi ashpreetbedi added the enhancement New feature or request label Feb 15, 2024
@asmith26
Copy link
Author

Hi @ashpreetbedi, just thought I'd ask if you have been able to make any progress on this - of course no worries if not, and thanks again for your help :)

@ashpreetbedi
Copy link
Contributor

Hey @asmith26 sorry been a bit busy so haven't had a chance to work on this, that said I should be able to get to this by end of this week/early next week.

Still deciding between showing all the resources used to generate the answer, or asking the LLM to provide the references it used (from the resources we send).

Any opinions?

For example: If we send 5 chunks for RAG, and its from 3 diff docs, but the LLM only uses 2 chunks from 1 doc to generate the answer. Do we want to show all 3 docs (i.e. whatever was retrieved from the knowledge base) or show the 1 doc that was used to generate the answer.

@asmith26
Copy link
Author

No problem at all, I really appreciate the help (and the lib!)

Good question. Perhaps showing just the 1 doc that was used to generate the answer might be sufficient as well as possibly keep things/the output simpler.

Possibly another option: could always show something like the top N matching docs/chunks, and these could be ranked based on the similarity score.

Just some thoughts/hope this helps, and thanks again for your help!

@asmith26
Copy link
Author

asmith26 commented Mar 5, 2024

Hi @ashpreetbedi, hope you're well - I had one more thought, if it's possible to create an Extractive Question & Answering pipeline, where answer is highlighted directly in the source/context (like in the image), that would be very helpful:

image
(image from: https://github.com/deepset-ai/haystack-demos/tree/main/healthcare)

@ashpreetbedi
Copy link
Contributor

@asmith26 this is an awesome example, looking into it. hope to have examples for you soon :)

@ashpreetbedi
Copy link
Contributor

Going to start working on this next monday -- this is very cool

@ashpreetbedi
Copy link
Contributor

@asmith26 i have a working solution for this used by a client. just havent pushed it to this repo yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants