graphrag icon indicating copy to clipboard operation
graphrag copied to clipboard

[Feature Request]: Implement Query-Engine.log similar to index-engine.log

Open fclarke1 opened this issue 1 year ago • 5 comments

Do you need to file an issue?

  • [X] I have searched the existing issues and this feature 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 feature request, not just a question. If this is a question, please use the Discussions area.

Is your feature request related to a problem? Please describe.

When attempting to run queries which are failing it is hard to understand where the issues are. A logger, similar to the index-engine.log, would really help this.

  • [ ]

Describe the solution you'd like

Implement a log, very similar to the index-engine.log, but for querying (local and global).

All the log info/warning messages are already implemented in the query package, so all that needs to happen is to enable a log to save it down in the directory.

I propose:

  • create an _enable_logger() in graphrag/query/cli.py (in the same way as the index logger is enabled) in the run_global_search() and run_local_search() methods
  • when the logger is created, it creates a new log in root_dir/query_log/query_engine-[method]-[timestamp].log
  • To do this run_global_search() and run_local_search() will need to receive "verbose" and "root_dir" arguments, similar to running the index engine.

I would like to create a pull request for this fix. I have implemented this in my cloned repo and is working well.

Thanks

Additional context

I would like to create a pull request for this fix. I have implemented this in my cloned repo and is working well.

fclarke1 avatar Aug 21 '24 13:08 fclarke1

Hi @fclarke1

Contributions are welcome :) Please feel free to submit your PR.

AlonsoGuevara avatar Aug 21 '24 17:08 AlonsoGuevara

Great - I'll submit a PR. Cheers

fclarke1 avatar Aug 22 '24 10:08 fclarke1

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.

github-actions[bot] avatar Aug 30 '24 01:08 github-actions[bot]

I've submitted a PR #1037

fclarke1 avatar Aug 30 '24 08:08 fclarke1

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.

github-actions[bot] avatar Sep 08 '24 01:09 github-actions[bot]