English: Diagram illustrating the two principle phases of GraphRAG with a knowledge graph with selectable access patterns for unstructured, structured and mixed data.
Indexing Phase, knowledge graph construction:
a) Documents (unstructured data) are transformed into a lexical graph with hiearchical levels of detail and cross-document topical summarization. Each level includes a vector representation of the text. Named entity recognition is performed to extract structured data from the text, which is optionally attached to an in-graph schema. Finally, text representations are cross-linked and may be enriched with graph analysis like a centrality score.
b) Structured data is imported as a domain graph using primitive data types recorded in nodes and relationships.
c) Connections are made between the structured and unstructured data.
Inference Phase, GraphRAG access patterns:
A vector embedding is calculated for the user question.
Rule-based or agent-based tool selection determines the access pattern to use:
a) Search - text from the lexical graph is searched using keyword, full-text, or vector similarity search
b) Search pattern match - following a search, graph pattern matching is used to expand the context of the text with structured data that can also be used for post-filtering
c) Query - the user question is used to generated a database query, which is validated and executed to retrieve relevant information
Together, the combined text and data added to the prompt as context for the original user question.
The LLM then generates the final answer.
This process ensures efficient and relevant document retrieval based on the semantic content of queries.
to share – to copy, distribute and transmit the work
to remix – to adapt the work
Under the following conditions:
attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
https://creativecommons.org/licenses/by/4.0CC BY 4.0 Creative Commons Attribution 4.0 truetrue
Captions
GraphRAG with a knowledge graph combines access patterns for unstructured, structured and mixed data.