Understanding GraphRAG

This section describes GraphRAG, a retrieval approach that combines vector similarity search with knowledge graph traversal. GraphRAG is designed for questions that require connected facts from multiple chunks or documents.

What Is GraphRAG

Retrieval-augmented generation retrieves relevant information before generating a response. In a typical vector retrieval workflow, documents are divided into chunks, converted into vector embeddings, and searched for semantic similarity.

During knowledge graph creation, entities and relationships are extracted from source chunks. At query time, vector search identifies relevant starting points, and graph traversal expands retrieval to include connected information.

You can create, query, and manage knowledge graphs using the DBMS_AI_GRAPHRAG PL/SQL package. For information about the subprograms provided by this package, see DBMS_AI_GRAPHRAG.

Why Use GraphRAG

Vector search finds text that is semantically similar to a question. However, the information needed to answer a question might be distributed across multiple chunks.

For example, consider the question:

Who is the spouse of the author of Young Man Luther?

The answer requires two connected facts:

GraphRAG connects these facts through the following path:

Young Man Luther
        |
    written by
        |
  Erik Erikson
        |
   husband of
        |
  Joan Erikson

A vector search might retrieve Chunk C1 because it mentions Young Man Luther, the book named in the question. Chunk C2 identifies Joan Erikson as Erik Erikson’s spouse, but does not mention the book or identify Erik Erikson as its author. Therefore, vector search might rank Chunk C2 too low to include in the retrieved results.

GraphRAG can follow the extracted relationships from Young Man Luther to its author, Erik Erikson, and then to his spouse, Joan Erikson, thereby connecting evidence from both chunks.

The final answer is Joan Erikson.

This demonstrates how GraphRAG supports questions that require multiple connected facts rather than a single matching text fragment.

GraphRAG Components

GraphRAG represents source information using the following components: