microsoft / graphrag

A modular graph-based Retrieval-Augmented Generation (RAG) system
https://microsoft.github.io/graphrag/
MIT License
16.83k stars 1.58k forks source link

[Bug]: print(result.context_data["relationships"].head()) error when 'result = await search_engine.asearch(question)' #535

Open arthurjinhui opened 1 month ago

arthurjinhui commented 1 month ago

Describe the bug

question = "Tell me about Agent Mercer"
result = await search_engine.asearch(question)
print(result.response)

###
print(result.context_data["entities"].head())
print(result.context_data["relationships"].head())
print(result.context_data["reports"].head())

......

check entities is ok, but

print(result.context_data["relationships"].head())
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^

KeyError: 'relationships'

Steps to reproduce

No response

Expected Behavior

No response

GraphRAG Config Used

claim_extraction:

llm: override the global llm settings for this task

parallelization: override the global parallelization settings for this task

async_mode: override the global async_mode settings for this task

enabled: true prompt: "prompts/claim_extraction.txt" description: "Any claims or facts that could be relevant to information discovery." max_gleanings: 0

Logs and screenshots

File "/Users/xxxxxx/Library/MSGraphRAG/GraphRAGRAG.main01.py", line 180, in main print(result.context_data["relationships"].head())


KeyError: 'relationships'

### Additional Information

- GraphRAG Version: 0.1.1
- Operating System: MacOS 
- Python Version: 3.12
- Related Issues:
giriprasad51 commented 1 month ago

the code working fine LocalSearch search_engine but not for GlobalSearch search_engine

github-actions[bot] commented 1 month ago

This issue has been marked stale due to inactivity after repo maintainer or community member responses that request more information or suggest a solution. It will be closed after five additional days.