Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
26 views19 pages

Graph RAG - Unleashing The Power of Knowledge Graphs With LLM - by NebulaGraph Database - Medium

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 19

6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Search Write

Be part of a better internet. Get 20% off membership for a limited time

Graph RAG: Unleashing the Power


of Knowledge Graphs with LLM
NebulaGraph Database · Follow
6 min read · Sep 8, 2023

500 5

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 1/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

NebulaGraph Launches Industry-First Graph RAG

In the era of information overload, sifting through vast amounts of data to


provide accurate search results in an engaging and comprehensible manner
has become an uphill battle. Traditional search enhancement techniques
often fall short when it comes to complex queries and the high demand
brought by cutting-edge technologies like ChatGPT. This is where Graph RAG

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 2/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

steps in — a game-changing concept crafted by NebulaGraph that promises


to revolutionize the field.

“Graph RAG” is a concept pioneered by NebulaGraph. This technology


harnesses the power of knowledge graphs in conjunction with Large
Language Models (LLMs) to provide search engines with a more
comprehensive contextual understanding. It assists users in obtaining
smarter and more precise search results at a lower cost.

NebulaGraph’s revolutionary Graph RAG (Retrieval-Augmented Generation)


technique, which is based on knowledge graphs, is a breakthrough in this
area. Graph RAG combines knowledge graphs with a large language model to
provide more cost-effective, intelligent, and precise search results. Capable
of deep integration with large language models such as Llama Index and
LangChain, NebulaGraph is the first in the industry to propose the concept
of Graph RAG. Besides, Graph RAG has also achieved excellent results in the
field of vector database integration.

In this article, we will introduce the concept of Graph RAG and compare it
with other RAG techniques. You are also welcome to visit the NebulaGraph‘s
website to Try Demos.

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 3/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Challenges Faced by Traditional Search Enhancement


Techniques
Obtaining accurate search results is a challenge, especially with complex or
long-tail queries when traditional search engines rely on keyword matching,
which often does not meet the users’ actual needs. The bottleneck of
traditional search augmentation techniques is the lack of training data and
text understanding, which makes them less effective when it comes to
generating accurate, diverse and relevant information.

To address this problem, RAG came into being. RAG (Retrieval-Augmented


Generation) refers to the process of enhancing search results through RAG
models. Specifically, it is a technique that combines retrieval and language
generation to enhance the generation process. By using RAG, traditional
search engines can generate more accurate and relevant search results.

However, the RAG technique still faces challenges in terms of training data
and text understanding. These challenges include:

Train data: the RAG technique requires a large amount of data and
computational resources for training and generating models, especially
when handling multiple languages and complex tasks.

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 4/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Text understanding: RAG needs to understand the intent of the query, but
for complex queries or polysemous queries, RAG may have ambiguity or
uncertainty, which affects the quality of the generated content.

Therefore, the problem of how to find more powerful retrieval enhancement


techniques to obtain search results that better meet the searcher’s
expectations more efficiently is even more urgent.

What is Graph RAG?


Graph RAG is proposed by NebulaGraph, which is a retrieval enhancement
technique based on knowledge graphs. It uses a knowledge graph to show
the relationship between entities and relationships and then uses the large
language model LLM (Large Language Model) for retrieval enhancement.

As mentioned in the previous blog, the graph database is naturally suitable


for storing and expressing complex context information by organizing and
connecting information in a graphical format. By using graph technology to
build a knowledge graph to enhance in-context learning, users can provide
more context information to help large language models (LLM) better
understand the relationship between entities and improve their expression
and reasoning abilities.

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 5/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Graph RAG equates the knowledge graph to a large-scale vocabulary, and


entities and relationships correspond to words. In this way, Graph RAG can
jointly model entities and relationships as units during retrieval, which can
more accurately understand the query intent and provide more accurate
search results.

Demo: Graph RAG vs. Vector RAG vs. Text2Cypher


In the following sections, we’ll explore two demos that provide a visual
comparison of Graph RAG with Vector RAG and Text2Cypher.

Graph RAG vs. Graph + Vector RAG


The GIT below compares the results returned by Vector RAG (vector
retrieval) with Graph and Vector RAG (graph-enhanced vector retrieval).

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 6/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 7/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Results on the left: Vector RAG

Results on the right: Vector RAG with Graph

As an example, let’s consider the data set of “Guardians of the Galaxy 3”.
When we search for “Peter Quill’s related information,” traditional retrieval
techniques like vector retrieval engines only provide simple information on
his identity, plot, and actors. However, with the Graph RAG-enhanced search
results, we can obtain more information about the protagonist’s skills,
character goals, and identity changes.

This example highlights how Graph RAG effectively complements the


shortcomings of traditional methods like embedding and vector retrieval
and provides more in-depth knowledge and information relevant to the
query. By combining knowledge graphs with large language models, Graph

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 8/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

RAG can understand the relations between entities, equate knowledge


graphs to large-scale vocabularies and better comprehend the intent of
complex queries, leading to more accurate and relevant search results.

Graph RAG vs. Text2Cypher


Another interesting approach to knowledge graph-based LLM is
Text2Cypher, which is a natural language generation graph query. This
method does not rely on entity subgraph retrieval but translates tasks or
questions into an answer-oriented graph query, which is essentially the same
as what we commonly call Text2SQL.

