WhoBuilt

GraphRAG: The Marriage of Knowledge Graphs and RAG

Aug 28, 2024· 19 min· 293K views·Watch on YouTube

Speaker

Emil Eifrem, co-founder and CEO of Neo4j, explains how GraphRAG combines knowledge graphs with RAG for AI Engineer’s tech talk.

From keyword search to knowledge graphs

Eifrem traces web search from keyword-based systems such as AltaVista, which often returned too many results, to Google’s use of PageRank to rank important pages. He describes Google’s 2012 Knowledge Graph as a shift toward representing concepts and their relationships, alongside text.

How GraphRAG retrieves context

Eifrem defines GraphRAG as RAG that uses a knowledge graph during retrieval, optionally alongside vector search. In his Wi-Fi support example, vector search finds relevant articles, then graph traversal adds context such as related products and highly rated engineers’ content. The expanded results can be ranked and passed to the LLM.

Accuracy and development tradeoffs

Eifrem cites research reporting higher answer accuracy when graph retrieval is combined with vector search, including a Data.World study averaging three times higher response quality across about 43 questions and a LinkedIn paper reporting a 75% to 77% increase. He says GraphRAG can be easier to develop once a knowledge graph exists, while creating that graph takes work. Its explicit, visual structure can also help with debugging, explainability, auditability, and governance.

Creating graphs from enterprise data

Eifrem distinguishes structured data, unstructured data such as PDFs, and structured data containing long-form text. He says moving structured databases into a property graph and extracting graphs from unstructured data are both difficult, while mixed data is common in enterprise production use cases. He demonstrates Neo4j’s Knowledge Graph Builder with a newsletter, a Wikipedia page, and a YouTube video, showing extracted concepts and chunks in a graph.

Takeaways

  • Use vector search to find starting points, then follow graph relationships to add relevant context.
  • Consider GraphRAG when questions depend on connections between products, documents, people, or other entities.
  • Treat reported accuracy gains as evidence to investigate for your own data and questions.
  • Plan for the effort of creating a useful knowledge graph before expecting GraphRAG to simplify application development.
  • Use explicit graph relationships to make retrieval easier to inspect and explain.

Mentioned in this talk

Search inside this talk

What was claimed 3

  • metric
    GraphRAG: Data.World study: average response accuracy was three times higher with a knowledge graph and vector search
    “response quality—the accuracy—was three times higher”
    YouTube
    Unverified1 source· Talk
  • metric
    GraphRAG: LinkedIn study: 75% or 77% increase in accuracy
    “a 75% or 77% increase in accuracy”
    YouTube
    Unverified1 source· Talk
  • feature
    Knowledge graph construction: Extracts information from PDFs, YouTube links, Wikipedia links, and cloud service buckets to create a knowledge graph
    “it can extract the data from there and create the graph”
    YouTube
    Unverified1 source· Talk

Related talks