graphrag-accelerator icon indicating copy to clipboard operation
graphrag-accelerator copied to clipboard

Retrieve source document of local search

Open mariomoliner opened this issue 10 months ago • 3 comments

Hello,

I would like to know if there's a way to extract the source(s) where some query result comes from?

I would find this especially useful in the case of local search, sometimes the results have been very close the actual source txt. I'm not aware whether there's any way of arriving to the source document name via the diferent /data/* calls.

Mario

mariomoliner avatar Feb 17 '25 16:02 mariomoliner

Hi @mariomoliner - take a look at https://github.com/Azure-Samples/graphrag-accelerator/blob/main/notebooks/2-Advanced_Getting_Started.ipynb

Towards the bottom, under the Query heading, there are examples showing how to (1) get the context associated with a query result and (2) use the API to retrieve details about documents, claims, relationships, entities, etc that may be referenced in the response.

timothymeyers avatar Feb 18 '25 15:02 timothymeyers

Hi @timothymeyers thanks for the information, I'm aware of the endpoints and they help to retrieve the source of the document given an entity, report or relationship.

My question is for the case when you have [Data: Sources (2071, 292);] In this kind of source in the response is there any way to retrieve what is the sourced document name?

mariomoliner avatar Feb 20 '25 13:02 mariomoliner

Hi @timothymeyers, just following up on my previous question. I’m still curious about how to retrieve the actual document name when dealing with source identifiers like [Data: Sources (2071, 292);]. If there’s any additional information or pointers on how I can map these IDs back to the source document names, that would be really helpful! Thank you again

mariomoliner avatar Feb 24 '25 09:02 mariomoliner