Text2Cypher and Graph RAG differ mainly in their retrieval mechanisms.


Text2Cypher generates graph pattern queries based on the knowledge graph
schema and the given task, while (Sub)Graph RAG obtains relevant
subgraphs to provide context. Both have their advantages, and you can get a
more intuitive understanding of their characteristics through the following
demo.

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 9/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 10/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Results on the left: Text2Cypher

Results on the right: Graph RAG

From the above demo, it’s evident that the two graph query modes exhibit
pronounced differences in visualization. Retrieval using Graph RAG presents
more comprehensive results. Users not only receive fundamental
introductory information but also gain access to a range of outcomes based
on associative searches and contextual inferences, such as “Peter Quill is the
leader of the Guardians of the Galaxy,” “This role implies that he will return
in the sequel,” and insights into the character’s personality.

NebulaGraph : Build Your Enterprise-Specific Knowledge Graph


Applications in One Step

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 11/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

NebulaGraph database has seamlessly integrated with large language


model frameworks like Llama Index and LangChain.Therefore, developers
can focus on LLM orchestration logic and pipeline design without having to
deal with many details of abstraction and implementation and generate
high-quality and low-cost enterprise-level large language model applications
in one stop.

The advent of Graph RAG presents a breakthrough for processing and


retrieving information on a massive scale. By fusing knowledge graphs and
graph storage within the LLM stack, Graph RAG offers an unparalleled level
of context learning. With the utilization of NebulaGraph, building Graph
RAG is highly simplified and requires minimal effort, based on just three
lines of code. Even more complex RAG logic, such as Vector RAG with graph
can be easily integrated.

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 12/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

As graph technology and deep learning algorithms continue to advance, the


adoption of Graph RAG in data processing and retrieval is set to become
increasingly widespread. We invite you to contact us for a free trial of
NebulaGraph database and to effortlessly create your knowledge graph
application!

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 13/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Knowledge Graph Graph Database Llm AI

Written by NebulaGraph Database Follow

373 Followers

NebulaGraph is an open-source Graph Database, capable of processing trillions of nodes


and edges with milliseconds of latency.

More from NebulaGraph Database

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 14/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

NebulaGraph Database NebulaGraph Database

What are graph embeddings ? Implementing Graph RAG with


In the modern world of big data, graphs are NebulaGraph
undoubtedly essential data representation… Graph RAG has been revolutionizing the
industry since its joint introduction with…

8 min read · Apr 8, 2024 4 min read · May 17, 2024

19 14

NebulaGraph Database NebulaGraph Database

Beyond a Query Language: How Subgraph Computing Uncovered:


GQL is Shaping the Future of Gra… What It Is and Why It Matters
https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 15/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Since the recent release of the GQL (Graph The importance of graph databases in data
Query Language) standard by ISO, there hav… analysis cannot be overstated, and the rece…

5 min read · May 29, 2024 5 min read · Jun 13, 2024

4 7

See all from NebulaGraph Database

Recommended from Medium

Valentina Alto in Microsoft Azure Sunila Gollapudi

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 16/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Introducing GraphRAG with Using Knowledge Graphs to


LangChain and Neo4j enhance Retrieval Augmented…
Part 1: Getting Started with Graph Databases The combination of knowledge graphs and
in the LLMs Era retrieval-augmented generation (RAG)…

· 11 min read · Apr 28, 2024 · 11 min read · Apr 14, 2024

680 12 174 7

Lists

Generative AI Recommended What is ChatGPT?


Reading 9 stories · 383 saves
52 stories · 1153 saves

The New Chatbots: ChatGPT, Natural Language Processing


Bard, and Beyond 1539 stories · 1074 saves
12 stories · 415 saves

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 17/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Wenqi Glantz in Better Programming Kamal Dhungana in GoPenAI

7 Query Strategies for Navigating RAG Application with Neo4j-


Knowledge Graphs With… Constructed Knowledge Graphs…
Exploring NebulaGraph RAG Pipeline with the Very recently I came across this article which
Philadelphia Phillies serves as a comprehensive guide for buildin…

· 17 min read · Sep 29, 2023 · 10 min read · Mar 26, 2024

945 4 204 1

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 18/19
6/26/24, 3:45 PM Graph RAG: Unleashing the Power of Knowledge Graphs with LLM | by NebulaGraph Database | Medium

Valentina Alto in Microsoft Azure Sunila Gollapudi in Towards Data Science

Introducing GraphRAG with Combine Text Embeddings and


LangChain and Neo4j Knowledge (Graph) Embeddings i…
Part 2: Implementing and evaluating a In my previous articles, I wrote about using
GraphRAG application Knowledge Graphs in conjunction with RAG…

· 20 min read · May 12, 2024 · 15 min read · Apr 29, 2024

242 4 706 9

See more recommendations

Help Status About Careers Press Blog Privacy Terms Text to speech Teams

Could not connect to the reCAPTCHA service. Please check your internet connection and reload to get a reCAPTCHA challenge.

https://medium.com/@nebulagraph/graph-rag-the-new-llm-stack-with-knowledge-graphs-e1e902c504ed 19/19

You might also like