graphrag icon indicating copy to clipboard operation
graphrag copied to clipboard

Provide a control flag to only return context that is cited in the response

Open stevetru1 opened this issue 1 year ago • 1 comments

As part of pulling context for the response synthesis a lot of information is retrieved that is ultimately not used for the response. In some cases this is helpful while in others it is distracting. An option to toggle this to a more limited mode (e.g. "return_full_context=True/False" in the context builder params) would provide a lot of clarity for some applications and reduce boilerplate code to scan for and filter out unused context.

Example code snippet:

context_builder_params = { "use_community_summary": False, # False means using full community reports. True means using community short summaries. "shuffle_data": True, "include_community_rank": True, "min_community_rank": 0, "max_tokens": 12_000, # change this based on the token limit you have on your model (if you are using a model with 8k limit, a good setting could be 5000) "context_name": "Reports", "return_full_context: True }

stevetru1 avatar May 02 '24 18:05 stevetru1

Example of what you mean would be helpful?

chiragshah285 avatar Jul 02 '24 17:07 chiragshah285