GraphRAG is superior to RAG for powering AI response engines

In July 2024, Microsoft released GraphRAG as open source, a technology that enables chatbots and response engines to connect the dots across a comprehensive dataset, far surpassing standard augmented generation by retrieval (RAG).

What is the difference between RAG and GraphRAG? RAG (Retrieval-Augmented Generation) is a technology that allows an LLM to access a database like a search index and use it as the basis for answering a question. It can be used to link a large language model and a conventional search engine index.

The main advantage of RAG is that it can use reliable and authoritative data to answer questions. RAG also allows generative AI chatbots to use up-to-date information to answer questions on topics the LLM hasn't been trained on. This is an approach used by AI search engines like Perplexity.

The advantage of RAG is linked to its use of embeddings. Embeddings are a way of representing semantic relationships between words, sentences and documents. This representation allows the retrieval part of RAG to associate a search query with text in a database (like a search index).

However, the downside of using embeddings is that they limit RAG to associating texts at a granular level (as opposed to a global scope across the data).

Microsoft explains:

“As the naive RAG only considers the k most similar pieces of input text, it fails. Worse yet, it will associate the question with pieces of text that are superficially similar to that question, resulting in misleading answers. »

The innovation of GraphRAG is that it allows an LLM to answer questions based on the entire dataset.

What GraphRAG does is it creates a knowledge graph from the indexed documents, also known as unstructured data. The obvious example of unstructured data are web pages. So when GraphRAG creates a knowledge graph, it creates a “structured” representation of the relationships between various “entities” (like people, places, concepts and things) which is then more easily understood by machines.

GraphRAG creates what Microsoft calls “communities” of general themes (high level) and more granular topics (low level). An LLM then creates an overview of each of these communities, a “hierarchical data synthesis” that is then used to answer questions. This is a breakthrough because it allows a chatbot to answer questions based more on knowledge (summaries) rather than depending on embeddings.

Here's how Microsoft explains it:

“Using an LLM to summarize each of these communities creates a hierarchical synthesis of the data, providing an overview of a dataset without needing to know what questions to ask in advance. Each community serves as the basis for a community synthesis that describes its entities and their relationships.

…Community summaries help answer such global questions because the graph index of entity and relationship descriptions has already taken into account all input texts when it is built. Therefore, we can use a map-reduce approach to answering questions that retains all relevant content from the overall context of the data…”

Examples of RAG versus GraphRAG The original research paper on GraphRAG illustrated the superiority of the GraphRAG approach for answering questions for which there is no exact corresponding data in the indexed documents. The example uses a limited dataset of Russian and Ukrainian news for June 2023 (translated into English).

Simple text matching question The first question used as an example was “What is Novorossiya?” » and RAG and GraphRAG both answered the question, with GraphRAG offering a more detailed answer.

The short answer, by the way, is that "Novorossiya" translates to New Russia and refers to the Ukrainian lands conquered by Russia in the 18th century.

The second example question required the machine to make connections between concepts within the indexed documents, what Microsoft calls a "query-driven summarization (QFS) task," different from a simple query-based retrieval task. the text. This requires what Microsoft calls, "connecting the dots."

The question posed to the RAG and GraphRAG systems was:

“What did Novorossiya do? »

Here is RAG's response:

“The text does not provide specific information about what Novorossiya did. »

GraphRAG answered the question “What did Novorossiya do?” ” with a two-paragraph response that details the results of the Novorossiya political movement.

Here is a short excerpt from the two-paragraph response:

“Novorossiya, a political movement in Ukraine, has been involved in a series of destructive activities, particularly targeting various entities in Ukraine [Entities (6494, 912)]. The move has been linked to plans to destroy property of several Ukrainian entities, including Rosen, the Odessa Canning Factory, the Odessa Regional Radio-Television Transmission Center and the National Television Company of Ukraine [Relationships (15207, 15208, 15209, 15210)]…

…The Prosecutor General's Office in Ukraine reported the creation of Novorossiya, indicating the government's awareness and potential concern regarding the activities of this movement...”

The above is only part of the answer extracted from the limited one-month dataset, illustrating how GraphRAG is able to connect the dots across all documents.

GraphRAG Now Publicly Available Microsoft announced that GraphRAG is publicly available to everyone.

“Today, we are happy to announce that GraphRAG is now available on GitHub, providing more structured information retrieval and more comprehensive answer generation than naive RAG approaches. The GraphRAG code repository is complemented by a solution accelerator, providing an easy-to-use API experience hosted on Azure that can be deployed code-free in just a few clicks. »

Microsoft released GraphRAG to make solutions based on this technology more publicly available and to encourage feedback for improvements.

To learn more: discover why Graph technology enhances AI reasoning and our article on The functioning of RAG in generative AI.

Back to top
The entire NextStart.AI libraryEight consulting missions, seven pillars, around twenty formats, fifteen professions, five tools
Nine detailed customer case studiesLarge groups, public agencies and networks: from acculturation to production

Insurance and social protection

Health and life sciences

Public sector and research

The NextStart.AI collectiveConsultants, trainers and industry experts: more than 4,850 professionals trained since 2023
All free resourcesDiagnostics, comparison tool, Finders, charter template, Word templates and industry-specific kits
The NextStart.AI blogComparisons of tools, practices, agents, governance: analyses and feedback from the field
Let's talk about your AI projectResponse within 24 business hours, written quote after initial discussion
AI agents in businessUnderstanding, choosing the tool, training the teams, deploying
Delegate entire tasksClaude Cowork, Copilot Cowork, ChatGPT Work, Vibe Work