CodeAlchemy

Jotting one man's journey through software development, programming, and technology


Project maintained by pablogarciaprado Hosted on GitHub Pages — Theme by mattgraham

GraphRAG

◀️ Home

GraphRAG is RAG where R path includes a Knowledge Graph.

Process Overview

GraphRAG Retrieval Patterns

  1. Do a vector search to find an initial set of nodes.
  2. Traverse the graph around those nodes to add context.
  3. (Optional) Rank the results using the graph and pass the top-k documents to the LLM.

Benefits

Data semantics

Not competing ways of doing it, but complimentary.

Data semantics 1 Data semantics 2 Data semantics 3

Knowledge Graph Construction

We can have structured, unstructured data, or a mix of both.

Structured Data

Structured Data with short text values.

Unstructured Data

Typically PDFs or other text documents.

Mix of Structured & Unstructured Data

Structured Data with long-form text.

Two Types of Knowledge Graphs

Lexical Graph

A graph representation of for example the words, paragraphs, chunks, documents, and the relationship between them.

Domain Graph

A graph representation of the real or digital world, i.e. the domain you’re modeling.

These two are not exhaustive. They’re also not mutually exclusive.

Sources: