mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

feat request: include metadata in prompt - add links to prompt to show references

Open ishaan1995 opened this issue 2 years ago • 9 comments

🚀 The feature

Is there a plan to provide links from which embedded chunk was given? It would make the response better as we could reference and show the links in response as well. I saw internally in embeddings_queue we do store the link in metadata

Motivation, pitch

I am creating a bot for content written from writers and want to show original posts in the bot response.

ishaan1995 avatar Aug 23 '23 13:08 ishaan1995

including meta_data is definitely on the roadmap, in more capabilities than this.

I can't speak for an ETA.

cachho avatar Aug 24 '23 21:08 cachho

If anyone implements this, please add a template variable and make it configurable as such.

cachho avatar Aug 30 '23 12:08 cachho

Would love to try this framework out, but this is currently a deal breaker for me.

justinlevi avatar Aug 30 '23 14:08 justinlevi

If anyone implements this, please add a template variable and make it configurable as such.

@cachho Why do you mean by template variable?

Could it be something like query and query_with_metadata?

denisj avatar Sep 29 '23 13:09 denisj

Would love to try this framework out, but this is currently a deal breaker for me.

Agree! Users need the ability to see original document chunks in order to check for accuracy (as well as possibly learn more about their question). Embedchain looks very useful , but I won't deploy RAG apps internally or for the general public unless users can view retrieved source document chunks.

smach avatar Jan 15 '24 14:01 smach

Would love to try this framework out, but this is currently a deal breaker for me.

Agree! Users need the ability to see original document chunks in order to check for accuracy (as well as possibly learn more about their question). Embedchain looks very useful , but I won't deploy RAG apps internally or for the general public unless users can view retrieved source document chunks.

Hi @smach, we provide a way to the users to retrieve source document chunks along with answer for query/chat method. Please refer to our docs to learn how to do that - https://docs.embedchain.ai/api-reference/app/query

You can use the citations flag to retrieve the retrieved source document chunks. Please feel free to reach out to us if you have more questions.

deven298 avatar Jan 15 '24 15:01 deven298

On a Chat with PDF page of my repo, I use EmbedChain and process the source text from citations into a readable format for respones! Embedchain is wonderful and feel free to use my code if helpful! https://github.com/DrDavidL/family-chat

DrDavidL avatar May 12 '24 18:05 DrDavidL

I was concerned about sources when using web - my mistake! Works perfectly. Sample output:

CleanShot 2024-05-13 at 20 51 18@2x

DrDavidL avatar May 13 '24 21:05 DrDavidL

I would love to see this as well -- specifically, I believe the request is referring to what are sometimes called parenthetical citations, like this, which are sometimes in (author date: page) format:

Today is the third day of June (Foo 2023: 12). Tomorrow, it will be the fourth day of June, and the weather is forecast to be sunny (Bar 2012: 3).

References:

  • Foo, John. 2023.
  • Bar, Sally. 2012.

Of course, there are many different citation formats used in academia, but that could be sorted out later. Package paper-qa has parenthetical cites like this. I built a RAG pipeline locally that is able to track sources through the LLM calls, but I don't trust its reliability. I'm not sure about the best way to accomplish this but it would amplify the value of the package immensely.

socratic-irony avatar Jun 04 '24 03:06 socratic-irony