AI Engineer World's Fair 2026
RAG Needs a Map: Using GraphRAG to Retrieve Connected Context — Nyah Macklin, Neo4j
Read the talk
RAG Needs a Map: Using GraphRAG to Retrieve Connected Context
Nyah Macklin builds a course-question-answering agent with vector search, graph retrieval and Cypher—and uses a wrong lesson count to show why inspectable evidence still matters.
From a talk by Nyah Macklin
At a glance
Ideas worth remembering
GraphRAG includes a knowledge graph in retrieval. Vector search can find relevant chunks while graph queries retrieve connected information.
Questions involving multiple hops or aggregation are useful reasons to consider graph retrieval; ordinary passage lookup may be adequately served by vectors.
Node types, relationship types and allowed patterns guide LLM extraction toward a graph suited to the documents and intended questions.
Inspectable data remains necessary after the pipeline works: the agent returned 30 lessons, while a direct Aura check reported the expected 15.
Start with a course, a database and somewhere to run Python
Most hands in Nyah Macklin’s opening poll go up for vector-based RAG; far fewer go up for graph-based retrieval. This Neo4j workshop starts at that gap: how can an agent retrieve relationships between pieces of information, rather than just passages that resemble a question? Macklin connects that engineering problem to a longer-standing interest in tracing and explaining AI decisions.
The build uses GraphAcademy’s hands-on course material, a Neo4j Aura database and an OpenAI API connection. Participants begin by creating a GraphAcademy account and a free Aura instance. The workshop supplies a limited-use API key to reduce setup work. These pieces have different jobs: the course supplies the material, Aura stores the graph, and the model services support extraction and embeddings.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
An apple has a vector—and relationships you can read
An apple makes the representation problem concrete. Its vector representation is a series of floating-point numbers. Those numbers can support machine retrieval, but a person cannot readily read them and explain what the system knows about the apple.
What becomes easier to inspect when the same apple appears in a knowledge graph? The representation exposes recognizable facts: it comes from a tree, it is round, this particular apple is red, and it is a fruit. That last connection also distinguishes the fruit from the company. The useful change is that the representation names entities and their connections in terms that both software and people can work with.
A graph makes those connections traversable. An agent can move from one node to another through a relationship, leaving a path that can be inspected. Macklin contrasts this with reconstructing connections through table joins, though the workshop provides no performance comparison establishing that graphs are universally faster. The concrete benefit here is the explicit relationship structure.
That structure becomes especially attractive when a decision needs a history. Finance, medicine and legal work are the motivating examples—“Nobody wants Vibe banking.” Agent memory could preserve the context behind earlier decisions, but this workshop does not implement it. Its narrower task is to build the connected data that retrieval can use.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Keep vector search; add a path through the graph
The baseline RAG pipeline starts with documents such as PDFs. Split them into chunks, embed those chunks and index the vectors. At question time, use the same embedding model to represent the query, retrieve the top K relevant chunks, and pass them to an LLM to produce an answer. GraphRAG changes the retrieval path so that it includes a knowledge graph.
The decision depends on what answering the question requires:
- Find a relevant passage. A question that resembles an ordinary search query may be well served by vector retrieval.
- Follow connected facts. Source-code analysis and supply-chain questions may require several relationship hops, rather than one semantically similar passage.
- Combine or count information. Aggregation across documents requires bringing together the relevant records; a small set of nearby chunks may not contain the complete answer.
Macklin offers multiple hops, including a three-hop example, as a practical signal to consider graphs rather than as a measured cutoff.
Vectors remain useful in this design. They find promising material by similarity; the graph supplies relationships that retrieval can follow. The recommendation is to use both, preserving the vector layer while adding connected context.
A retriever is the component that fetches this outside information for the answer. Macklin’s mnemonic is a Golden Retriever: it goes and gets what is needed. Neo4j’s options include full-text search, vector search and text-to-Cypher retrieval. A natural-language question can therefore lead to different ways of searching the stored data.
The news-chatbot example separates three complementary sources:
- News API: fetch current articles and headlines.
- Knowledge graph: recover relationships between topics, including historical connections.
- Document database: store and retrieve the articles, reports and other text.
These are distinct contributions to an answer; the example does not require them to run as a sequential chain.
A knowledge graph itself needs only entities and relationships to get started. Macklin and a colleague can each be nodes, with separate colleague and friend relationships between them. The same pair of entities can participate in more than one relationship—a useful distinction when the question depends on how two things are connected.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Turn document text into entities and relationships
Graph construction begins with unstructured text. The teaching example uses the Neo4j Wikipedia page: collect its text, split it into chunks and generate embeddings. An LLM also extracts the entities and relationships expressed in that text. Manual extraction is possible, but the model is introduced to reduce that work.
The extraction prompt asks for entities and relationships in JSON objects. Parsing that structured output supplies the information used to generate the graph. The resulting example distinguishes Neo4j the company from Neo4j the database, connects the database to its developer, and records that it is implemented in Java. Those connections turn statements in prose into facts that can be queried through Cypher, Neo4j’s graph query language.
The hands-on build then moves to Neo4j’s open-source GraphRAG for Python package. It supplies knowledge-graph construction and retrieval capabilities, so the exercise can concentrate on configuring the pipeline and connecting its output to an agent.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Connect the Python environment before building
The course opens a GitHub Codespace with the workshop project. Its environment template becomes a real .env file containing the database connection details and OpenAI key. Editing only .env.example is a setup trap: the running program needs the configured .env file.
There are two database options. A personal Aura instance is preferred for the later agent exercise; participants who cannot finish that setup can use the small database supplied within GraphAcademy. Either route must provide a working Neo4j connection because that database is where the builder writes the graph.
Before ingestion, the environment test runs and reports five passing tests. This verifies the immediate prerequisites: the Python environment can connect to Neo4j and use the OpenAI key. It does not yet demonstrate that extraction or retrieval produces correct answers.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Run the builder, then query what it wrote
Running the structured knowledge-graph builder starts populating Aura. Macklin has already loaded data to avoid waiting for the entire process, so the displayed database is not a clean first run. The builder writes the data; querying lets participants inspect what has arrived.
What did ingestion actually create? After correcting the path assignment in a Cypher query, the demonstration returns connected nodes and relationships. Clicking the results exposes their data. Aura’s graph view therefore serves as an interactive query result, giving participants a way to inspect the stored structure rather than merely look at a diagram. Repeating the read query reveals changes as ingestion progresses; it is the builder that generates the graph.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The agent needs both an instance and a vector index
Aura’s agent interface may first need enabling at the organization level. The demonstration turns on Generative AI Assistance and Aura Agent in Settings, then creates an agent from scratch against the database instance. The agent is named GraphRAG Fundamentals Agent and described as providing Neo4j GraphRAG information grounded in this particular GraphAcademy course.
A missing prerequisite interrupts creation: similarity search requires a vector index. Having a populated graph does not by itself make the similarity-search tool available. The workshop returns to the course’s vector-index example and runs its creation command in Aura’s Cypher query interface.
On Macklin’s instance, the index already exists because the command was run earlier. With that dependency satisfied, the build returns to agent configuration and can add similarity search. The ordering matters: construct the data, create the index used to search its embeddings, then configure the tool against that index.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Use similar chunks as an entry point to connected data
The similarity-search tool is called Search lesson content. Its purpose is to find information in the course so the agent can answer questions about lessons. The configuration selects the chunk-embedding vector index, retrieves the top five matches, and uses OpenAI’s text-embedding-3-small with 1,536 dimensions.
The consequential option is to return connected graph data. Similarity search supplies an entry point; the retrieval query determines what associated graph information comes back with it. Aura supports configuring this through natural language or Cypher, and the demonstration uses a supplied Cypher query.
How does the query connect vector retrieval to graph retrieval? The highlighted requirement is that it work with the retrieved nodes and their similarity scores. Those are the bridge between finding nearby embeddings and returning connected context. The full traversal is not spoken aloud, so the demonstration does not establish which relationship paths or expansion depth it uses.
The finished agent has lesson similarity search and a natural-language-to-Cypher tool. These support different kinds of work: finding relevant lesson content and asking structured questions of the graph. The interface also offers an Update agent action as the underlying knowledge graph changes.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A temperature answer works; a lesson count needs checking
The first question asks how temperature affects an LLM. The agent answers that temperature controls randomness in generated text, discusses higher and lower settings, and displays course sources for further reading. Which material supports that explanation? The accompanying sources make the retrieved basis inspectable. The PDFs came from GraphAcademy’s introductory GenAI course; this build ingests those documents for retrieval rather than demonstrating model-weight training.
You can find more information on this topic in the following lessons:
• https://graphacademy.neo4j.com/courses/genai-fundamentals/1-generative-ai/2-considerations
• https://graphacademy.neo4j.com/courses/genai-fundamentals/4-integrating-neo4j/3-rag
The next question changes the task: “How many lessons are there in this course?” Finding a passage about a concept and counting lessons are different operations. A top-five similarity result cannot be assumed to contain every lesson; the count needs the relevant structured records. This is the aggregation use case introduced earlier.
The agent returns 30, while Macklin says the course contains 15 lessons. She attributes the doubled answer to rerunning the graph builder. The demonstration then checks Aura directly, including the option to select the lesson node type, and reports 15. The explanation also mentions not refreshing the agent’s information, so it does not isolate whether duplication, stale agent state or the generated query caused the discrepancy.
The useful result is the ability to investigate the disagreement. A working GraphRAG pipeline can still give a wrong aggregate answer. Direct access to the stored lesson records provides a separate check on the agent’s response, making the graph useful for diagnosis as well as retrieval.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The schema tells extraction what kinds of graph to build
The closing code walkthrough explains what produced the database. The structured builder combines a Neo4j driver for database access, an OpenAI LLM, OpenAI embeddings, a simple knowledge-graph pipeline and a fixed-size text splitter. The splitter uses a chunk size of 500 and an overlap to preserve context across boundaries; the spoken explanation does not specify the size unit or overlap value.
Extraction is guided by a schema with several distinct parts:
- Node types: technology, concept, example, process, challenge and benefit.
- Relationship types: relations such as related to, part of and used in.
- Allowed patterns: combinations of endpoint types and relationships, such as a technology related to another technology, or an example used in a technology.
The patterns give extraction more structure than a vocabulary of labels alone: they describe which kinds of entities a relationship should connect.
Where does that structure enter the implementation? The builder passes the node types, relationship types and patterns into the knowledge-graph pipeline. They guide how the LLM turns document statements into graph records, instead of leaving it to invent a fresh set of types for each piece of text.
python
PATTERNS = [
("Technology", "RELATED_TO", "Technology"),
("Concept", "RELATED_TO", "Technology"),
("Example", "USED_IN", "Technology"),
("Process", "PART_OF", "Technology"),
("Technology", "HAS_CHALLENGE", "Challenge"),
("Concept", "HAS_CHALLENGE", "Challenge"),
("Technology", "LEADS_TO", "Benefit"),
("Process", "LEADS_TO", "Benefit"),
("Resource", "CITES", "Technology"),
]
For business documents, the schema should fit the business material rather than copy this course’s categories. An LLM can help propose that schema; once chosen, it guides extraction. The demonstration’s inputs include CSV data and lesson PDFs, which the builder processes into the graph queried in Aura. Schema choice therefore shapes what later retrieval can ask about and connect.
The workshop closes by pointing toward hands-on study of Cypher, knowledge graphs and context graphs in GraphAcademy. Those are practical next steps after the agent works: learn to query its evidence directly, and learn to model the relationships that the next set of questions will need.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Read the complete timestamped transcript
- 0:13
Hello, everyone. Thank you so much for coming today, and welcome to RAG Needs a Map: Using Graph RAG to Retrieve Connected Context. So before we get started today, and I know there are people who are trickling in, but before we get started today, I just wanna do a quick little poll to see who is already using RAG in their pipelines, regular vector-based RAG. Okay. Cool. Perfect. Are there people who are already using graph-based RAG in their pipelines? Okay.
- 0:41
Not really.
- 0:42
Got it. Still working on it. So I see just a few people. Um, and for those who, um, are already using graph-based RAG in their pipelines, could you explain what graph RAG is?
- 0:56
A couple. Sort of. Okay, people are like, "Sort of." That's perfectly okay. Um, what we're gonna do is for those who are new to the concept, um, this will be a sort of 101 graph RAG, um, talk. So if you're already an expert, this... You'll already know what we're talking about, just so that you can, um, level set. But, um, all in all, I want to make sure that people know what we're gonna be talking about today. So just to shortly introduce myself, my name is Nyah Macklin, and I'm a senior software engineer
- 1:26
and senior developer advocate here at Neo4j. Um, my research focuses on graph theory, graph algorithms, as well as, uh, context engineering, while all trying to understand, um, the many architectures that are in place, um, to build out agents, but also which architectures are best suited to break open this black box phenomenon, um, to be able to decipher and trace and explain how artificial intelligence systems work. So I, um, spend a lot of time thinking about AI governance and
- 1:56
safety as well, which also turns out to matter a lot when, uh, thinking about how your agent is making its decisions and how your agent is built. Um, but I've been doing this work for about a decade now, and I'm excited to bring you all, bring us all back to basics to try and understand, uh, graph RAG. And so this is a graph RAG 101 type of workshop for those who are newer to the concept.
- 2:20
So today, I have two incredible team members who are joining me, as well as another team member who's joining me today. I have my colleagues, uh, Jeremy Adams Castanias, who is here in the front. Jeremy's waving to everyone. If you have any questions whatsoever, please ask Jeremy. Um, I also have my colleague, Ryan Knight, who is here, I think, somewhere. Oh, great. Hey, Ryan. Great to see you. So Ryan's gonna be joining me, and I also have a special guest, the, uh, the speaker for the previous session as well, Zach, who is in the
- 2:50
back. He's an incredible AI research engineer on the Neo4j team. He is also here to join us and to help out with any questions that you need. So if you have any questions, just raise your hand during the, uh, the workshop, and one of my colleagues will, um, will join you at your table and help you work through this. So just a couple, um, uh, housekeeping notes before we even get started. Today, we're gonna be using this platform called Graph Academy in order to proceed through this workshop. Has anyone signed up or used
- 3:20
Graph Academy before, or even heard of Graph Academy? Okay. No, not at all. That's perfectly fine. So Graph Academy is our completely free forever, free online learning platform where you can learn about all the concepts that I'm gonna be talking about today. It takes you through building out agents. It takes you through learning about agentic memory, about context graphs, if you've all heard of that phrase as well. Um, there are lots of different free courses that are online and completely available. These are not sit back and
- 3:50
listen to a lecturer speak courses. These are hands-on, keyboard, start building type of courses. So that's the main goal for Graph Academy, and it's an absolutely excellent resource for you to use, again, completely free at any time. So we're gonna be using that today, and what I want you all to do just so that we can start off is because we're using Graph Academy, I want you to create a Graph Academy account for me. And so it should be a quick process. You're gonna go to graphacademy.neo4j.com,
- 4:20
and then you can start to create this account. Um, and again, these are free resources. You can take this and go, um, throughout your time, either here at AI Engineer or as you continue to learn about graph and RAG. I also have a link here for all of the links that we are gonna be talking about today, all of the, um, all of the notes that we have. I will also, at the end, be able to present with you all the slides from this deck. Um, but, um, you'll go to
- 4:49
dev.neo4j.com/workshop-genai-notes, and that has all of the information that we need. I'm gonna go to it right now, actually. And you'll see here, if I can-- I always have to fight with these things. So you'll see here, this is what, uh, the document that you go to, um, if you actually click that link, the dash notes. So here we have, um, a couple links that you'll see.
- 5:19
After you sign up for graphacademy.com, I also want you to create a Neo4j Aura instance. This is our hosted cloud platform. We're doing this all for free, so please do not, um, uh, click the instances that you're paying for. I want you to click the free instance. Um, and so again, remember that we're trying to do all this all for free. Click the free instance. If you wanna have more, um, more tools in the future, then you can feel free to click the, uh, the professional instance or, or what have you. But, um, we're gonna create a free
- 5:48
instance, um, and this will allow you to, to hook up to what we are gonna be diving in today, Aura Agents as well. So building out Aur- building out agents within the Aura platform. But you can see here-- Now, I know people love a good free API key. No worry, I did not leak my le- leak my API key here. But we do have a, um, OpenAI API key that's gonna give you access to be able to build today. So we wanted to make this as simple as possible for
- 6:18
you all, and it's easy to get started. So we're giving you a free API key that you can use, um, in order to build, and, um, we do have limits on that. You can't just run up, run up the bill. But, um, please do copy down that API key or save it on your computer. Again, it'll be here on this document as you view it, um, so that you can have access to it later. But I just wanted to show off this, uh, this document for you all. Um, there are some different ways in order to get started with Neo4j, but that's all
- 6:48
okay.
- 6:52
So while you all are working on, um, creating those instances and creating those accounts,
- 6:59
what we will do is just get started with some of the material that we're gonna be talking about today. And I'm just gonna give you a, a short primer, and then we'll actually dive into what we'll be talking about in Graph Academy. So first of all, and this will be, uh, something that many of you have already heard of because you're already working within a RAG and within vector-based RAG. But to overcome this AI's black box problem, right, we often need knowledge itself and data itself to actually
- 7:29
be transparent. So we s- can see here that we have a human view of an apple, right, in the center. And then we also have, to the right, the vectorized view of an apple. And so for the vectorized view of an apple, you see this series of numbers here, right? It's, uh, floats, uh, for those who are engineers themselves. Um, but these are not necessarily human-readable and human-understandable, um, uh, vectors, uh, unless you've actually memorized the vector view of an apple yourself. Um,
- 7:59
but every single object you can represent both as a vector or, or as data itself. Um, but every single object that exists on Earth can be represented here. But then on the left, we see a knowledge graph view of an apple, right? So this apple, we can see that the apple itself, it comes from a tree, that the apple, um, has a specific body and a specific look. The apple is round. Um, this particular apple is
- 8:29
red. Um, and an apple itself is a fruit. We're not talking about the company. So knowledge graphs can make what is understood by humans also understood by machines, and it creates-- Knowledge graphs oftentimes create a fusion of both. So you're able to understand both-- this is both machine-readable and human-readable graph, uh, a view of an apple. And if you're coming in late and you don't have access to these,
- 8:59
uh, the materials, Jeremy and Ryan are coming around. They have the QR codes. Um, just raise your hand, and they'll come around and give you the QR code for the materials that I had just, uh, s- had up on the slide.
- 9:13
But most people right now, you can either-- you'll either have your data structured as a, um, uh, actually in structured as tables and rows, or you might have your data structured in vectors like I had shown before. But if you're structuring your data in tables and rows, then you have to oftentimes do a number of different complex joins on that data, um, in order to figure out how these rows and these tables are all related to. And then we often understand that that is going to
- 9:43
drastically slow down the performance of our application. And we can't have that, especially mo- most of us, um, deal with the, uh, the San Francisco mentality, move fast and break things, right? Just get it working halfway, and then push it to production. We'll figure out, you know, we'll figure out any issues going forward. So this is the slowest way to do things. We don't have time for that, right? We have to move fast. We have to be accurate, and we have to be explainable. So if you were to structure all of that same data in a knowledge
- 10:12
graph, then the relationships and the connections and the groupings actually become much more clear. So now your agent can physically hop, right, from one node, and when I say node, I mean one circle to the next circle through this relationship that we see, right? And the line is the relationship. We can hop from one node to the next node, um, of information and be able to trace and explain what happened in the past. That's a massive improvement, right?
- 10:43
Once you're being able to hop through nodes, through things like agent memory, which I'm actually not gonna get into in this talk. I have a whole another talk that talks-- that breaks down agent memory. But through this, this concept of agent memory, you can now have this memory and have this context of how did that agent come to create the decision that it made in the past. And so that's, that's incredible for dealing, like, uh, dealing in regulated domains, um, like financial use cases. Um, y'all don't want
- 11:12
Vibe, Vibe banking, right? Nobody wants Vibe banking. You don't want your agent just having access to your money and then spending all of your money. I've seen those things happen before. But things like medicine as well, regulated spaces, legal spaces, this is where that, um, that, uh, context and that history and that memory is actually very, very important. But once you have a knowledge graph representation, your possibilities for your agent to give you that explainable, traceable, and accurate responses actually become much more improved, and some
- 11:42
might say endless.
- 11:45
So again, because this is a 101 workshop, I wanted to make sure that people understand the architecture of a graph-based RAG system. So in a normal RAG pipeline, you are not using knowledge graphs, right? In, in the basic, uh, RAG pipeline. Um, in a normal RAG pipeline, you could take a few PDFs, for example, and then chunk them, and then index those chunks using a text embedding model. Um, and then when it's time to query those text chunks, you get that same embedding model. Then you try to fetch the top K or top
- 12:15
X number of relevant documents, and you pass that into an LLM. And then your LLM is going to give you back the final answer from those documents. And, and that's what the pipeline looks like for, for that folk are usually, um, most likely used to, right? But GraphRAG on the other hand, is fundamentally, it is RAG, but it's where the retrieval path actually includes the knowledge graph. So GraphRAG is where the retrieval path actually includes a knowledge graph. And so you'll see here the
- 12:45
architecture is just slightly different. So in the RAG pipeline illustration that I showed before, the normal RAG pipeline did not use a knowledge graph. But you see here, down here, we actually have a knowledge graph incorporated into that space. So when people ask me when to use RAG versus GraphRAG, usually I like to say that we're-- if you're trying to answer a question w- that can be solved, um, with, uh, either a search engine, then, uh, for ex... And that's the simplest term, right? Then vector-based RAG is actually usually sufficient.
- 13:15
However, if you want to ask a question that includes what we call these multiple hops. So we saw the ac- the example of a knowledge graph before, we saw the nodes. If you're trying to do these multiple hops or, or at least three hops, then that's when GraphRAG actually becomes imperative, because you're able to then see and able to then decipher where the agent had to, um, had to hop in order to get to its answer. But, um, if you're trying to do something, for example, source code analysis, or
- 13:45
if you're trying to have a supply chain question, or anything that requires aggregation or concatenation of data, then, uh, from different documents, then that's when this GraphRAG actually, uh, becomes really helpful. And I'm not gonna necessarily knock vector-based RAG. I think it is incredibly powerful for most of our use cases. But here are some of the examples where vector-only, um, RAG and vector-only databases, they might fall short with when it comes to these things where graph and being able to
- 14:15
traverse nodes and get that, that historical context, um, can be beneficial. I'm not gonna go through all of these, but I wanted people to be able to see where, um, where the differences might lie.
- 14:29
And so all in all, when you're going to be-- When people ask, "Okay, should we use GraphRAG versus vector-based RAG?" I'd say that using both is actually the key here. We wanna use both graph and vector. Um, and, uh, graph, we, we're not saying that graph is gonna completely, um, uh, completely replace your vector layer. We're saying that if you use both, then you have the benefits of both. So let's add on, right? Let's make sure that our agents are being as, uh, beneficial as possible. Okay. So I'm gonna pause there, and we are going to go
- 14:59
into, uh, GraphAcademy. So for GraphAcademy, the first link, graphacademy.com, we're gonna go into this workshop, um, .genai. And what I want us to do
- 15:13
is to-- We're gonna skip the first few sections of this. So, um, I have, of course, already done the course, but I can reset it. So we're gonna continue that course and we're, we're-- what we're gonna do is we're gonna skip over some of this, um, more introductory stuff like what is generative AI. We don't need to know that. If you do need to know that, that's perfectly fine as well. Um, but, uh, for this conversation, we're just gonna skip down. We're gonna skip down to the, to the GraphRAG section. All right. So we already went through the
- 15:42
GraphRAG, um, the retrieval process and the differences between normal RAG versus GraphRAG process. We're seeing that we're-- First of all, we, we see the typical process here, which I already went through. You have your retrievers, your user, your application, and your LLM, and then your data store, which is normally, um, a vector store. Um, but then if we go down, then we see a little bit of the difference, um, as well. And what I did want to touch upon here is this concept of
- 16:12
retrievers. Many of you already know what retrievers are. Just get a quick hand, so I don't have to go over it. Oh, okay. Look, actually, not as many as I thought. So that's okay. That's, that's totally okay. Let's actually go over it then quickly. So a retriever is a key component of the RAG process, right? A retrieval is actually res-responsible for searching and retrieving relevant information from your external data sources. And what I like to say... Okay, let's, let's make this, um, bigger. Thank you so much. Um, what I like to say often, or ways that I like to
- 16:41
remember what retrievers are, um, the simple way, um, is that retrievers are the Golden Retriever, right? We, we all know about Golden Retrievers. They like to catch balls. They like to catch things. So a retriever is some-- is, uh, if you would think of this Golden Retriever, it likes to go and fetch the necessary information. Um, and so the retriever usually takes in unstructured input, like a question or a prompt, like when we're using chatbots, and then it searches the structured data to provide the context for the answer.
- 17:12
And so this is just a little bit about what Neo4j specifically report-- supports, full text search, vector search, and then, uh, text or Cypher retrievers as well. And then we have a number of different data sources as well. So those data sources in, uh, regular RAG pipelines and processes can vary, um, documents, APIs, knowledge graphs as well. Um, but, um, if we were to use, uh, this, uh, this news agency chatbot, for example, then the process would look like this, right? A news API is
- 17:41
gonna be used to retrieve the latest articles and headlines. The knowledge graph is then gonna be used to understand the relationships between different topics, um, such as how they relate to each other in a historical context. And then the document database is gonna store and retrieve, uh, articles or reports or textual information as well. So we-- that's just an example and a, um, architecture of what that could look like. But let's keep going. Right. There's lots of different benefits to using
- 18:11
GraphRAG. I'll touch upon this really quickly. But one of those is, um, having a richer context specifically, and then improved accuracy, explainability, like we had actually seen within that knowledge graph. If you're able to actually, um, if you're able to traverse your knowledge graph, um, and then use that plus things like agent memory, then you can get this rich historical context that's really necessary and really beneficial for building out your agents. So- Let's keep going.
- 18:42
And then I heard a couple people, um, and my colleague had went through the line a little bit earlier to see, like, have people built knowledge graphs before. Can I get a couple hands to see? Has anyone built out knowledge graphs? Just a few. Okay, just a few. Okay, a little bit, yeah. Okay, on the... Okay, hello world. That's perfectly fine. No problem. This is why we're all here to learn more. Um, so, uh, just, um, making sure that we understand what is a knowledge graph. We went through this a little bit in the, in the example, but a knowledge graph in general is a, um, uh,
- 19:12
organized representation of real world entities and their relationships. So if I am a node, right, I'm a circle, I'm a node, and then my colleague Jeremy is a node as well. Yes, Jeremy, we are nodes. And then we actually have relationship that we are colleagues and we are friends. So we have two different relationships here, um, but, um, that is, uh, that's the simplest architecture of a, um, of a knowledge graph. And then we can be connected to different people as well. We have our colleague Zach, and then another colleague, Ryan. There's so many different, um, ways, but
- 19:42
that's just a represe- it's just a representation of data in its most simplest form. Um, so, uh, what is a knowledge graph? You can see here a- another example of that knowledge graph. And so in the interest of time, I'm just gonna skip down, and we're gonna get into this knowledge graph construction piece. So for everyone who's following, um, we're in the, um, knowledge graph construction section. So let's build out a knowledge graph quickly. So constructing knowledge graphs. In this lesson, we'll review the
- 20:12
process of constructing knowledge graphs from unstructured text using an LLM. So the overall process is making sure that we're gathering data sources, and then we're chunking that information and chunking that data. We're of course gonna vectorize that data as well. And then, um, extracting nodes and relationships from that. And then generating the graph, of course. So in this example, if we wanted to construct a knowledge graph based on the Neo4j Wikipedia page, which we can see here, we're gonna gather
- 20:42
text from that page, right? Take all the text, and then we're gonna split that text into chunks, as you can see here. We would generate embeddings and vectors from each of those chunks, and then extracting the entities and the relationships using an LLM. Now, you can do that manual extraction if you wish, um, but we think that, um, using it in an LLM can cut down on the amount of time that it takes in order to do that extraction. Um, and so we would send the LLM to with an appropriate prompt, um, a
- 21:12
prompt example here. Your task is to identify the entities and the relationships requested with the prompt from a given text, and then you must generate the output, um, in a JSON format containing a list with JSON objects. And then we would paste-- oh, sorry, parse those, um, entities and relationships, the output into the LLM, paste that into as JSON, and then we would generate the graph from all of that. So we see ser- we see here Cypher, which is a query language that's
- 21:41
optimized for graphs. Has anyone used Cypher before? A couple. Okay. Okay. All right. A couple people. Um, so if you're a Cypher expert, then I have, um, uh, if you answer some of my questions here, I have swag as well. So people, as, um, as you are going through this workshop, I want it to be more interactive than a normal workshop. So I'll be asking questions, and if you're brave enough to answer one of my questions live, it's also being live streamed. But live, then I have free, uh, unique swag for you.
- 22:12
So that includes T-shirts, that includes, um, uh, special swag that you cannot get anywhere else as well, socks, et cetera. But, um, special swag on top of that. So, um, thank you all for, uh, being willing to put yourself out on a limb and answer some questions that we might have. But you'll see here at, uh, lastly, an example of a generated graph. So we have a graph database was de- uh, developed by Neo4j, which is a company. Um, and, uh, Neo4j didn't, uh, develop graph databases all in general, but just
- 22:41
Neo4j is the graph database that was, uh, developed by Neo4j with the company, and then that's implemented in Java. And quick side note, Neo4j, the name, comes from Neo, who is Matrix. All right? Those who know The Matrix. And then Neo for Java. So for those who have that quick little piece, you'll know that, uh, that note about Neo4j. So we can continue.
- 23:08
Ah, yes, yes.
- 23:10
Just give me one step back.
- 23:11
Go for it.
- 23:12
Can we do that part?
- 23:12
Yeah. Yeah, let's do it.
- 23:14
Okay. So, um, because we're at half past the hour, we want you to get the most out of this.
- 23:18
Sure.
- 23:18
And people wanted to do building of the knowledge graph.
- 23:21
Mm-hmm.
- 23:21
There is a, on your left sidebar, it says GraphRAG for Python.
- 23:25
That's right.
- 23:27
That link there, so kind of navigate to that, that will take you, if you scroll down, um, this is gonna talk a little bit about the, the GraphRAG for Python package, an open source package that Neo4j provides for knowledge graph building and retrieval and agentic work.
- 23:43
Mm-hmm.
- 23:43
And also on this page are all the credentials-
- 23:47
Yes
- 23:47
... you'll need for all the examples we'll be using. And then, um, Nyah, you wanna take it away and talk about the credentials and the GitHub Codespace?
- 23:55
Absolutely. So let's start off, uh, f- let's start off, so we had mentioned we're in the GraphRAG for Python section now, and we want to, um, go scroll down and then click open in GitHub Codespaces. Once we open that, we're, um, you, you're gonna have to sign into GitHub if you're not already. But once we open that, we're just, we're gonna leave all of these, um, uh, system prompts the same, and then we're gonna create the codespace. This is gonna take a little bit of time, so we're gonna do a little bit, a couple of things ahead of, um, not necessarily ahead of time, but
- 24:25
while this is generating. And so while this is generating, I just wanted to show you all that we're gonna be creating this setup environment. And so we're gonna create a copy of this env.example, and you can just click copy here, and we're gonna actually create that, um, within our, um, co- uh, Codespaces section. And so this will continue. Of course, Wi-Fi is not always fun, but this will continue. Eventually, it's gonna have an entire setup for the, um, uh, for the folder
- 24:55
structure, and it'll have a, uh, a .env.example, uh, folder. So we're gonna a- instead create a .env file, and we're gonna paste all of these, um, uh, um, all these credentials in. And actually, what we're gonna do, we're not gonna paste those exact credentials 'cause what we want to do specifically is to, and I had this in the notes, is to create a Neo4j Aura instance. And so I had that in the notes for us to get started on. So create a Neo4j Aura
- 25:25
instance, and w- again, I mentioned we should be creating a free instance specifically for this workshop. You can create a professional instance as well, um, but I already have one that's set up. And so this instance is, um, instance number three here. Um, yours should say type, um, Aura, I think Aura free. Um, but what we will do is that we're going to actually connect to said instance. And so, um, once you do create that instance, actually you'll, um, have a, the connection details
- 25:55
that you'll be download directly to your computer so you don't lose it. And, um, uh, what we'll do is then, um, connect that here.
- 26:04
Yeah. And, um, so really there's a, a fork in the road here.
- 26:08
Mm-hmm.
- 26:08
Don't feel bad if for g- whatever reason, uh, you aren't able to create the Aura instance in time. Um, it'll be ideal for the last part of the exercise if you can, but those other credentials we saw in Graph Academy, they're in a, a small, uh, free instance that's within Graph Academy itself. So you can use those. Either way, we wanna have the connection details to a Neo4j database-
- 26:36
Mm-hmm
- 26:36
... because that's where we're gonna build that knowledge graph.
- 26:38
That's right. Perfect. So what I'm doing right now is I'm grabbing my, um, instance information, and then I'm just gonna paste that here into our, um, our graph. So perfect. We see that there. And then I will also grab the OpenAI key. Yeah, and I'll make this bigger as well.
- 27:05
Move this terminal down. Move this out the way. Perfect. So we want that OpenAI key
- 27:16
as well that we had cr- that we had grabbed, and we'll grab that directly from the notes. So just copy and paste the key
- 27:26
and place it.
- 27:32
Dope. All right. So this will save, uh, if you have auto save or you have to save it yourself. And now we have this. And so once we have that env file, then we're actually gonna want to test our environment really quickly. So we'll go down to, um, test environment.py, and we'll just run this environment. You can actually, if you're using VS Code, then you can run it using this or you'll use, run it using your, um, uh, hopefully a Python virtual environment as well. But let's make sure we do it. Okay. So we can see down here it's trying to connect. Perfect. It
- 28:02
ran five tests, and it's positive. We're okay. So.
- 28:08
Anyone hitting a snag there? If you do, make sure you're actually, you've actually created a .env file-
- 28:15
Mm-hmm
- 28:15
... and you're not still just in the example.
- 28:17
That's right.
- 28:18
And, uh, you can rename the file or create a new one. And, um, that will, it's essentially now we know we're connecting to the Neo4j database and our OpenAI key, uh, is successful.
- 28:32
Perfect. So
- 28:36
now, um, that the test environment is run, this is successful. Now we can take a look and we can see here, um, if you go under workshop.genai, you can see here that we have a number of different solutions. So we have the da- the raw data itself, we have solutions itself, and then the agent, and then the knowledge graph builder, and knowledge graph structured builder as well. So we're gonna click on this knowledge graph structured, uh, builder, and it's going to build out this knowledge graph right
- 29:06
in our Aura instance. And so if you're, again, in VS Code, then we can just, um, pa- uh, play that. And then this process is gonna take a little bit, but it's actually going to generate the knowledge graph, and we can see it populating live within the Neo4j Aura, um, Aura instance. And so let's go over back to Aura. And what I've done as well, uh, um, within here, so again, I'm gonna connect. We're going to go to Query.
- 29:37
And we can see I've already done this, so I've already pre-populated it just because it'll take some while. So it's gonna probably do some deduplication, um, based on the fact that I've already run it. Um, however, um, all of that information is going to, uh, populate within here, and then we can query this, um, and see what's, uh, what exists within the, um, within the instance. And we can see that this knowledge graph, it will-- The more times you query, you'll see, um, that it actually will, uh, continue to populate. So just right now we're just
- 30:07
gonna see what, um, relationships and, um, uh, uh, and nodes are actually here already. So we have P and then so match P.
- 30:37
Oh, done a little syntax there.
- 30:38
P equals.
- 30:39
Oh, thank you. Match P equals. There we go.
- 30:56
Beautiful. So now we can see, and I'll scr- I'll zoom in so that we can actually see what's going on here.
- 31:04
But now we can see all of these different nodes and relationships just based on the data that we had, um, in, that we had ingested into the knowledge graph. And you can click on this data, and you can inspect the data as well. This is not just a visualization tool, but it's also specifically a query tool, a way that you can, um, query your data itself. But this is the finished, um, knowledge graph. Your knowledge graph will be much smaller, and then the more times you run this particular query, MATCH
- 31:35
P equals, um, empty, like a node actually. So empty node, uh, dash dash empty node, then return that P. Um, you'll s-- If-- The more times you run that, the more times you'll see that, that knowledge graph grow. It's just, uh, and the query in general is just saying like, "Show us all the nodes," right? "Show us all the nodes and relationships."
- 31:56
Wonderful.
- 31:59
Okay.
- 32:02
So, once we've got that, um, those nodes and relationships... And, and, uh, for anyone who's having problems with that process, um, uh, feel free to throw up your hand and we'll-- we have colleagues who are, who will come and help you. Um, but once you got that, um, that knowledge graph beginning to generate, then what we wanna do is actually go in and create an agent. Oh, I see a couple hands right behind. Um, so you might not already see this
- 32:32
agents, um, section. If you do not, let me see your hand in your, um, thing. Okay. But I do know a couple people probably are not there yet. Um, but if you don't see this agent section, what I want you to do is to go to your organization, your Neo4j organization, um, and then we're gonna click All Organizations. And what we're gonna do is we're just gonna enable, um, GenAI, um, capabilities onto this organization here. And so we're in this new organization.
- 33:03
Then we'll go to Settings. I already have it enabled, but for those who don't know how to enable it or have never used Neo4j Aura before, um, here we have, um, you're gonna click these two. They'll be, um, they'll be grayed out, but I want you to click them in order to enable them. So Generate AI Assistance, Generative AI Assistance, and then Aura Agent specifically, 'cause we're gonna be building out an agent today.
- 33:29
So... Oh, got a couple hands. Perfect.
- 33:36
So once we have that organization, we're gonna go back to our specific organization. We're gonna go back to our instance.
- 33:44
We're gonna open our instance within query mode.
- 33:49
See our agent, um, see our knowledge graph populating, and then we're gonna click here Agents. And this agent here-- So I already have an agent here, but what we're gonna do is you are gonna create an agent. So we're gonna create an agent from scratch.
- 34:08
And we're gonna tie that agent to this specific instance. It should auto-populate based on the latest instance that you had created.
- 34:17
And we will configure.
- 34:25
And so what we want this agent to do, uh, we're gonna call this agent, we're gonna call it a, um, uh, GenAI Fundamentals. Um, well, actually, we'll call it GraphRAG Fundamentals.
- 34:43
GraphRAG Fundamentals Agent.
- 34:51
Perfect. And then for the description, uh, to describe this agent, we're going to say that this agent provides, um, Neo4j GraphRAG
- 35:08
information grounded
- 35:12
in this specific Graph Academy course that we have.
- 35:25
So we have this agent, and again, for those who are following along, it's going to, uh, provide Neo4j GraphRAG information grounded in this specific Graph Academy course.
- 35:39
And then lastly, we're going to, um, provide the instruction for that agent here. So, um, that instruction will be that, um... And we can really just copy and paste. And what I'll do is I'll also include this in the GenAI notes section so that you can all see it.
- 35:57
I'll go over to the notes.
- 36:04
But this is an easy way to, um, create your agent,
- 36:11
agent description for you all, so that you can copy and paste it and have your agent actually be working with us here. And if you have questions, please feel free to put up your hands. Okay. So we'll just copy that over to our agent as well. We have the, um, instruction, and then we're going to keep everything pretty much the same, the instance, um, agent location as well, and then internal. And what we want to do...
- 36:42
Perfect, is, um, create that agent.
- 36:51
But actually, do we want to-- Yeah. Okay. B- So before we create that agent, we're actually gonna try and, um, add similarity search to it. So if you don't already have, um- Um, similarity search added to your agent or vector search or vector indexes specifically added to your agent, then we actually have to do that in order for this, uh, this prompt to come up. So you'll get a separate prompt that says, um, "Vector search is necessary in order to, um, to do that." So where we get a good, a good place to get that
- 37:21
information, we're gonna close out this re-- Oh, we can keep it open. But what we're gonna do is we're gonna go to, um, the Python, um, Python section. There is another-- Let's see, in the GraphRAG for Python section. Here we go. And I'm gonna paste this into the, uh, notes for you all as well.
- 37:46
I gotta love being in full screen mode. Come on. Come on. I'ma just... I might just exit out full screen. Okay.
- 37:56
And let me paste this for you all. So we're gonna create a vector index. So we wanna go to this link here.
- 38:02
Create vector index. Cool. And that's-- What you're gonna do, you wanna, uh, click that link, and that allows you to, um, that just gives you a sample code, um, in order to create the vector index, and I'll show you where we're gonna put that information right now.
- 38:19
So we have this create a vector index here. You're just gonna copy that.
- 38:28
And then we're going to include that.
- 38:35
So for the vector index-- And I'm gonna ask Jeremy, do you remember where... Oh, where we put our, um, vector index?
- 38:41
Yes. Right, right in the, as, uh, the Cypher query window.
- 38:45
Yes. You're right. You're absolutely right. Okay. So let's go back.
- 38:54
So we'll go out of here.
- 38:57
So this will depend on which instance you're using. If you're using an Aura instance, you're gonna go in your Aura console into the query interface. So you might wanna either open another window-
- 39:09
Yep
- 39:09
... so you can leave your agent, or you'll have to close your agent for a minute and go to Query.
- 39:14
Right.
- 39:15
And then you can create that vector index.
- 39:17
So just like Jeremy had mentioned, we're gonna actually paste that vector index right here in the Cypher query window. And so you'll run that, and then you will see that we'll, um, extend this. Okay, this command, and then this. I think it's-- This is specifically because I had already... Note successful. Oh, yeah, it already exists. Exactly. 'Cause I had already run this. But you're gonna do, you're gonna create, you're gonna run that command, and then it will actually show you the vector index that has been created. So once you have that vector index already
- 39:47
created, then you can then go into the, um, agent section and then, uh, access that prompt that we saw there. So I'm gonna do the same thing again. Create from scratch, configure. And we're gonna do the same thing. GraphRAG, great. Auto populate. Beautiful. Description. Yep. Beautiful. And then we have that same prompt.
- 40:22
Sweet. And then we're gonna do the Add tool section. Now, similarity search. Now, you should be able to see this, uh, the same prompt. But for the similarity search tool, we're gonna create this tool, which will say, we're gonna search this lesson content and be able to actually gather insights from this lesson without having to take the lesson. Search lesson content.
- 40:48
Um, and then we have a description that I'll also paste as well.
- 40:57
And I'll paste that. Make sure that you all have that description as well.
- 41:04
Similarity search description.
- 41:12
Perfect. So now it's in the notes so that you can also use it.
- 41:19
And then we're gonna select the vin-- vector index specifically that we had just created, that is chunk embedding. We're gonna say we're gonna use about the top five, um, uh, as well. And then we're gonna select our embedding provider, that's OpenAI, the embedding model. Uh, we're just gonna use text-embedding-3-small. It's perfectly fine. And then the default dimensions is fifteen thirty-six. And then we wanna make sure that we're, uh, returning this connected graph data, which is very, very important, especially because we're using this, uh,
- 41:49
graph interface. So we're gonna return this graph data. And what you wanna do, we can use natural language here, but you can also use Cypher specifically. But, um, Cypher, sp- for this Cypher query, um, we have-- There's a Cypher query that we already have. I'm trying to remember where it is.
- 42:08
Light mode.
- 42:08
Oh, is there a light mode? That's a great question. Oh, 'cause it is so hard to see.
- 42:13
Or just make it bigger.
- 42:14
Yeah. Let me make it bigger.
- 42:18
Awesome.
- 42:22
So for this Cypher query,
- 42:29
we're gonna take this Cypher here, and I'll make sure to paste it for you all.
- 42:35
This is the Cypher query that we're gonna use.
- 42:48
So it's, it's, um... Oh, actually, I should just paste the actual Cypher query itself, not just a link to the Cypher query. Cool.
- 42:59
All right. So here's the Cypher that we're gonna include in our agent. And what we're gonna do is we're gonna paste that in our Aura Agent here. Same Cypher query, don't change anything. But the, the point here is if you look at the Cypher query, we need that Cypher query to include nodes, as you can see here, nodes, and then scores as well. So nodes and then scores or similarity. And so we can see that this Cypher query specifically uses nodes and scores within its
- 43:28
query. Um, but this is a very helpful query, and I'll also make sure that I link where we got that query as well for you all, just so you can have it for later. Perfect. All right. Now we can create this agent, right? Or we can add this specific tool.
- 43:47
All right. So we have everything here. We're gonna use internal, which is for free. Um, we have these two tools, search lesson content, and then the similarity search, and then the natural language for Cypher tool. And we're gonna create the agent. So we can see GraphRAG Fundamentals agent right here.
- 44:09
So we no longer have to configure it. But if you need to, um, as we were building out that knowledge graph, you can update that agent ju- you can press that Update agent, which will take in all the information from the knowledge graph. So now we can have a chat with that specific agent, and we can ask different, uh, questions with regard to, um, that agent. And I wish I can slide this over, but I can't. But that's okay. So these particular questions, we can ask lots of different questions, um, and, um, you can now learn anything that is actually in the
- 44:39
GraphAcademy course. So, for example, we have information about, um, how does, um, temperature, for example, uh, affect a LLM. And this will take in all the information based on the knowledge graph that we had created within Neo4j, and only that information within the knowledge graph, in order to, um, give you an answer. And I'll make sure that I... Here we go.
- 45:06
And the fun thing is-
- 45:07
Yeah
- 45:07
... for folks to go back later and look in that data directory, you'll notice that all those PDF files were from an intro to GenAI course in GraphAcademy.
- 45:17
That's right.
- 45:17
So we trained this on GraphAcademy, in GraphAcademy, kind of meta, but-
- 45:21
Exactly
- 45:22
... it works.
- 45:22
No, that's perfect. And like, like Jeremy had mentioned, all this information is trained on GraphAcademy. So you have all the information within GraphAcademy at your fingertips here within this agent itself. But it answered that, um, temperature is a parameter that controls the amount of randomness in that generated text, right? You have higher temperature, lower temperature, and what that, um, is based on. And then as well as the sources of information where you can learn more, um, within GraphAcademy as well. But you don't-- you not only are able to ask about the content of the GraphAcademy, but you're
- 45:52
able to do things like get the aggregated information, um, based on GraphAcademy as well. Um, so we can ask questions, um, like, "How many lessons are there in this course?" And so usually when you're building out agents, they... or when you're building out RAG pipelines, they're often pretty bad at doing this, like I had mentioned, this aggregation and concatenation piece. But, um, let's see. We can see that within this specific course, there are 30 different lessons, and it's actually
- 46:22
15 lessons, but it's counting 30 right now because I had rerun the, um, uh, the knowledge graph builder, which had the initial 15 lessons, and then I reran that builder, which created the 30 different lessons. So if we were to, um, then check within Aura, make sure where we are. Oh, yeah. So if we were to go back and just, uh, query, right, we're outside of this, and we were to
- 46:52
just, like, figure out how many lessons, then we could see that it would actually give us the correct number.
- 46:59
And you can even just click on the lesson node type on the left as well.
- 47:03
That's right.
- 47:04
For the cheat code.
- 47:06
So we'll see the correct answer, which is the 15 lessons here within this space, and then the, um, uh, the... because I had reran that, but I did not repopulate that within the, within the thing. So it says 15 lessons, which is how many lessons are in the, um, or within this GraphAcademy course.
- 47:26
So Nyah-
- 47:27
Yeah.
- 47:27
I had some folks that were wondering, now that we've gone kinda end to end-
- 47:31
Mm-hmm
- 47:31
... we built a knowledge graph-
- 47:32
Mm-hmm
- 47:33
... from some raw data. We were, hooked up an agent that can use this now-
- 47:37
Mm-hmm
- 47:37
... using GraphRAG, combination of vector and Cypher queries. They were wondering, could we look at the code that does this really quick?
- 47:46
Mm-hmm.
- 47:47
And so, um, could we look at the code of that knowledge graph structured builder file?
- 47:53
Mm-hmm.
- 47:53
And just-
- 47:54
Yeah
- 47:54
... just do a quick walk through-
- 47:55
Yeah
- 47:55
... just so we see the elements of it.
- 47:57
Absolutely. So let's go into our, um, knowledge graph structured builder. Perfect. So here is all the code that's, that's creating and generating this knowledge graph in itself. So we're seeing, and I'll try to make it as big as possible without also cutting. I would like to do a word wrap. Um, but-
- 48:14
I think you can hide the, uh, the left-hand side.
- 48:16
Oh, yes, absolutely. Perfect. All right. So we can see that here, um, that we are importing all of our necessary, um, uh, portions. So OpenAI LLM, the OpenAI embeddings, the simple KG pipeline, which is our simple knowledge graph pipeline, um, as well as fixed size splitter. But we have here, which is our Neo4j driver, which is pretty much your, um, your core. A- and when we say driver, we really do mean driver, the thing that's generating all of this, right? So we're connecting
- 48:46
to our, um, our graph database using that Neo4j driver. It's the simplest way in order to get connected. But then we see here that we have the LLM. We're stating that that LLM is actually the OpenAI LLM that we have here. We have our embedders here as well, which is those OpenAI embeddings. And then we are, of course, going to use that text splitter fixed, um, fixed size, um, splitter, and we have that chunk size being, um, 500, and then a chunk overlap just in case we miss anything from those specific chunks. And then we have some sample node
- 49:16
types. So those node types here, remember, nodes are the circles, um, and then we have relationships. But the nodes here are technology, concept, example, process, um, challenge, and benefit. And then we have relationship types that we think are really important to this, uh, this knowledge graph. So these relationship types we are populating, but we want those relationships to focus on this related to piece, the part of, used in, et cetera. And then we can see that these patterns, these
- 49:46
patterns, um, which is this node relationship node pattern that we're seeing here. Um, and so we have, for example, technology related to specific technology, right? Or example used in specific, uh, technology. So then after we, we've put all of that sample information, we can see that this knowledge graph builder is taking in this knowledge graph pipeline and all the information in order to generate the knowledge graph itself.
- 50:14
I mean, and that's re- really a, a cool part here is that, of course, we, we did Graph Academy data here.
- 50:19
Mm-hmm.
- 50:20
And a schema appropriate for that. But most of you will be using, like, a bunch of documents from your business or whatever, and you can use the LLM to help you figure out the right schema.
- 50:28
Mm-hmm.
- 50:28
But 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-
- 50:36
Yeah
- 50:36
... types. It'll stick to that.
- 50:37
That's right. Excellent. So then we can see that we're taking in those, uh, CS... We have different CSV files within our data as well, right under data, a n- a different CSV file, as well as all the general PDFs from, um, this lesson, and then it's gonna parse that CSV, um, and then create and generate that knowledge graph all in all. So that's the background behind this builder, this knowledge graph builder that's using GraphRag on the back end in order to create the knowledge graph that we saw within, um, Aura.
- 51:08
Perfect. All right. Yeah. Um, so that is what we wanted to show you all today, um, for GenAI. I'll finish off with a couple last slides and a couple calls to action as well. These are some last, some benefits of using GraphRag. Again, I had mentioned higher accuracy, easier development, and then explainability. But all in all, the best places to learn more about graph and GraphRag is Graph Academy, where you'll see all of these different, um, resources, completely free and hands-on courses, um,
- 51:38
Cypher s- fundamentals if you wanna become an expert at Cypher, um, and, uh, building out knowledge graphs and context graphs. And then on Tuesday, or, or yes, on Tuesday of this week, um, we are actually going to be-- or Wednesday, um, but on July 1st, we're gonna be having a meetup down at the Digital Garage in San Francisco from 5:00 to 8:00. Please feel free to join us, and please feel free to register. Just make sure you come by our booth if you wanna register for that meetup. We're gonna have some incredible experts within the graph and knowledge graph space,
- 52:08
including our founder and CEO, Emil Eifrem, who is going to be there, and you can ask him different questions about building knowledge graphs, as well as the technical team, myself, Jeremy, Zach. Um, we're all gonna be there to answer your questions about your use cases. Um, but this specific talk is about teaching the why behind decisions, so context graph decisions that are being made. And then please feel free to come by and see us at Booth, um, P3, which is right by the Microsoft booth. Um, we'll be there to answer any questions that you have. And thank you so much for
- 52:38
coming today. We appreciate it.
- 52:57
Thank you.