-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Do you need to file an issue?
- I have searched the existing issues and this bug is not already filed.
- 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.
- I believe this is a legitimate bug, not just a question. If this is a question, please use the Discussions area.
Describe the bug
The drift_k_followups configuration parameter is documented but doesn't actually control how many follow-up queries are generated. The default prompt template has a hardcoded "Generate at least five good follow-up queries" instruction, so changing the config from 5 to 10, 15, or 20 has no effect.
Steps to reproduce
- Configure DRIFT search in
settings.yaml:
drift_search:
drift_k_followups: 15 # Set to anything > 5
n_depth: 2
primer_folds: 3- Run a DRIFT query
- Check the logs/output for generated follow-ups
Expected Behavior
Expected Behavior:
Setting drift_k_followups: 15 should generate 15 follow-up queries per iteration.
Actual Behavior:
Only 5 follow-up queries are generated, regardless of the config value.
GraphRAG Config Used
# Paste your config here
Logs and screenshots
No response
Additional Information
Root Cause:
Looking at the source code:
graphrag/query/drift/search.py(line 240) correctly limits selection:actions = actions[:self.context_builder.config.drift_k_followups]- But the default prompt template contains:
"Generate at least five good follow-up queries"(hardcoded)
So the code is ready to accept 15 queries, but the prompt only generates 5.
Impact:
- Users expect documented config parameters to work
- Changing the config has no visible effect, which is confusing
- Limits DRIFT's exploration depth for users who need it
- All other DRIFT parameters (
n_depth,primer_folds,local_search_max_data_tokens) work correctly - only this one doesn't
Workaround:
Yes, I can create a custom prompt template with the desired number and set drift_search.prompt: "custom_prompt.txt" in config.
However: A documented configuration parameter should work out-of-the-box without requiring custom prompt templates. This creates unnecessary friction and makes the config parameter misleading.
Suggested Fix:
Parameterize the prompt template to use the config value:
Generate at least {drift_k_followups} good follow-up queries.
This would maintain backward compatibility (default could stay 5) while making the parameter functional.
Environment:
- GraphRAG: latest (pip install)
- Python: 3.12
- OS: macOS
Documentation Reference:
https://microsoft.github.io/graphrag/config/yaml/ states:
drift_k_followups: int- The number of top global results to retrieve
Thanks for the great project! This is just a config consistency issue that affects user experience.