Specify prompts for local and global search via config/CLI
Is there an existing issue for this?
- [ ] I have searched the existing issues
- [ ] I have checked #657 to validate if my issue is covered by community support
Describe the issue
How to adjust the prompt template used for global search and local search? Is there any related document?
global prompt:map_system_prompt.py,reduce_system_prompt.py
local prompt:system_prompt.py
Steps to reproduce
No response
GraphRAG Config Used
# Paste your config here
Logs and screenshots
No response
Additional Information
- GraphRAG Version:
- Operating System:
- Python Version:
- Related Issues:
The GlobalSearch and LocalSearch classes do accept prompts, so if you are building a search implementation you can supply edited prompts. We don't expose that through the CLI or config file right now, so I'll add this to the backlog for investigation. In the meantime, have a look at the search factories for examples of how to instantiate the classes directly (these factories are used by the CLI, so you can trace through).
This has been around for awhile, but worth noting: newer versions of GraphRAG export all prompts when you do graphrag init. So you can edit the text files directly.