Overview
GraphRAG uses large language models (LLMs) to create knowledge graphs and summaries from unstructured text, leveraging them to improve retrieval-augmented generation (RAG) operations. While global search provides comprehensive overviews and local search enables detailed exploration, DRIFT search introduces a hybrid approach that combines the strengths of both methods.Key innovation: DRIFT search includes community information in the search process, greatly expanding the breadth of the query’s starting point and leading to retrieval and usage of a far higher variety of facts in the final answer.
How it works
DRIFT search operates in three core phases:Phase 1: Primer
The primer phase establishes broad context using community reports:- Community selection: Identifies the top K most semantically relevant community reports
- Initial answer: Generates a broad initial answer based on community-level insights
- Question generation: Creates follow-up questions to steer further exploration
- Confidence scoring: Assigns confidence scores to determine whether to continue exploration
Phase 2: Follow-up
The follow-up phase uses local search to refine queries iteratively:- Local search execution: Uses local search to answer each follow-up question
- Intermediate answers: Produces detailed intermediate answers with context-rich information
- Question refinement: Generates new follow-up questions that enhance specificity
- Confidence tracking: Monitors confidence levels to guide query expansion
Phase 3: Output hierarchy
The final phase produces a hierarchical structure:- Hierarchical organization: Questions and answers are organized hierarchically
- Relevance ranking: Results are ranked by relevance and confidence
- Balanced insights: Combines global insights with local refinements
- Adaptive results: Makes results comprehensive and adaptable to the query

Configuration
TheDRIFTSearch class accepts the following key parameters:
Language model chat completion object for response generation
Context builder for preparing context data from community reports and query information
Configuration model defining DRIFT search hyperparameters, including:
- Primer configuration (top-k reports, temperature, tokens)
- Local search parameters (text unit proportion, community proportion)
- Follow-up question limits and depth
- Confidence thresholds for expansion
Token encoder for tracking the budget for the algorithm
State object for tracking execution of a DRIFT search instance, including follow-ups and actions
Optional callback functions for custom event handlers during execution
DRIFT configuration options
TheDRIFTSearchConfig model includes:
API usage
Basic usage
Streaming usage
Advanced configuration
Performance considerations
Computational cost
Cost factors:- Number of primer reports (
primer_top_k_reports) - Number of follow-up questions (
max_follow_up_questions) - Search depth (
max_search_depth) - Token budgets for each phase
Optimization strategies
Confidence threshold tuning
Theconfidence_threshold determines when to continue query expansion:
- Higher threshold (0.8-1.0): Only continue with high-confidence paths, faster but potentially less comprehensive
- Lower threshold (0.5-0.7): Explore more paths, more comprehensive but slower and more expensive
- Optimal range (0.6-0.7): Balanced exploration for most use cases
When to use DRIFT search
DRIFT search is ideal for:Complex questions
Multi-faceted questions requiring both broad context and specific details
Exploratory analysis
When you need to discover connections and patterns not immediately obvious
Unfamiliar domains
Exploring new datasets where you’re not sure what entities are relevant
Iterative refinement
Questions that benefit from progressive refinement and follow-up exploration
Comparison with other methods
| Aspect | Local Search | Global Search | DRIFT Search |
|---|---|---|---|
| Starting point | Entity embeddings | Community reports | Community reports + iterative local |
| Breadth | Narrow | Wide | Wide → Narrow |
| Depth | Deep | Shallow | Shallow → Deep |
| Cost | Low | High | Medium-High |
| Iteration | Single-pass | Map-reduce | Multi-pass iterative |
| Best for | Known entities | Dataset themes | Complex exploration |
Best practices
Start with moderate settings
Begin with default configuration and adjust based on results and budget
Use confidence thresholds wisely
Lower thresholds for exploratory queries, higher for focused questions
Balance primer and local search
Adjust
primer_top_k_reports and local search parameters based on your use caseExamples
Complex multi-entity exploration
Thematic discovery
Guided exploration with callbacks
Learn more
For an in-depth look at the DRIFT search method and its theoretical foundations:DRIFT Search blog post
Read the official Microsoft Research blog post introducing DRIFT Search
Next steps
Local search
Learn about entity-based search
Global search
Understand dataset-wide reasoning
Example notebooks
See DRIFT search in action
Configuration
Configure DRIFT search settings