DRIFT Search: Combining Global and Local Search Methods in GraphRAG

Julian Whiting, Zachary Hills, Alonso Guevara Fernández, Ha Trinh, Adam Bradley, Jonathan Larson31 Oct 2024

Problem

GraphRAG offers two query modes over private text. Global search reads community reports for whole-corpus questions but is resource intensive. Local search retrieves a few matching text units for targeted questions, starting only from entities that match the query. When a question does not fit the entity types and persona chosen at indexing time, local search misses nearby facts and the answer is partial.

Example from the article: for a question about U.S. agency actions on lead contamination in apple cinnamon puree pouches, DRIFT surfaced extra details (cinnamon traced to Ecuador and Sri Lanka, contamination 2000 times the FDA maximum) that local search did not.

Solution in brief

DRIFT first matches the query against the top K community reports to get a rough answer and follow-up questions. It then runs each follow-up through local search, which yields new answers and new follow-ups, for two rounds. The result is a ranked hierarchy of questions and answers, and global context steers local retrieval.

Questions this case answers
  • How to answer a specific question over a large document corpus when the best passages are not found by the question's own wording
  • How to compare two retrieval strategies on a corpus using an LLM judge and pairwise win rates
  • How to answer a detailed question over a private document set when the retrieved text units cover only part of the answer
  • How to get more varied facts into a RAG answer without running a full global search over every community report

Tools and methods

  • GraphRAG — indexing engine (knowledge graph, community reports) and query engine with global and local search.
  • DRIFT search — primer, follow-up loop and output hierarchy on top of GraphRAG; released in the GraphRAG repository.
  • HyDE (Hypothetical Document Embeddings) — expands the query before it is embedded and matched to community reports.
  • LLM-as-a-judge — scores comprehensiveness and diversity of answers in the benchmark.
Continue reading — it's free

Google or a one-time email code. No password.