RAG Needs a Map: Using GraphRAG to Retrieve Connected Context

Nyah Macklin, Neo4j52:59 · Oct 2026 · 280 views
Thumbnail for RAG Needs a Map: Using GraphRAG to Retrieve Connected Context Watch on YouTube
TL;DR
  1. 1

    GraphRAG adds a knowledge graph to the retrieval path so an agent can follow relationships between pieces of information.

  2. 2

    Vector search remains useful for finding relevant text, while graph traversal helps with multi-hop questions, aggregation, and source tracing.

  3. 3

    A fixed graph schema for node and relationship types helps guide LLM extraction and prevents the model from inventing the graph structure.

Summary

Nyah Macklin gives a practical introduction to GraphRAG and builds one with Neo4j. She contrasts vector-based RAG, which retrieves text chunks by similarity, with graph retrieval, which follows explicit connections between entities. Her recommendation is to use both. Vectors find relevant course material, while the graph adds related context, traversal, aggregation, and inspectable sources. The workshop uses GraphAcademy course content, a Neo4j Aura database, Python, OpenAI embeddings, an LLM extraction step, and Cypher queries. Macklin walks through chunking documents, creating embeddings, extracting entities and relationships, inspecting the resulting graph, and connecting it to an Aura agent. The agent answers a temperature question with sources. It also returns an incorrect lesson count after the graph builder is run twice, and a direct database query exposes the problem. The example makes a practical point: an agent response still needs visible evidence and database checks.

Key ideas
07:18

A knowledge graph makes relationships visible to both people and machines

Macklin contrasts three ways to represent an apple. A vector is a series of floating-point numbers that is difficult for people to read. A knowledge graph can show that an apple comes from a tree, is round, is red, and is a fruit. The graph combines machine-readable data with connections that people can inspect. She says this structure also lets an agent move from one node to another through an explicit relationship, which helps trace how it reached a decision. She connects this need for history and context to regulated areas such as finance, medicine, and law.

11:45

GraphRAG adds a graph to the retrieval path instead of removing vector search

Macklin describes ordinary RAG as a pipeline that chunks documents, creates text embeddings, retrieves the top relevant chunks, and passes them to an LLM. GraphRAG keeps that general pattern but includes a knowledge graph in the retrieval path. She recommends combining vector and graph retrieval. Vector search remains useful for many questions that can be answered by finding relevant text. The graph adds connected information when the answer depends on relationships between entities or documents.

13:04

Multi-hop and aggregation questions are where connected retrieval helps

Macklin says vector-only RAG is often sufficient for a question that could be answered with a search engine. GraphRAG becomes useful when the question requires multiple hops through connected data. She gives source code analysis and supply chain questions as examples, along with tasks that require aggregation or combining information from different documents. Traversing the graph lets the system expose the path to an answer and retrieve historical context. She is clear that vector RAG remains powerful for many use cases.

20:10

The knowledge graph pipeline chunks text, embeds it, and extracts entities with an LLM

The workshop's construction process starts with data sources and text chunks. Each chunk is vectorized, while an LLM extracts entities and relationships from the text. Macklin shows a prompt that asks the model to identify requested entities and relationships and return JSON objects. The extracted output is parsed and used to generate the graph. Manual extraction is possible, but she says an LLM can reduce the time needed for the extraction step. Cypher is then used to query the resulting graph.

36:00

A working agent combines lesson similarity search with connected graph data

Macklin creates an Aura agent grounded in the GraphAcademy course. She adds a lesson-content search tool, selects a vector index, retrieves the top five results, and uses OpenAI's text-embedding-3-small model. The similarity-search configuration also returns connected graph data. A Cypher query supplies nodes and similarity scores. The resulting agent can answer a question about how temperature affects an LLM and show the course sources used for the answer.

46:09

Direct database checks expose errors that an agent answer can hide

The agent is asked how many lessons are in the course and returns 30. Macklin explains that the course actually has 15 lessons because the knowledge graph builder was run twice, creating duplicate lesson data. A direct query in Aura returns the correct count of 15. The example shows why a successful pipeline and a plausible answer are not enough. Engineers need to inspect the underlying graph and verify the query that produced the result.

48:15

A declared schema keeps graph extraction from drifting

In the final code walkthrough, Macklin shows a fixed-size splitter with a chunk size of 500 and a chunk overlap. The builder defines node types such as technology, concept, example, process, challenge, and benefit. It also defines relationship types such as related to, part of, and used in. These patterns guide the LLM as it creates the graph. Macklin says that once a suitable schema is chosen for the data, passing it to the pipeline keeps the model from making up new node and relationship types.

"Once you got it, that using that schema like that will guide the LLM so it won't just make up new node and relationship types."50:34
Who should watch
  • You are using vector-based RAG and need answers that follow relationships across documents or entities.
  • Your agent must show where an answer came from, especially in a regulated or auditable application.
  • You are building a knowledge graph with an LLM and want a concrete pipeline with chunking, embeddings, extraction, Cypher, and an agent.