graphrag icon indicating copy to clipboard operation
graphrag copied to clipboard

[Bug]: build_index() storage and base_dir path relativity

Open LennartSchmidtKern opened this issue 10 months ago • 0 comments

Do you need to file an issue?

  • [x] I have searched the existing issues and this bug is not already filed.
  • [x] My model is hosted on OpenAI or Azure. If not, please look at the "model providers" issue and don't file a new one here.
  • [x] I believe this is a legitimate bug, not just a question. If this is a question, please use the Discussions area.

Describe the bug

According to the documentation of the config yaml: https://microsoft.github.io/graphrag/config/yaml/,

the base_dir key of input as well as storage are relative to the root_dir arg given to the build_index() function of graphrag.api. While for input it seems correct, for storage the files are created into a folder relative to my main script and not to the self defined root_dir.

Steps to reproduce

No response

Expected Behavior

Ouput should be created relative to the root_dir

GraphRAG Config Used

{
  #...
   "input":{
      "type":"file",
      "file_type":"text",
      "base_dir":"input", # not problem
      "file_encoding":"utf-8",
      "file_pattern":".*\\.txt$"
   },
   "storage":{
      "type":"file",
      "base_dir":"output" # problem
   },
#...
}

Logs and screenshots

No response

Additional Information

  • GraphRAG Version: graphrag 1.2.0
  • Operating System: Ubuntu/ Windows WSL
  • Python Version: 3.12
  • Related Issues: -

LennartSchmidtKern avatar Feb 06 '25 16:02 LennartSchmidtKern