kernel-memory icon indicating copy to clipboard operation
kernel-memory copied to clipboard

DiversitySampling with Memory for DocumentQA

Open joowon-dm-snu opened this issue 1 year ago • 0 comments

Moved from semantic-kernel

For document QA, when using Memory and filtering solely by relevance_score, you end up with results that are mostly from similar sections of the same document. However, when a comprehensive answer considering the overall content is necessary, utilizing various parts from diverse documents rather than just including sections from a single document in the prompt can be beneficial.

After reading the provided link, I found it to be a good idea and propose integrating it as a feature used in conjunction with Memory.

This post introduces the concepts of DiversityRanker and LostInTheMiddleRanker. The concept of LostInTheMiddleRanker is closely related to the overall structure of prompts, so I didn't include it in this proposal for now, as it might be challenging to integrate solely with Memory.

Implementation code in haystack is here

joowon-dm-snu avatar Oct 10 '23 18:10 joowon-dm-snu