RAG vs. Graph RAG, explained visually!
RAG has many issues.
For instance, imagine you want to summarize a biography, and each chapter of the document covers a specific accomplishment of a person (P).
This is difficult with naive RAG since it only retrieves the top-k relevant chunks, but this task needs the full context.
Graph RAG solves this.
The following visual depicts how it differs from naive RAG.
The core idea is to:
- Create a graph (entities & relationships) from documents.
- Traverse the graph during retrieval to fetch context.
- Pass the context to the LLM to get a response.
Let's see how Graph RAG solves the above problem.
First, a system (typically an LLM) will create a graph from documents.
This graph will have a subgraph for the person (P) where each accomplishment is one hop away from the entity node of P.
During summarization, the system can do a graph traversal to fetch all the relevant context related to P's accomplishments.
The entire context will help the LLM produce a complete answer, while naive RAG won't.
Graph RAG systems are also better than naive RAG systems because LLMs are inherently adept at reasoning with structured data.
๐ Over to you: Have you used Graph RAG in production?
Pra quem estรก estudando git pela primeira vez ou revisando assim como eu, tem um livro no site oficial do git que explica direitinho o passo a passo (em inglรชs). Aqui o site pra baixar:
โค๏ธ https://t.co/2J4D4Pxzhv