GraphRAG is now on GitHub
GraphRAGโs GitHub release matters less as a model demo than as an implementation path. For teams building private knowledge assistants, the practical question is how to turn unstructured document collections into a repeatable retrieval layer that can survive real enterprise constraints: changing content, inconsistent metadata, and questions that span multiple documents rather than a single passage.
The architectural shift is that GraphRAG adds a preprocessing stage before query time. That means an upfront indexing workflow must extract entities and relationships, build the graph, and generate community summaries. The trade-off is clear: more engineering effort and token cost during ingestion, in exchange for stronger context assembly later and less dependence on brittle top-k vector matches.
For platform teams, the important integration point is not the repository alone but the accelerator and hosting model. A code-free Azure deployment lowers initial adoption friction, but it also raises the usual enterprise questions about how the service fits identity, network boundaries, data residency, and operational monitoring. GraphRAG will likely need to be treated as part of a governed retrieval pipeline, not just an application feature.
There is also a maintainability implication. If the document corpus changes frequently, the value of hierarchical summaries depends on how well the indexing workflow can be refreshed, versioned, and validated. Teams evaluating GraphRAG should think in terms of index lifecycle management, cost per refresh, and query behavior under evolving data, especially when the goal is broad synthesis rather than pinpoint lookup.
Figure 1. Knowledge graph of entity nodes and relationship edges derived from a news dataset (opens in new tab), with different colors representing various communities. Level 0 communities (left) represent the highest-level themes of the dataset, while level 1 communities (right) show the emergence of more granular topics within these themes.
In a recent preprint, we explore how these community summaries can also help answer global questionsโwhich address the entire dataset rather than focusing on specific chunks of textโwhere naive RAG approaches based on vector search fall short. For example, consider the question โWhat are the main themes in the dataset?โ This is a reasonable starting point but one where naive RAG will always give misleading answers. This is because it generates answers from chunks of text semantically similar to the question, not necessarily from the subset of input texts needed to answer it.
However, if a question addresses the entire dataset, all input texts should be considered. Since naive RAG only considers the top-k most similar chunks of input text, it fails. Even worse, it will match the question against chunks of text that are superficially similar to that question, resulting in misleading answers. Community summaries help answer such global questions because the graph index of entity and relationship descriptions has already considered all input texts in its construction. Therefore, we can use a map-reduce approach for question answering that retains all relevant content from the global data context:
- Group community reports up to the LLM context window size.
- Map the question across each group to create community answers.
- Reduce all relevant community answers into a final global answer.
Evaluation and results
To evaluate this approach against naive RAG and hierarchical source-text summarization, we used the LLM GPT-4 to generate a diverse set of activity-centered sense-making questions from short descriptions of two datasets: podcast transcripts and news articles. We then selected three metrics for head-to-head comparison of generated answers, as evaluated by an LLM judge: comprehensiveness (covers all aspects in detail), diversity (provides different perspectives), and empowerment (supports informed decision making). The results show that GraphRAG, when using community summaries at any level of the community hierarchy, outperforms naive RAG on comprehensiveness and diversity (~70โ80% win rate). GraphRAG using intermediate- and low-level community summaries also performed better than source text summarization on these metrics at lower token costs (~20โ70% token use per query). Performance was competitive with hierarchical source text summarization for the highest-level communities at substantially lower token costs (~2โ3% token use per query). This is shown in Figure 2.
Figure 2. Comparison of naive RAG and GraphRAG responses to a global question about a news dataset (opens in new tab) indicates that GraphRAG outperformed naรฏve RAG in terms of comprehensiveness, diversity, and empowerment.
Introducing Aurora: The first large-scale foundation model of the atmosphere
Aurora, a new AI foundation model from Microsoft Research, can transform our ability to predict and mitigate extreme weather events and the effects of climate change by enabling faster and more accurate weather forecasts than ever before.Research insights and future directions
Through the initial research cycle, we demonstrated that LLMs can successfully derive rich knowledge graphs from unstructured text inputs, and these graphs can support a new class of global queries for which (a) naive RAG cannot generate appropriate responses, and (b) hierarchical source text summarization is prohibitively expensive per query. The overall suitability of GraphRAG for any given use case, however, depends on whether the benefits of structured knowledge representations, readymade community summaries, and support for global queries outweigh the upfront costs of graph index construction. Weโre currently exploring various approaches to reduce these costs while maintaining response quality. Our latest work on automatically tuning LLM extraction prompts to the problem domain is an example of how we are reducing the upfront effort required to customize these prompts, enumerate entity types, create few-shot examples, and so on. To enable evaluation of GraphRAG with minimal upfront indexing costs, weโre also investigating NLP-based approaches to approximating the knowledge graph and community summaries that would be generated by a full indexing process. Our goal is to ensure that, whatever the constraints of the deployment context, there is a GraphRAG configuration that can accommodate these constraints while still delivering exceptional response quality. By making GraphRAG and aย solution accelerator (opens in new tab) publicly available, we aim to make graph-based RAG approaches more accessible for users and use cases where itโs critical to understand data at a global level. We encourage community feedback and suggestions on both the code repository and solution accelerator as we work together to enable the next generation of RAG experiences.Acknowledgements
Joshua Bradley, Christine Caggiano, Mรณnica Carvajal,ย Alex Chao, Newman Cheng, Ed Clark, Ben Cutler, Andres Morales Esquivel, Nathan Evans, Alonso Guevara Fernรกndez, Amber Hoak, Kate Lytvynets, Gaudy Blanco Meneses, Apurva Mody, Robert Ness, Gabriel Nieves-Ponce, Douglas Orbaker, Richard Ortega, Rodrigo Racanicci, Billie Rinaldi, Katy Smith, Sarah Smith, Shane Solomon, Dayenne Souza, David Tittsworth, Chris Trevino, Derek WorthenEnjoyed this article? Sign up for our newsletter to receive regular insights and stay connected.
