AI Engineer World's Fair 2026
AI on Your Lakehouse: Context Comes in Shapes, Not Queries
About this talk
Neo4j AI Research Engineer Zach Blumenfeld leads a hands-on workshop showing how graph-shaped context makes lakehouse-connected AI agents more reliable. Using GraphAcademy, GitHub Codespaces, Claude Code, BigQuery, Neo4j CLI, and agent-generated Cypher, participants build reusable document-outline trees, thematic communities, and connection paths that federate documents with warehouse records. The session covers semantic expansion, Lucene-backed search, idempotent loading, and finding undocumented field problems; the patterns extend to Databricks and Snowflake.
Chapters
- 0:00Workshop setup, instructors, and lakehouse context
- 6:17Three graph shapes and table-of-contents trees
- 17:20Neo4j CLI and agent-generated Cypher
- 1:00:28Trees, outlines, semantic expansion, and Lucene search
- 1:17:54Idempotent document loading and graph updates
- 1:42:27Agent reasoning and undocumented warehouse problems
- 1:58:39Workshop wrap-up and next steps
Talk transcript
- 0:00
[upbeat music] Hello, everyone. Welcome today to get started on AIE.
- 0:18
Um, so right here, uh, there's some steps for getting started. I went over this around ten minutes ago. Um, but basically, our workshop that we're gonna take today is driven by a website called GraphAcademy.
- 0:32
And if you go to that first QR code there to the left, uh, that'll take you there. You have to enroll with your email. Um, and then if you go down to set up your environment, uh, there's a Codespaces there with everything set up, and you can get that rolling now.
- 0:47
It'll take maybe about five minutes or so. Um, and you can grab your credentials then as well. There's, um, an Anthropic API key. Uh, if you have your own Claude Code key, um, or your, your own subscription, please feel free to use that.
- 1:02
Uh, otherwise, we provided one for you. Um, and then there's another key there for reading from BigQuery tables. So with that in mind, uh, we'll go ahead and get started with AI on your lakehouse, um, which is about context coming in shapes and not necessarily queries.
- 1:21
So today, your team, um, will be myself. My name is Zach Blumenfeld. I am an AI Research Engineer at Neo4j. Uh, we also have Ben Squire over there in the back, um, who is our Senior Developer Advocate, um, as well as Ryan here in the center, um, who is our Partner Architect, helping customers get this stuff up
- 1:43
and running. So as you have questions, um, I don't have a mic set up for you, but, uh, go ahead and raise your hand. I'll sort of... I'll take time around every ten, fifteen minutes during natural breaks, um, and, and I can take some questions, but also flag Ben and Ryan as well if you're going through some
- 2:02
steps and you're having some trouble setting things up, um, and they can help get you unblocked.
- 2:08
Um, so what we're gonna talk about today, um, is really about when you start using, uh, a lakehouse, right? There's sort of two sides, obviously. There's a warehouse, which is your structured data and your tables, um, and then there's the data lake part, which is all of your unstructured documents.
- 2:27
And oftentimes, what can happen is you're given these tools like Text-to-SQL and vector search, and nowadays, we don't really have trouble accessing that data, um, but sometimes there are still some challenges around how you give your agent the right type of context, whether or not they can see all the data in the way that they need, um,
- 2:47
and really take a slice to answer the right type of question. And so what we've put together today inside of our course is an agnostic data model, um, that basically creates a graph representation, uh, both from the structured side, your warehouse, um, but then also provide structure for some of your documents, um, and then allows you to
- 3:08
do a lot of useful stuff with that. Uh, we do have a scenario here that we're gonna go over. Um, we've created a fictional auto fix group, uh, which is, think of it like a, a Pep Boys Auto or something.
- 3:21
It's a national auto repair chain, and they have all of these bays. They have these libraries of manuals on vehicles, um, as well as safety bulletins and recalls, and then a warehouse of all of the repairs that they've logged.
- 3:36
Um, and you have sort of your floor technicians, right? These are the Dannys that are listed here, where they have the cars inside of the bay, and they're gonna need to ask some questions.
- 3:47
Um, you have leadership at this organization that wants to create a co-pilot, uh, to be able to assist these technicians on the floor. Um, and then obviously, you have people like Sam, who are us, the AI engineers, who actually have to build the thing.
- 4:02
Um, and so if they already have their data in a warehouse, what we're gonna be looking at today is the example on BigQuery. So imagine, right, you have your documents inside of cloud storage, and then, um, you have BigQuery as your, uh, data warehouse, but these patterns are also extendable to Databricks as well as Snowflake.
- 4:24
Um, and essentially, if they just create a co-pilot on top of, uh, BigQuery and the data that they have, um, it can pull the data correctly, um, but sometimes it can be confidently wrong.
- 4:37
Um, basically, it could get-- it could pull stuff with vector search from documents, and it can do Text-to-SQL, um, on just a few tables. But when those tables become massive and you get hundreds of tables or when you have large document stores where you have hundreds and thousands and millions of documents, um, things can get lost and
- 4:57
fall through the cracks. And really, where Graph can come in to help with these shapes, um, is not only in these single questions that someone might have about how, you know, I have a broken part that I need to replace and how do I repair this vehicle?
- 5:12
But oftentimes, it's gonna be on these estate-level questions. So things like, for example, what are we missing? Like, what documentation maybe don't we not have to cover all of the different cars that are coming in?
- 5:25
Or what documentation maybe are we not leveraging at all? So this is sort of like proving a negative, which can be very hard with something like semantic search, uh, which can only match similar things, right?
- 5:36
It can't really find a negative example. Um, there's also questions that we have where we want patterns across everything. So say, you know, you might wanna ask, "Well, you know, what are, you know, the common types of patterns that we see?
- 5:49
Is there anything that we're failing to fix over and over again?" Or, you know, are there, you know, specific groupings of different types of recalls that are popping up, and, and things of this nature, where you really need to traverse the entire dataset.
- 6:03
Um, and then the other one is just asking how records relate inside of a large SQL store. Um, and when you have one big lookalike schema where you have lots of similar tables, um, how do you understand how to join those together correctly?
- 6:17
And so there's gonna be three concrete shapes that we'll introduce you to today. Uh, so the first one, um, we're gonna call Table of Contents, and it's somewhat like a tree structure, uh, but with also different types of links between them.
- 6:33
You'll see how it works. Um, this is gonna be used on the unstructured data. Uh, on the unstructured data side as well, we have something called Themes. Um, and what Themes does is it surfers- services global patterns inside of your data that might not be apparent, um, or you might not know about beforehand, so uncovering unknown patterns
- 6:54
and groupings. Um, and then the third one, which when we take the course, we're actually gonna go over first, is this Connection Shape, which is essentially a semantic layer on top of your data warehouse.
- 7:09
And so how many people, just a show of hands here, are familiar with, like, graph and GraphRAG?
- 7:18
Okay, so a, a fair number of you then. Uh, how many people in here have used Neo4j before?
- 7:25
Okay, also, like, uh, maybe thirty, forty percent, something like that. So this room seems like, you know, fairly, fairly, uh, fairly familiar with graph basics, but I'll, I'll go over it just here really quick.
- 7:37
So Neo4j, we're, we're a graph intelligence platform. We have a graph database at, at, at the heart of it, right? Um, and basically, when we talk about what a graph is, we're talking about it from a property graph data model perspective.
- 7:53
And so everything inside of our database and our analytics platform is modeled to these three different types of elements, which is nodes that represent people, places, and things;
- 8:04
relationships, which are the verbs or associations between those things, so, like, person owns car, person drives car, person is related to other person;
- 8:15
and then we have properties that go on these, both, uh, relationships or sometimes we'll call those edges and the nodes, which are sometimes called vertices. And those can be anything from strings, they can be numbers, they can be dates, they can be vectors, um, um, all sorts of things.
- 8:35
And so the basic idea with a graph, right, is as you start adding data to it, it's almost like a bunch of pre-joined tables, and everything's already interconnected, and you can hop between all the nodes very easily.
- 8:46
Um, and that provides a ton of benefits that we'll see, we'll see later in the course.
- 8:52
So with that in mind, why don't you go ahead and get started and go over into these if, um, if you haven't heard before, and I'll actually just show you here really quick, um, inside of the Workshop Lakehouse.
- 9:08
I have it open here. I should probably restart this guy really quick.
- 9:16
Start my code base. Um, but basically, it should take you to this page. Um, this shouldn't-- wouldn't say Continue Course for you. If you-- if it's your first time going to it, it would say Enroll to Take the Course.
- 9:30
So you have to go through that path to enroll to take the course. Um, and then basically the whole thing from here on out is just gonna be me guiding you through this course and kind of showing you all the different, uh, things that we can do.
- 9:44
Um, there's about seventeen lessons in here. We've broken it up by the different shapes. Um, but basically, if you go into the course,
- 9:54
you can kinda click through here. I go over this scenario a little bit. But while I'll do that, I think what you should do is jump to this Environment section.
- 10:03
So basically, you go down to the bottom here. You go to your environment.
- 10:12
And, um, from here, you can say Open Codespace.
- 10:17
And in fact, I will open a new codespace here just so that I can, I can walk through it, uh, live with you as well. [background noise]
- 10:27
Yeah, of course. Um, go back to here.
- 10:39
Why don't you all go ahead and capture that?
- 10:56
Yeah. So it'll create a codespace in your own GitHub. If you want, there's a link to the repository. You could run it locally. Um, just keep in mind that we've set it up so that it will auto-start in the codespace.
- 11:09
So there's another, um, Bash script that you can run to run it locally, and it will, it will set everything up for you. Um, but it, it depends a little bit on your local environment.
- 11:19
You have to make sure you have Claude Code installed, um, and, and all these sorts of things. So we'd recommend that you use the codespace one. If, if you're comfortable doing it locally, I, I, I've run it locally all the time before too.
- 11:38
All right. Everyone's, everyone's copied the, uh, QR code?
- 11:46
I'll give it another ten seconds or so, and then I'll, I'll move back over. [background noise]
- 11:52
Yep, Ben and Ryan can help you out if, if you don't have this one.
- 12:02
Okay. So when you start up as well, there's some workshop credentials here. Uh, I'll, I'll be, uh, blasting these keys, uh, af-after the course. I'll leave them up for just a little bit.
- 12:16
Um, but basically, give it some time to start up. Uh, o-once it, once it does, what you'll do is you'll go into your environment file here,
- 12:28
and maybe I can make this just a little bit bigger so it's easier to see. You will place your Anthropic key in here, as well as the, uh, the BigQuery key.
- 12:38
The other thing that you're gonna wanna place in, uh, if you go back to the course,
- 12:44
um, is down here, it should give you
- 12:52
a, um, Neo4j credential. So this is accessing our graph database.
- 12:59
They've been all pre-provisioned, so it's gonna be different for each one of you. You're gonna have a different one, so copy the one from your screen, um, and you're gonna put it inside of this environment file as well.
- 13:11
Um, and it, it will take a while. Like you see with mine, the environment file hasn't, uh, quite popped up yet, so it can take a few minutes for that all to go through.
- 13:27
Um, so we'll, we'll give that a little bit of time to start up.
- 13:32
Hopefully, it won't take too long here. While that's running, I'll, I'll give a little bit of an overview here of what we're gonna do in the next step. So basically, once we get this set up and, and we get Claude up and running, um, we're gonna walk through, um, the first shape for our day, which is this
- 13:55
connection semantic layer shape. And then after that, we'll follow it with the table of contents one that we were talking about and the communities one. So we'll be working with the structured data first, and then moving into the, into the unstructured bits.
- 14:13
Um, once for those of you who do have it loaded, basically, you have your terminal down here. You can go ahead and call Claude. Um, we'll be working through Claude Code as our agent.
- 14:30
Um, the internet is a little bit slow too, which is expected.
- 14:51
As you go through with this as well, I should, um-- Oh, here we go. We'll set up.
- 15:02
Show you what this looks like here in a second.
- 15:05
The Anthropic key, as well as BigQuery one.
- 15:38
All right, perfect. Um, and if it does this, where it's trying to get you to do a subscription, basically what you do is you'll go plus, open up a new terminal window,
- 15:55
and then it should here give you the option to select the Anthropic key.
- 16:01
Just go through and press Enter. Yes. And then you wanna use the MCP server here, so you're gonna select yes, and I'm gonna skip the tour.
- 16:14
And then I can ask that question just to make sure it can connect to Neo4j.
- 16:43
And for me, I already have some nodes in because I'm working with, um, a graph that's been cached already from my previous course.
- 16:51
Um, for you, it will, it will come up as an empty sandbox. So one thing that, uh, I want to note here too in terms of how we're gonna be working with Neo4j and with Cypher, which is our graph query language.
- 17:07
I, I think we've come to a point now where a lot of us aren't ha-hand typing, uh, our own code line by line anymore. We're using agents to help us build things, obviously.
- 17:20
And so in this workshop, it's going to be the same thing. Basically, we're going to be using something called the Neo4j CLI, um, which is, uh, a CLI tool that will allow your agent to run, uh, queries directly against the database.
- 17:36
When I was working inside of Claude, you saw it running there for a second, and that also ships with a Neo4j Cypher skill, um, that allows the agent to sort of leverage how to put queries together in the most modern way, as well as something called a GDS skill, which stands for Graph Data Science.
- 17:54
And we'll use that for some of the algorithms when we get to the theme section, um, in terms of just helping us do agentic coding. So I'm not gonna have you guys handwrite really any, um, Cypher query code.
- 18:07
I'm going to show you throughout this workshop how to use an agent to help you write that with, with specs that are created. Um, and hopefully that'll be useful for you more on, on the day-to-day if you ever decide to use, uh, Cypher, um, whether it be with Neo4j or not.
- 18:29
Um, so how is everybody doing now? I, I'll take a second here to stop. Go ahead and raise your hand if you have any questions here. Or are we all good?
- 18:43
I have one question over there.
- 18:48
Can I use this in my cursor, or like can I just put that link in my cursor document now inside of [inaudible] for a follow link?
- 18:55
Yeah. So the question is, "Can I use cursor?" And so the answer to that is you should be able to, yes. I haven't personally tested it, but if you go up to the top, there should be a link to the repository that we're using.
- 19:11
Um, if not, when you go to open code... Yeah, you can clone the repository here. So if you follow that link, you could clone it, you can get it locally.
- 19:21
Um, and then you'll see here there's directions. There's a shell file that you can run that will set everything up. You can take a look at what's in there.
- 19:28
It's a, it's a bunch of basic stuff. Okay, awesome. Yeah, and just a little bit about the structure of this thing I forgot to mention. Um, there's a lot of stuff inside of the, uh,
- 19:41
inside of, uh, the, the workspace here. Um, obviously inside of .Claude, we have our skills file. Um, so I've gone ahead and pre-written a skill here, um, that covers basically a lot of what we're going to do.
- 20:00
Uh, inside of here as well, there's, uh, a file called, uh, outline and search and themes. So these are gonna be the shapes that we'll be working with. Um, to query BigQuery, there's just a very small, um...
- 20:14
Well, that, this is actually a, a database query file. But the run SQL one, this one for querying BigQuery, just a very simple, um, um, basically way of, uh, reaching out to BigQuery and just calling it with a, uh, with, um, a simple, uh, SQL command.
- 20:32
Um, and inside of these files, as we'll see later, there's, there's places to fill in a spec, so that's gonna be where we do some of our agentic coding.
- 20:40
Um, but everything in here, if you wanted to like load this into BigQuery yourself, there's something for that. Um, if you wanna go ahead and run this on Databricks, there's directions here to like load it into, into Databricks and use Genie and AI Search there if you wanna compare.
- 20:57
Um, and then this is just a, a symlink over back to the, uh, .Claude files. Um, there's solution scripts as well. So if you get stuck, for example, where for some reason the coding agent can't, you know, create the right query, um, you, you can copy stuff from there.
- 21:13
Um, and then all of the source data too for creating both the structured and unstructured data is in here, um, including our, uh, PDF sources. So if you go in here, we have our bulletins and our manuals and everything.
- 21:30
Um, this is showing you the, uh, the raw PDF, but if I go to the corpus, which is the, the markdown version, uh, you'd be able to, to actual re- actually read the contents inside of them.
- 21:42
Um, so anyway, with all of that, we'll go ahead and hop along to our first section here, which is going to be connections.
- 21:57
So we have basically our data inside of BigQuery right now, and in fact, if I go back to my overview just to show you what it looks like really quick, this is the, uh, schema.
- 22:11
Uh, so we've kept it very simple for this course. Obviously, in, in the real world you'd have a much bigger schema than this. Um, but we have our work orders, uh, which is sort of like the middle or the star of the schema.
- 22:23
You have your vehicles, um, the different, uh, DTC codes, procedures, uh, work order parts, and then the parts themselves. Um, and they join together in a very simple primary foreign key pattern.
- 22:36
Um, we'll get into our documents later in the course. It's just basically a, a big bucket of, of PDF files.
- 22:44
And so what we wanna do here is to help our agent be able to effectively join everything together. We're gonna give it a graph representation of a semantic layer.
- 22:58
And to build that semantic layer, we're gonna use something called NeoCarta. Um, NeoCarta is a labs project. So at Neo4j, we have our core engineering, which is like our, you know, cloud SaaS platform, um, our graph analytics stuff and all of that.
- 23:14
But we also have labs projects where we move a little bit faster. Um, and inside of that labs project, we created this NeoCarta, um, and what it does is it creates a metadata graph.
- 23:25
Um, also, although we're not leveraging it here, you can add business terminology and business processes and a whole bunch of other things into a graph structure. Um, and if you think about it, people, you know, these words ontology and semantic layer and all these things are kinda, they're thrown around a lot lately, especially this summer.
- 23:43
And so the, the basic, uh, mental paradigm that I use to kind of think through these is an ontology helps something interpret and reason about the data. A semantic layer helps something understand what the consistent agreed-upon terms are, so it can query the data accurately.
- 24:00
Um, and then at Neo4j, we have other things like virtual graph. There's a link i-in here in the course which will actually give you a sort of a, a federated graph view of your SQL data that you can, um, that you can query over directly with Cypher.
- 24:12
We won't be using that here, but there, there is, um, sometimes, uh, value in, in giving sort of a, a graph view of the schema. Um, but anyway, what NeoCarta will do is it, it we'll see in this next section- Um, uh, it, it has an MCP server basically that will sort of suck all the data in
- 24:33
from the, um, from BigQuery, just the metadata, and it will create this graph. Um, and that's what you do in the next section. So I'll go ahead and jump to there.
- 24:45
And I've already run this script, but basically when you see this script, what you're gonna do is you're gonna copy it, and then you're gonna go over to here, and then, um, you're gonna bring up your terminal, which...
- 24:58
Oh, pull up our terminal. And then, uh, I like to just open a new window that's not my Claude window. Um, and you're gonna allow paste, and then you're gonna go ahead and run that.
- 25:12
I've, I've already run it, um, so I won't do it again, although it should be idempotent. Um, but basically once you run that, uh, it'll create this, um, these six tables with these five reference join paths.
- 25:28
And once you've done that, you can come back in here and even just run this to check. And it's kinda cool what it looks like. Um, this is, this is what it looks like inside of the graph database.
- 25:38
And basically what you'll see is you have this, uh, this node in the middle that represents your, um, your, well, first your database, and then your schema. And then if you follow that out, it'll be Has Table, and then you'll have your table, and then you have your columns.
- 25:58
Um, and those can also optionally have these representative values on top of them.
- 26:04
Um, and so these join paths, basically, when the agent reads that, um, if I was to go down here and try. So I have, um,
- 26:15
a little example prompt down here, and I can go into my window and go back to Claude,
- 26:25
and I can ask a question like this: "Which vehicle received part IC2042?" And I, in this case, I'm gonna tell it to use the, the MCP server and the warehouse schema and all this to, to go and grab everything, then use the Python script.
- 26:40
Um, in- inside of this skill itself, it, it has directions for this as well. Um, but what you'll see it'll do...
- 26:49
Get rid of this. Yeah. It'll call that MCP server for NeoCarta, and it's, it's gonna read that metadata semantic layer graph that we have in Neo4j. And so if you notice, the thing that we're doing here really is we're not using the graph to copy the data over.
- 27:10
There's not like an ETL into graph. What we're doing is we're using the graph as a semantic layer. So we're just pulling metadata about the columns and the rows and all of these things, and we're gonna use that to inform a Text2SQL query.
- 27:27
Once it, uh, decides to go ahead and run here.
- 27:43
How is Claude working for everyone right now? Are we seeing a lot of, uh, slow Claudes, fast? Yeah, slow? Okay. Interesting.
- 28:03
I'll give it a little bit of time here. I don't know why it would be go- moving...
- 28:08
Huh, a little bit slow. Does anybody need the QR codes?
- 28:28
Does everyone have a copy too? Zach and I both have QR codes if you want one. Yeah. Does everyone have-
- 28:34
I have the other one too. Yes. Is it possible to just, like, for some people who are a little bit further behind, just,
- 28:45
like, recount how you got to here just while we're waiting? Yeah, sure. So the question is, can I recount how I got to here while we're, we're waiting for Claude to come along.
- 28:55
So basically, um, the QR codes that are being passed around, there's two here. Uh, one of them is, uh, to enroll in the course. So the course that I'm going through is online.
- 29:08
It's freely available, so anyone can go. Uh, once, once you show up inside of the course, basically you'll see a button here to enroll. Um, so you have to sign in and enroll in the course.
- 29:19
Uh, once you do that, you'll, you'll click through, and you'll make it to this environment section. Um, and when you do that, uh, it'll take about five minutes or so for everything to, to populate and come up.
- 29:33
Um, if you're using Codespaces, you have the option to run it locally. Um, but then once you do that, essentially, um, you're gonna come in here, and you're gonna get your credentials, and you're gonna grab the Anthropic API key, um, as well as the, uh, the BigQuery key here.
- 29:52
Um, and then on- once you do that, you'll be able to, um, access all the things in, in the workshop basically. Um, you're using, as you saw here, um...
- 30:03
Oh, cool. We're actually making progress. Um, we're using Claude Code inside of, inside of Codespaces here.
- 30:15
Sorry. Can you just run us through Sorry. Can you repeat that really quick?
- 30:19
Can you just run us through when you go through the Neo4j sandbox? Yes. The Neo4j sandbox
- 30:25
is, um, if I, if I were to go back to that environment section
- 30:33
Um, you see the button here to open Codespace, and then you should have down here, um, your own sandbox credentials. So it won't be these exact ones because it's, it's different for every participant.
- 30:48
But you'll go ahead and copy those, and then once you're in here, uh, you'll be able to, um... You have your .environment file, and inside of your .environment file where you put your Anthropic and your BigQuery key, you'll also put the Neo4j ones.
- 31:05
If you don't see a .environment file, and you see nothing, or you see the .env.example, it just takes it a while to populate that. There's other things that are running.
- 31:14
It's running another shell script to kinda create everything for you and, um, populate all the different files.
- 31:22
So my, my hunch, and someone can scream at me if I'm wrong, is that if Anthropic's this slow right now, it's more of a Anthropic problem and not necessarily a one person's account problem.
- 31:35
Um, if it continues being bad, I might try to provide another key from a different account, but I don't actually think that that's what the problem is. I think it's, it's- [laughs] Yeah.
- 31:46
Well, yeah, but this should also be running remotely, right?
- 31:49
I think it's the Wi-Fi.
- 31:50
Is it the, is it just the Wi-Fi? Okay.
- 31:54
The Wi-Fi might be bigger bandwidth.
- 31:55
Yeah. Well, the funny thing is, I would think in c- Well, never mind. I don't know. It's running in Codespaces, but maybe Codespaces is still using the, the local, uh, the local Wi-Fi.
- 32:05
Um, okay. So, so we're back here. Basically, what- basically, what it did to grab this list is, um, it, it went through and it, it basically read, um, that metadata graph, um, and then it created the, um, the different, uh, queries that it wanted to run.
- 32:28
And you can see it ran that, the small SQL, uh, Python file. Um, and it, it did all of its selects and its joins to be able to, to pull together, uh, these tables that list out, um, the, the answer to that question essentially.
- 32:43
Um, if I was to go back, the question here was, uh... What, what would we ask?
- 32:50
Go back to the connection shape. Um, yeah, which vehicles received, you know, these, these separate parts over here. Um, and, and it, it provided that list, um, down here by, by make apparently, um, and then vehicle count.
- 33:13
Um, so that's the basics of this first shape, and you can imagine that as your data starts to grow and you start to get more and more tables, it's very useful to have this semantic layer, um, to then help essentially guide how everything joins together.
- 33:28
Uh, in this case, it used a primary foreign key, uh, relationship inside of the information schema inside of BigQuery. Uh, to enforce that, NeoCarta can also use things like query logs, or you can sort of manually put together how you want things to join with other terminology and metrics.
- 33:45
Um, are there any, uh, questions about this first sort of connections, graph, semantic layer shape that we're working with?
- 33:57
Yes, I have one over here.
- 34:01
Um, yeah. I guess just the question is, is, um,
- 34:05
can you give us a little bit more context around the Neo4j and the Near Quarter concept and how those two connect together?
- 34:14
Neo for you. So the question was, can you give us more context into the Neo4j Near Quarter, like what we're doing strategically? Um, so what Neo4j is doing strategically and this right here.
- 34:26
So Neo4j as a company, right, we're-- For a long time, you've been able to import data into our database and represent things as a graph, which is very useful if you're trying to run these graph-specific queries, right?
- 34:39
So if you have a supply chain, for example, and you need to find an optimal route from point A to B, and you have to do these like variable length, you know, shortest path type of calculations, a graph database is very good for that.
- 34:52
But the other thing that a graph database is really great at doing is not just making those complicated queries run faster, but actually providing a view or a representation of the data that allows an agent to understand how tables might interrelate, so that even though the end join, it might only be a three or four-hop join, you
- 35:12
might have had to understand hundreds of tables or something to be able to arrive at that conclusion. And so we're focused a lot right now on these concepts of ontologies and semantic layers in what we're calling virtual graph, where the focus isn't only just ETL-ing data in, but about, okay, maybe you wanna keep your data where it
- 35:32
is, and you still wanna use SQL and, and access it in, in the ways you have been, but you need some way to sort of guide the agent to be able to do that correctly.
- 35:41
Um, so NeoCarta is a labs project. We also, uh, just recently, um, in preview have released, uh, something called virtual graph, which will be similar, but it essentially gives you, um, almost like these push down Cypher queries.
- 35:56
So it gives you a graph schema of your, of your database, and then it allows you to run Cypher directly, um, which can be useful because then you sort of have the view down at the query interface level and not just at the metadata semantic layer level.
- 36:09
So there was a table in there, um, in the previous section that was kind of explaining that. But hopefully that's helpful, so you understand kind of where, where we're going with things.
- 36:19
Yeah, that's great. I use that in the DT and the whole [inaudible].
- 36:23
Yeah, yep, graph and yes. And we're doing a ton of stuff inside of context graphs as well and, and, and, um-
- 36:30
Very interesting
- 36:30
... in all of those layers. Yep. All right. Awesome. Um, any other questions?
- 36:36
No.
- 36:37
Okay. I have one question over here.[inaudible]
- 36:43
on top of the actual existing table. If the
- 36:49
existing data like that OLTP, whatever, transaction data, why won't we just put that into the graph itself? Would it be maybe like dependent on the graph or would it not necessarily be protocol dependent?
- 37:01
Or also like engaging with that one-
- 37:03
Yeah. So, so the question is, um, why would we not take our OLTP data, which right now is this warehouse of vehicle orders and, and stuff, and just migr- and just push that into the graph, right?
- 37:16
Or some subset of it.
- 37:16
Or s- or some subset of it. Why wouldn't we just push that into the graph? Well, I think in a lot of cases, that's easier said than done, right?
- 37:25
Because if you think about a lot of production use cases, you can have terabytes of data which gets updated continuously. And so, right, if you had to put that into the graph, you would then have to find some way of syncing that while you move everything in.
- 37:40
Um, and there's might be a lot of extra properties or things that you might need to build a custom ETL, where there's some things that you might not want in the graph.
- 37:49
And then a lot of times what people end up not really understanding until they get in those situations is the security posture. Because if you have sensitive data that's in one system, it might not a- even though you could physically move it in, you, you might not actually be able to, for security reasons, take that data and
- 38:06
just move it into another database. Um, so, so there's various reasons why you might not necessarily want to move your data over. Uh, where you do get an advantage of the ETL over just this metadata and semantic layer graph is if you have graph queries that need that performance, right?
- 38:24
So, like that supply chain case that I had earlier. Like, if you're doing these really large recursive joins, and you need them to happen very quickly, or you need to run graph algorithms, maybe you need to produce graph embeddings, or you need to do some sort of clustering or something.
- 38:38
In that case, it makes a lot more sense to, to bring the data in. Um, and then as we'll see in the next sections, when your data's already unstructured, uh, there's benefits to bringing it into a graph 'cause then you can give it a graph structure.
- 38:51
All right. I saw one other question over here. Yes.
- 38:59
Yeah. The semantic graph, every time you initialize, you talked about it, does it rebuild the graph?
- 39:03
So the, the question is, does it rebuild the graph every time you initialize Neo Carta? And the answer to that question is no. What it will do is, basically, when, uh, we, we ran that build connection script, um, it went ahead and ran an MCP server function that ports the data in.
- 39:22
Um, and then once it's ingested into Neo Carta, just the metadata, then that stays there. So, like, for me, I didn't re-run that build connections, right? 'Cause I just took the course last night.
- 39:34
Um, so, like, for me, I-- And I probably could have 'cause it, I think it's an idempotent load, but I just didn't wanna deal with it. So it was there for me, and then I just ran the queries on top of it.
- 39:44
Yep. All right. Any, any other questions? I have one over here at the end.
- 39:53
Yes. Yes, here.
- 39:56
Can you go over the skills for, uh, writing Cypher, just the structure of it and how you landed on
- 40:04
that skill?
- 40:05
The, the Neo4j Cypher skill?
- 40:07
Yeah.
- 40:07
Um, so I don't know if... I might be able to, uh, grab it really quick. Um, I can show you Neo4j Cypher skill. Um.
- 40:26
But this is-- These are all developed internally by our team. So if you go here, actually, through the Neo4j CLI, you can download a ton of these skills. So if you see here, there's, there's the Cypher one, but then we also have the different ones for, like, agent memory, for cloud infrastructure, for different drivers, like if you're
- 40:44
using Java or Go or, or all those things. Um, so I can't necessarily say exactly how we landed on this particular skill MD, but what I will tell you is it was created by us and our internal teams who are, like, always up to date on the latest, you know, Cypher '25, '26.
- 41:04
Um, so, so it, it, it has all of the latest. So I'd, I'd encourage you to use the Neo4j CLI because it will basically-- You can load one or multiple of these skills, and you'll get the latest knowledge there.
- 41:19
'Cause it-- Otherwise, what the, what it's gonna do is it's gonna go on the internet and get the Stack Overflow questions from, like, four or five or six years ago, and it's gonna give you outdated bad Cypher, basically.
- 41:29
Is the, uh, Neo4j's, uh, CLI loaded into the skill?
- 41:33
It is, yes. It is loaded in and, uh, if you look at the, um, the install file that we use inside of dev container, uh, you'll see, um,
- 41:45
where we installed the Neo4j agent CLI in the skill. So the command's in there, um, that, that basically allowed you to do that.
- 41:54
All righty. I'll take one more question, and then I think I'll have to move on to the next section unless there isn't another one. Yes, right there.
- 42:02
Um, when you talked about, uh, using specifically semantic layer on datasets that are more, maybe that can have, uh, let's say like bronze, silver, gold, maybe that can have more structure.
- 42:17
Um, bronze. So, so, like, del-- the different, like, Delta tables where. Um, so I mean, we're, we're exploring basically, um, the traditional, like, SQL structured data warehouse. And then Neo Carta Is really customer-driven for us.
- 42:35
It was made by our field team. So as customers come in and they have questions about less un- less structured data, um, and even things like documents have been considered for NeoCarta.
- 42:47
And so there's this backlog that's forming right now. Everything's moving very fast. I think-- I mean, Ryan is, is somewhere in the room, and he might be able to, to speak on sort of what's, what's the next thing for NeoCarta.
- 43:00
But I know we're working right now on a Databricks connector, um, and maybe some metric views and other things. [background noise]
- 43:16
All right. Awesome. So meet with, uh, with Ryan afterwards. And then everyone watching on YouTube, I guess, can meet with Ryan afterwards. But by then, we'll, we'll have-- we'll have an amazing NeoCarta, so.
- 43:28
All righty. So, so let me go ahead and move on for sake of time because we're coming fifteen minutes on the halfway point, and it might be nice to take a few minute break at some point in the middle just to, just to give ourselves a little bit of a breather.
- 43:40
So now I'm gonna jump to the next section. So that was working with structured data, and now I wanna work with unstructured data. And this is going to be the documents part.
- 43:53
So we have-- If we go over to our little, uh, our little, uh, source data stuff here. So in this case, I'm, I'm gonna read them locally to load them.
- 44:06
Um, but, you know, it's reading from cloud storage, reading locally. Um, there, there often isn't a huge difference. Um, basically, we have these bulletins in PDFs. Um, we have manuals which are considerably longer, um, and then we have recalls as well.
- 44:25
And 'cause it's giving me this funky view, I also have them in, uh, in this raw corpus where they're, they're inside of, um, these, uh, markdown files here. Um, but basically, uh, they're these multi-section documents, um, and you'll see here that they have, uh, this linking that they do to go over to different sections in other documents.
- 44:50
So they're all kinda interlinked together as they refer to one another. Um, so for example, right inside of, inside of this manual, um, it talks about these different platform codes for this ABS system, um, and, and diagnostic troubleshooting, right?
- 45:05
And it, it will link over to there. All of this data, by the way, is I simulated. It's not sensitive or, or anything like that. Um, but it's meant to simulate kind of a real-world, uh, system where you have these manuals and bulletins and recalls of all these different vehicles.
- 45:20
And, um, what we want to accomplish with this basically is we wanna give our agent a table of contents. And, and by a table of contents, I mean something that looks like this thing.
- 45:32
So what I want to allow the agent to do here is not just search for key terms. We'll give it search too. But I don't know if-- Has anyone heard of, like, Page Index?
- 45:44
Anyone know who they are? Maybe some of you. So there's, so there's this idea of navigation through your documents, where basically almost like a human, if you look at the table of contents inside of a book.
- 45:58
It's not-- I'll call this outline. I'll call it table of contents. It-- I need to get the terminology a little bit better aligned. But the idea here is that you can sort of read the indentations, and you can see how you have a document, or in this case, a library.
- 46:14
You have the bulletins, which is a subfolder, then you have these documents underneath. And so you have this containment tree. And then in addition to that containment tree that gives you all these sections, you also have these links that'll take you to a different document.
- 46:30
So it's more than just a table of contents. It's a tree that goes down. It also has these links, right? And these links and basically everything in here have a URI.
- 46:43
And the idea is that if we can come up with a good graph representation, we can basically make it so that these URIs, which are hierarchical, so you see like you have your technical library here, right?
- 46:56
And then slash bulletins. So, like, if I'm down in, you know, this TSB recall notice, I know that it's part of bulletins, um, or no, safety bulletin rather, not a recall, and it's part of a technical library.
- 47:09
Just like it's also linking to a manual here. Um, and you can see the name of the manual, and then it's inside of the manuals subfolder. Um, and if I have that, I can take that, and I can plug it in, and I can actually grab a node from the graph that has, like, the raw text or,
- 47:28
or even a link to the raw text. And so-- And then if I, uh, plug this in, and we'll see how this works with outline later, I can actually get these subtrees, so I can, like, dig in and drill down on these different pieces of content.
- 47:41
Um, that's the general idea with this. And so what this gives the agent to do is not just search, like vector search or, or lexical search, but actually kinda traverse through the documents in a sense.
- 47:53
Um, and the data model that we're gonna use, in this case, we're actually gonna import the data into graph. Um,
- 48:04
I have a, I have a quick question for everyone. So everyone here is, is-- knows GraphRAG. When they think of GraphRAG, and maybe someone can raise your hand, and I'll, I'll pick on someone for a second.
- 48:16
I want you to tell me what you think, like, the pro-- the, the building the graph process is for GraphRAG. So I don't know if anyone wants to, wants to volunteer if they're familiar.
- 48:27
You know, raise your hand. Yes. [background noise]Yeah, and they build, they build the, they build the links from,
- 48:50
from the... So there's different ways, right? And, and you said, I think in, in your-- when you talk about creating, um, a graph, you build the links from the data that's inside of the documents, right?
- 49:03
And so GraphRAG, oftentimes we have a, an entity extraction piece to it as well. So we can use an LLM to kinda say, "Hey," like, "extract the different parts, the different vehicles from the, from the graph, and have them be separate entities, and then have those links to, like, the original document chunks and all, all of this
- 49:25
stuff." And that's great, and that works really well. Um, here, what I'm gonna show you is something that's much more lightweight. And I think maybe to the point that you were making, um,
- 49:38
we're actually going to use a deterministic loading. So if you see here, the way that this graph structure is gonna work is you're gonna have your library, and then you're gonna have this containment tree that reflects what we saw.
- 49:50
And all this is really doing is it's breaking down. You see the folders, the document, and then these documents have sections. And they can have multiple sections that will also nest underneath each other at different section levels.
- 50:05
Um, and then you'll have, um, next section links, so you get a concept of ordering, as well as linked to, which uses-- In this case, we're using, um, these named links, uh, sort of like you might see inside of an Obsidian vault a little bit.
- 50:22
Um, but you can also do it with hyperlinking and oth-other things depending on, depending on what your data looks like. So it's all deterministic with the containment tree for one, and then the ordering of the sections, as well as the links.
- 50:36
Um, and the benefits of having a deterministic load like this is, number one, it's gonna be idempotent. Um, so, like, you're not relying on an LLM in the beginning.
- 50:46
Um, it's often going to be a little bit faster. Um, and so if you already have documents which have a lot of inherent structure to them and a lot of interlinking, um, sometimes just to get something up and running quickly, it can be very beneficial to approach a graph like this where I'd say it's more of a
- 51:02
lexical or a document structure graph rather than, like, a full, like, entity, uh, you know, extraction type of pipeline to create a graph.
- 51:11
Um, and it, it explains here what I just said with the different link types. Um, and then-- And, and like I said before, these URLs carry a hierarchy. So every node, for example, that, that head node at the top here for the library will get its URI.
- 51:29
Manuals will have that plus backslash manuals, um, going down sort of the containment tree to the, to the file name and then the different sections.
- 51:41
And, um, this is the script you're gonna copy to load it in. So basically, again, you'll take this, you'll go over to here, um, you'll open your bash terminal.
- 51:52
Now, I believe I've already done this, so I'm not gonna run it again, even though I-I'm pretty sure it's idempotent. Um, but basically, once you run that,
- 52:02
um, what you'll end up getting is-- And I'll just make sure it's actually in the graph. It is for me. You'll end up getting that, uh, that model that we just saw.
- 52:10
It should only take... Well, now it might take a while if the Wi-Fi is slow, although I don't think it should. Um, but it'll create this graph for you where you have, again, your top of the folder structure, which is our technical library, our folders, and then you can see we have our documents followed up here into
- 52:29
our different sections. And if I were to zoom in
- 52:33
here, um, you'll see we have the Has Links in the next section, but then we also have the Links To. And I can go in and click on these, and you can see kinda how the thing grows and everything kinda links to each other.
- 52:48
And now that we have that, um, basically in the next section, we can go ahead and build our tool, um, basically the script that goes along with our, our custom Autofix skill that we've created, uh, to, um,
- 53:06
to actually, like, create that outline shape that we saw in the beginning, the, the table of contents to hand our agent. And so if I go ahead to that next section,
- 53:17
um, and again, like I said, what I want to do here is I'm gonna go ahead and copy this. This is the, this is the prompt, um, where if I go ahead and feed that to my Claude,
- 53:35
it should go ahead and get to work.
- 53:39
Nope. And because I know that's gonna take a while, I'm gonna have it start running here. But basically, what it's doing as it goes through, um,
- 53:54
is if I go under and I look at my skills, um, you'll see that I left
- 54:01
inside of here, um, this wired query. This is, this is the query that it needs to create, um, to be able to create that outline shape. And I've instructed it inside of the language here to use the Neo4j Cypher skill and reference a spec in doc outline format.md.
- 54:23
So this is generally how I like to write more complicated Cypher queries, more complicated graph queries, is I'll write a spec for it. Um, and so if I go to my docs folder, you'll see I'll have my specs in here.
- 54:37
And I have my outline format spec where I say, "This is the shape," right? And then it, it talks here about how it needs to be human-readable. And, uh, yes, we will allow you to edit.
- 54:51
And, um, and some of the optional arguments it needs to have. So,
- 54:57
right, 'cause oftentimes it's like pseudocode that we'll have, and we don't know exactly how to put it together. Um,
- 55:06
yeah. Um, in this case, I did give it the hint about having a variable length path query, uh, to basically put everything, uh, put everything in order.
- 55:28
And then it will say when it's done. And so basically what you'll get out of that is if I go back here, and it will talk a little bit about, like, one of the keys to this you'll see in the file is it does this thing here, which it goes HAS, which is that containment edge.
- 55:48
And you see this star zero dot dot twenty-five. It's actually parameterized inside of the, inside of the query. So, like, uh, if I go back to my, um... Let me go to where it changed.
- 56:05
Um, if I go back to here, it's, it's parameterized inside of this string, so it gives you, like, an option to how deep you wanna traverse. Um, and that, that's sort of the graph-y nature of kinda putting together this table of contents.
- 56:18
There's, there's a second query in here too, which is much simpler, which just grabs the links after that. Um, so that basically,
- 56:27
uh, once that's done, I can go ahead and, um, copy.
- 56:33
I'll run the whole thing. If you, if you just run the script without any depth parameter or without a specific URI, it's gonna return everything in the graph, so it wouldn't be the way that I'd, I'd run it with, with a larger graph here.
- 56:47
We'd end up with... 'Cause we only have a couple hundred documents, um, so I can get away with it here. Um, but if I ran that,
- 56:59
um, it'll, it'll bring back a ton in...
- 57:03
But you can kinda see here. Um, zoom out. So you can see, right, that it gave me this, and you can see how a lot of these documents, again, it's not just the structure, it's like the links between all of them that it's, that it's providing.
- 57:19
Um, and then what you can do with this, right, is you can give it an optional depth parameter. So for example, if I just said depth equals one. Uh, there we go.
- 57:32
You don't like clearing. Down to the bottom, and I say depth one. Then if I did that, um,
- 57:43
it'll go ahead and just go one down. And then the other cool thing with this too is you can provide it a specific URI. So if I saw, you know, a, a specific URI here
- 57:56
that I wanted to give it, um, then it will basically start at that Falcon 2.0 document. Just like, you know, if I, um, if I was here now and say, "Okay, well, actually, you know, I wanna do, um, I wanna do it, but I wanna do it for something that I see up above," like maybe this links
- 58:18
to, you know, this, um, coil identification thing. I can go ahead and snag that URI, and then I can put it in the script,
- 58:29
and then it will basically give me, you know, that document and everything it links to. So you can say-- see here how an agent can go through now and sorta grab these URIs and kinda traverse all through the g- through the graph and give itself these hierarchical and, and linked views.
- 58:50
Um, the-
- 58:51
Questions.
- 58:52
Okay. Yeah. Why don't we, why don't we take a second for questions? So we have one in the middle here.
- 58:57
Yeah. From Claude Code, looking at the agent responses that we've actually been using the connection throughout to create these results, like-
- 59:09
Um, well-
- 59:10
Like citations or how do we know from the response that it actually used the connection throughout?
- 59:17
So later in the course I'll, i- in the workshop here for some of the last questions, I do instruct the agent to say exactly what steps it followed. Um, are you seeing it use something different?
- 59:31
No. I asked a question. I got a response.
- 59:34
Right.
- 59:34
How do I know that you're actually-
- 59:37
Yeah. So it should be apparent in the tool call history. Um, so you can, you can look at the different tool calls that it made 'cause in the case, for example, of connections, it's calling an MCP server, so those should be inside of your tool calls.
- 59:52
And the question, by the way, for everyone if, if you couldn't hear, um, it was just how do you know that the agent's actually calling the things that it's supposed to, right?
- 1:00:00
Yeah. So, so for Claude Code, for example, you can look at the tool call history. Um, and informally what I'll do in this course is for some of the prompts I'll, I'll just direct it to say, like, "Hey," like, "clearly," like, "say," like, "what steps and logic you used to be able to, to answer this question."
- 1:00:19
Um, you know, obviously for a production system you would, you would wanna look at the logs and everything, but for here and for learning, I, I, that's how I'll, I'll expose it.
- 1:00:28
Um, is there-- are there any other questions about, uh, trees, outlines?
- 1:00:37
Yes, one right here.
- 1:00:38
Just the, the build process in, in the beginning. Is that, is that just using, like, NL, like NLP library or-
- 1:00:45
Yeah
- 1:00:46
... processing?
- 1:00:47
Yeah. So, um, it is, uh, all the code for that should be in
- 1:00:57
Uh-oh. Yeah, we'll need to restart. Um, oh, that was a different code base. Thank, thank goodness. All right. Um,
- 1:01:07
yes. Inside of load, if you go to load documents,
- 1:01:14
this is, this is just the Cypher queries, and then you have your parse corpus, um, down here. So yeah, it's basically just using regex in here to try to find, you know, the, the right stuff.
- 1:01:27
In this case, the documents are already fairly well-structured, right? So mileage may vary depending on what your document sources are. In this case, right, if you have a lot of manuals that are often structured the same way, then you can get away with sort of regex and plain NLP techniques.
- 1:01:44
If it's messier, you might have to use like, um, you know, Gliner or different types of LLMs, and there, there are stages of complexity for that.
- 1:01:53
All right. Yes, we have a question over here. [muffled voice]
- 1:02:01
Yes. [muffled voice] Yep. Can be done with any model. The only thing that NeoCarta and any of these tools-- Well, Neo-- I'll start with NeoCarta.
- 1:02:17
NeoCarta is really responsible for creating that semantic layer metadata graph and providing you an MCP endpoint, right? So as long as you can access that MCP server, it's model agnostic.
- 1:02:30
Okay. So that was, that was a question about basically we're using Opus "Four point eight" here, and can we use any other type of model? And the answer to that question is, is yes.
- 1:02:38
We're using a skills framework, and then in-- and then for NeoCarta, we have MCP. Um, NeoCarta also has a CLI, so there's, there's other ways to access it too.
- 1:02:49
Um, I have one question all the way in back there. [muffled voice]
- 1:03:09
So the question is around, if, if I'm understanding correctly, how do you decide what to name your relationships and how descriptive they have to be and who is naming the relationships.
- 1:03:24
So in this case, we have a very deterministic load, so we're deciding ahead of time what to name our relationships. Um, and that is a bit of a, a taste or a judgment call, right?
- 1:03:37
Uh, I tried to keep it simple here, where has is very simple. It's a containment relationship. I also know that I'm going to want containment going multiple levels, so I probably want a common name for all of those.
- 1:03:48
'Cause if I have like has folder, has document, has section, it makes the Cypher more complicated. Um, so that's sort of why I kept that naming very short. Same with links to.
- 1:04:00
Um, the more granular you get with naming, um, basically the more sort of detailed, uh, your agent can be and your end tools can be in putting a query together, but then the more complicated your data model becomes.
- 1:04:14
And so it's a little bit of a thing that you have to manage because if you end up in like a production scenario where you have hundreds of different types of relationships, um, that might get hard to manage inside of a context window, and it can lead to models maybe not having the easiest time putting those Cypher
- 1:04:30
queries together with something like the Neo4j CLI or humans, right? When we're trying to, you know, write our own, uh, sort of parameterized queries. [muffled voice]
- 1:04:45
Yep. Yeah, that's true too. Um, and we see that, right? The- that's the whole semantic layer argument too with-- on the warehouse side is you can have these metrics, views, and other things which use business terminology that might be different from sort of the, the physical data model that you have, right?
- 1:05:01
Um, and so that's, that's part of the reason why we have these metadata graphs too, to help manage that sort of different or that delta between them. I'll take a couple more questions, and then we'll-- we can move on.
- 1:05:12
Yep. [muffled voice] Yeah, that's an interesting question.
- 1:05:29
Um, I think it would be naive to call it a replacement because most of the people that I see using this will eventually incorporate some sort of hybrid vector retrieval or full tech search.
- 1:05:42
Work I do, I use at least full tech search, um, with this sort of stuff. So I don't think it's a replacement. But as we'll see later in the course when we get to some of the estate-level questions, um, there's certain things that semantic search is not as great at answering that really require document navigation to understand
- 1:06:01
how, like, everything connects together, right? Um, so big examples would be like proving something doesn't exist. Like, how do you do that with semantic search, right? Or understanding, um, even like how, you know, there might be different parts related to a specific document or something.
- 1:06:21
You know, you could, in theory, do like a bunch of vector queries to keep pulling passages, but there's more, you know, chance for error that you might not catch the right document and all this sort of stuff.
- 1:06:33
Um, so yeah, not-- So the question was if it's a replacement for semantic search, and I don't think it is, no.
- 1:06:41
Um, one more in, uh, back there. [muffled voice]
- 1:06:57
So, um, the question is, do we redefine the types of nodes, um, as well as the relationships? And so is this a question of like- How do you decide what the node labels should be?
- 1:07:09
Um, yeah, and again, it's, it's again, it's a data modeling question, right? Like, there could be a situation where we're looking at the data model that we just went over.
- 1:07:19
Um, well, it's not, it's not here. It's in my, uh, it's in my last one, um,
- 1:07:27
when I look at the, uh, when I look at the shape. Um,
- 1:07:33
zoom out of that a little bit. Where it might be useful to have, like, an actual parts node or something, right? Um, here, for this type of use case, I'm letting the agent kind of infer parts and extract them from the documents and then use that to go find something from the metadata graph and query SQL or
- 1:07:53
the, or the other way around. Um, and that works for me. So, you know, it's still, as, as things evolve, like two years ago, I probably would have said you would need that, like, additional node.
- 1:08:05
Now it seems like agents are smart enough where maybe you don't all the time anymore. Um, and but for some use cases, you know, especially like we see this in life sciences, for example, where there's these really specific ontologies around, you know, different types of molecules and medications and things, and you, you really do need that represented
- 1:08:24
in the graph or else it just-- your inference isn't gonna make sense. So
- 1:08:30
I hate to say it depends on use case. I don't wanna be that person, but it, it sort of does in a sense. All right. Um, uh, okay. Yeah, let me, let me move on only because we're a little bit over halfway through, and I have some more course to, to get through here.
- 1:08:47
So, um, let's go to... So we went over all of this stuff. Um, oh, yes. So we need to build our, uh, search query. So similar to what we just did and to the, the question that the gentleman had over here, uh, we wanna be able to,
- 1:09:10
um, we wanna be able to build, um, some sort of search as well to help augment this. So, um, this is going to be much more simple, this search, uh, file.
- 1:09:24
Um, basically, I'm just gonna use a Lucene-style index, uh, and I, I'm not gonna use vector search here. It's the-- Neo4j itself has, um, a Lucene full-text search index.
- 1:09:38
But-- And I'm gonna do-- And if you see here, it's basically doing the same thing where I have the, uh, this, this wire that it has to fill in.
- 1:09:48
Um, and it's gonna use a Cypher skill to do that. While it's, it's running there,
- 1:09:54
you're allowed to edit. Um, well, we might as well wait till it's done.
- 1:10:01
All right, it's gonna finish up. So basically, uh, if you see here, it's the way this works is you call the full text index. Um, it's indexed on the document and the section nodes.
- 1:10:15
Uh, so every node that has text in it, like we don't put folders through, through this Lucene index. Um, and then it will give you a score. Um, and then because we have everything in those URI format, um, we can also scope it by subtree, um, basically with like a starts with filter.
- 1:10:33
Uh, so if I was to go back into this, uh, file, um, and I looked at the way that this query run, I can have this where statement. Um, so I'm applying this as a post filter, basically, where I'm doing the full text search first, um, and then I am filtering it by the URI.
- 1:10:50
So I can say, like, only search under, like, this section of the manuals, basically. Um, so it just helps me refine my, my search a little bit with those hierarchical URIs.
- 1:11:02
Uh, and the other thing that I do, um, and, and I do this because I work, like in, in the, the research role that I have, I work with so many different AI models and on so many different platforms.
- 1:11:13
Like, you wouldn't think about it, but like choosing, like, and wiring, like, options to be-- like work with like six different vendors for vectors is kinda tough. So what, what I often do for this is I'll use something called semantic expansion.
- 1:11:27
Um, and basically what it does is it, it instructs the AI model to say, "Hey, like, use your world knowledge. If someone asks for, you know, an engine shuddering, that it might be a misfire or something else too."
- 1:11:40
So it-- And because this is a Lucene index, um, I can do that. So for example, right, I can say like, "Misfire or rough idle," and it will search for either of those.
- 1:11:52
Um, if I go back to my Bash script,
- 1:11:57
and I run that now that the, uh, thing's filled it in, and then you'll see it'll give me my, uh, documents with, with the scoring for, for the different ones.
- 1:12:07
And it-- I can also search, as I was saying before, under recall. So I can search for coils under just the recall, uh, subfolder library. So that would be the idea here.
- 1:12:18
Um, so you can see it's still leveraging, uh, that hierarchical containment shape, the tree, um, but it's doing it through the URI, um, ID structure so that it doesn't have to do as much graph traversal.
- 1:12:32
It just sort of filters down to, to things underneath.
- 1:12:37
Um, all righty. Awesome. Um, are there any quick questions just around the search piece there, the Lucene search?
- 1:12:54
We have one question over here. [muffled voice]Yeah.
- 1:13:09
So the question is, we just loaded the documents into the, into Lucene, and then we're searching underneath different sections.
- 1:13:19
Appropriate sections.
- 1:13:20
Appropriate sections. Yeah. So basically, if it might make more sense if we actually took a look at the, the query that we're running here. So
- 1:13:28
here's the-- Oh, make it this big. Um, so here's, here's a Cypher query, and I'll, I'll create a space here so you can, you can kinda see it better.
- 1:13:38
So we have a Lucene index that we've set, and we set it when we loaded the graph. We set it on the document and the section nodes. So every time that I call this index full text query nodes, it's going to hit the name of the index, which is content search, and then this parameter, Lucene, is whatever
- 1:14:01
I've fed it in with that script. And so that's gonna do our initial filter to just a bunch of documents and sections. Because we've structured our IDs for every node as a URI that's hierarchical, if I know that I only want to search underneath recall notices, I can hand it that URI, and it will say, "Only nodes
- 1:14:24
whose URI starts with that thing." So it's applying that post filter afterwards, if that makes sense.
- 1:14:31
Yeah. And that's what it-
- 1:14:36
Yeah. Yep. You have a question?
- 1:14:38
Yeah. Just a quick follow on. Um, if you're creating this, uh, this search script with Lucene in code, can you just say, "Take a look at the data, create an index for me," and just like that?
- 1:14:52
Or do you have to go into the data?
- 1:14:55
So the question is, if, say, you already have a graph and you haven't created your Lucene index yet, could you prompt Claude Code to basically do this for you?
- 1:15:04
Um, so I th- I think yes. To be honest, I might have done that with this course initially. [laughs] I might have actually had Claude do it. I can't remember 'cause I've, I've rebuilt this in a, in a, in a few different ways.
- 1:15:18
Um, but I think the answer to that is yes. Your mileage may vary depending on your data. A lot of times with when you set up a Lucene index too, it's like, especially it's very flexible inside a Neo4j.
- 1:15:30
So it's like you can set it up on top of one node or multiple nodes, multiple properties on one node, multiple properties between multiple nodes. So, you know, there, there's a lot-- That flexibility can also be a little bit of an Achilles heel too when you ask a, an AI model to do, 'cause it might not understand,
- 1:15:47
you know, all those various options. But in general, yes. You, you can have, um, you can use agentic coding to, to help put this together for you.
- 1:15:57
Um, yes, in the middle there.
- 1:16:00
So the, the tree we build, how, how important is it that the, the names of the documents are, like, accurate and relevant to the effectiveness of the agent being able to traverse it?
- 1:16:14
So the question is: How important is it that the name of the documents be accurate for the agent to traverse it effectively? Um-
- 1:16:26
Like, does the, does the performance go down? Uh-
- 1:16:30
I think it, I think it would. Yeah. If, if your documents weren't named very well and you had that outline view, then the agent doesn't have as much to go off of when it's trying to traverse.
- 1:16:42
So it might misinterpret what a document means, right? Um, that's why having the search augmentation alongside of it is useful 'cause it can actually look in the document. Um, with these things, what I've seen, 'cause I use this actually for my own knowledge base management.
- 1:16:58
I have my own open source library that I use, which has these tools. Um, the biggest problem is when you have documents that are outdated or drifted, right? Um, so I've thought about, well, maybe we need to add like a last updated date or something, or like, um, whether or not a document should be authoritative, right?
- 1:17:18
Um, and the document naming is actually important, um, and link naming as well is important too. Um, so if you're, if you have links that, um, don't have like, um, I forget what it's called, but like in Obsidian, you can sort of, you can name the, you can give it, um, uh, a synonym or something, right, where
- 1:17:37
you name the link. Like that can be very helpful if that's there, right? 'Cause then it's like, "Oh, I know exactly why I'm linking out to this other thing."
- 1:17:45
Um, so that's when sometimes using like a language model inside of the ingest, if you don't have that, could, could be beneficial.
- 1:17:54
Um, yes, over here. [faintly speaking] So when you get a new document that comes in. Um, so the nice thing about this is that it's all an idempotent load, which means that, say, your entire graph went away tomorrow.
- 1:18:17
As long as your documents didn't change, if you load them, you'll get the same graph. So worst case scenario, yes, you would have to reload the whole graph, but this load is deterministic.
- 1:18:28
Now, you can also, and I've experimented with this again in some of my other, um, work, is you can say, "Oh, well, I have one document that changed, and I just wanna update that one node."
- 1:18:40
You just have to be aware of the fact that it links to other things. So it's like, well, if you got, if you changed, if you updated this document over here, um, if you changed its name, then you have to, you know, did your other documents also update like the URL reference to that document?
- 1:18:57
So there's little edge cases there that you have to work through. But, um, if you're able to do that, maybe we can talk after, and I can show you.
- 1:19:05
You can have like just add to like this part of the tree and clean up this part of the tree. So you can do like partial syncing. Yep.
- 1:19:14
All righty. Um- Is-- Do you have your hand up back there?
- 1:19:21
No, you're just scratching your head? All right. Um, then I guess we have one question here.
- 1:19:28
Sure. So I asked the agent if we have, uh, two thousand things to be made on. We have fifteen thousand files, right? So it says, "Out of that, five hundred files could be done by a page index."
- 1:19:41
It's saying that only the detailed documents in. So page index seems to be one of the ways to retrieve data, right?
- 1:19:48
Right.
- 1:19:49
So, so only it's saying the detailed documents will do that. And after that, so I already started doing that. It's saying once you page index, the default that I should do search index.
- 1:20:01
Is, is the next step, right? For-
- 1:20:05
The default after something like page index would be search?
- 1:20:09
Or search index could be search.
- 1:20:11
Yeah. Yeah, so I think the quest-- Is the question basically like, um, for the way that the agent reasons about it, that it would call outline first and then use like search?
- 1:20:23
Yeah. Yeah, it, it could work that way. It could work some way where it will search first to find a relevant document and then try to find everything it links to, in which case it would be the opposite way around.
- 1:20:35
All right. Awesome. Let's, um, let's move on here then to make sure that we have time for all of our questions. Um, so what are we doing here?
- 1:20:48
Um, this is just more asking, more full text search.
- 1:20:57
Why don't we-- 'cause we're at [REDACTED:age]. Well, I think we already effectively went over a lot of this material here.
- 1:21:08
Um, some of this is designed so that if you come back to it later, it kinda over-documents what I'm talking about. So these steps and some of the optional work will help you understand Cypher a little bit better, um, and kind of exactly how, exactly how all the pieces fit together.
- 1:21:27
But given, given the pace that we're moving at, why don't I go ahead and jump over to our, um, theme section. So I'm gonna skip over the optional practice lesson here, and I'm gonna go right into, into themes.
- 1:21:43
So this is going to be our third and, uh, last shape of today.
- 1:21:51
The, the idea with this is if you run-- So this Cypher query is basically going to be loading a graph, and I'm just looking at that links to relationship between the documents.
- 1:22:02
So when you have documents that have a lot of interlinking, um, it's always nice to think about using a graph because this structure, basically, what it's saying here is, right, we have these manuals, these recalls, and these bulletins, and they link, and they refer to each other.
- 1:22:20
Um, so you can see like this, you know, um,
- 1:22:25
uh, this, this g- the, this guide here that's a, um, that's a manual is being linked to by all of these different repair procedures. And if, if you zoom out, what ends up happening is you'll get natural clusters of things.
- 1:22:41
And this also happens a lot like in these Karpathy style, like, knowledge bases, where you'll see that, like, concepts will naturally start grouping together. And a graph can help you surface those themes, those things that you didn't actually know existed before.
- 1:23:01
And so we're going to use something called Leiden community detection. By a show of hands, how many people in this room are familiar with what graph data science is?
- 1:23:12
Oh, yes. Okay. So, so not too many of you. Do-- How many people know what community detection in a graph is?
- 1:23:21
Okay. So we, we have some of you. So, so community detection is this idea where, right, if, if I have this graph, um, and you can kinda see if I zoom out.
- 1:23:32
If you r- If you-- Especially if you're running it locally, you can see that there's these like natural little like clusters, right, of nodes that are highly interlinked together.
- 1:23:41
And so the idea is like, well, what if we can like try to label these clusters such that within a cluster, things are highly interconnected. So like this little globule of nodes becomes a cluster, then this globule becomes a cluster, and this one down here.
- 1:23:56
Um, and, and if, if we can do that, we can start understanding our data at a global scale really well. So this is like that initial like Microsoft GraphRAG idea too of like, of global versus local search, right?
- 1:24:10
We're doing something very similar here, but we're doing it in a very lightweight way where we're not really doing any LLM extraction. We're just going off of literally the, the structure of the documents.
- 1:24:20
The algorithm that we're gonna use for that labeling is called Leiden, which is similar to Louvain, which if you talk about community detection, Louvain will come up a lot.
- 1:24:30
Leiden is-- I almost see it as like a, um, the, the sorta next step. It's a little bit more efficient, um, in, in the way that it runs. And, um, it, it's using Neo4j's Graph Data Science library.
- 1:24:45
So basically, what we have to do or what, what we do to make it very performant is, in addition to just having the database, we have this other, um, projection where we'll take, uh, a part of the graph into memory, um, and then we'll run these high concurrency algorithms on top of that so that if you have
- 1:25:05
a graph that has, say, millions or billions of nodes, we can start performing this clustering and then identifying, um, basically the different interconnected communities.
- 1:25:17
And, um, these clusters, if I- Um, keep going down. Basically, the, the format that we're gonna go for here, sort of the view that we're gonna show our agent is this one.
- 1:25:30
And so it's a little bit hard to see 'cause it's a sliding window. But basically, we'll have what are, what we're calling themes, and these themes are gonna be these buckets of documents.
- 1:25:41
We'll have a sense of how tightly or loosely they're interlinked using, um, this conduance metric. It's basically, like, gonna be this metric around, like, how interconnected the nodes inside a cluster are versus how much they, um, are connected outside of the cluster.
- 1:25:56
So we can say something's tightly interlinked or loosely interlinked. Um, we'll use the labels on the links as the top shared targets, and we will, um, talk about the most linked docs and so, so the highest centrality docs inside each of them.
- 1:26:15
And so what we end up with, without any sort of, um, tagging or labeling by AI or a language model, um, is just simply from the document structure, we can tell that this first one, um, is about, you know, um, BCM, um, and, and bus and all these sorts of things.
- 1:26:36
And then if, if I go down, like this next cluster is gonna be about brakes, um, and rotor pads and, um, hydraulic lines, so it's all braking stuff. So you end up with these very natural sort of clusters that come up.
- 1:26:51
And so this is very useful from sort of a, a whole estate-wide question because you can start to understand in your data kind of how everything kinda groups and clusters together.
- 1:27:02
Uh, and so the way that we build that is similar to what we were doing before, where we have that script
- 1:27:11
and we have our, um, our spec as well. Um, so collapsing the sections. And it talks a little bit here, and I, I kinda wanna give us the last half an hour to go through the final questions, so I'll, I'll speed run this a little bit.
- 1:27:28
But basically, when we create this projection, and I'll just go ahead and, and copy this thing. Maybe I'll, I'll do this script thing first. So like we did before, um, inside of here, uh, if I look inside of my themes.py file, I, I have this wire for this, for the projection, that piece where we take the graph
- 1:27:48
and put it into memory. Um, the actual Leiden algorithm here, I'm just calling it with that graph data science library. Um, so in theory, you can, you can kinda agentic code all of these, um, but I'll just do this one.
- 1:28:02
Um, [lips smack] oh, that's not good. I wanna be able to make sure I copy the right thing. So similar to before,
- 1:28:10
um, we have our, um... Make sure that it's the right thing that I just gave it. Yeah. So we're telling it to use a Cypher skill and the GDS skill to put this together.
- 1:28:21
If you went inside of our docs, you have the, uh, theme format one, which will give it the, the shape that we want and everything, um, and it will tell us kinda how we want all the headers and things to be formatted.
- 1:28:35
Um, and so we'll go ahead and, um,
- 1:28:39
create that. Create that for me. And while it's creating that, I'll talk a little bit about the projection. So there's some graph manipulation that we do to bring it efficiently into a projection.
- 1:28:54
Um, basically, we collapse the relationships on the URI so that the, if we have sections that interlink with each other, like one section of a doc interlinks to another subsection, we just aggregate that all to the document level.
- 1:29:09
Um, and that creates kind of a cleaner interpretation to how our documents link together rather than just all our individual sections, and we can get out the communities, um, easier that way as well.
- 1:29:27
All righty. So that looks like it's coming along.
- 1:29:34
Yes. Okay. So it went ahead and created that for us. Um, and then once we get that back, uh, I can go ahead and copy the script that it just helped me create, and I can run that inside of my terminal.
- 1:29:54
Let me just make a new terminal. So I can go ahead and, and call that theme script that we just edited, and then it will do that community detection, and you'll see here that I'll get that view.
- 1:30:08
Um, so I have my... You can see, like, the, this, you know, circuit, you know, one. I have all my different, uh, documents that are, that are grouped together, and I kinda understand now, um, all the different areas of the vehicles that, that my documents go over.
- 1:30:25
Um, there's other parameters that you can feed this. Um, so for example, we have a gamma parameter, and basically what that will do is, uh, it, it basically tells it kind of, um, how, how much to split everything into.
- 1:30:41
So it's one parameter that we're exposing. If you went to the graph data science documentation, there's many others. Um, but, like, I got 13 groups running it here. If I, if I try to make it more refined with gamma equal to two, so it's one by default, it will give me, I think in this case, 14.
- 1:31:01
Um, so it basically splits it up into more groups. A lot of these community detection algorithms, also because they're hierarchical, you can choose to sort of, you can choose your level of granularity that you want, basically.
- 1:31:16
Um, as you go along and you start to understand your corpus better, you may wanna tune some of these hyperparameters. Um, and this gave us 14 different themes.
- 1:31:26
Um, let's see what we have here. Yeah, and it never really names a theme is sort of the point of this. So, like, everything that you get, um, is just directly from the document.
- 1:31:45
If I was to look at, like, the, the theme here, the names of the links, the, the names of the, the top files that were read, all of those things are just directly from the data.
- 1:31:58
And then because you get the URIs, the IDs of some of these documents, you can start doing the thing where you can go back to the outline shape or the search shape, and you can, like, search underneath all of these things.
- 1:32:10
So it gives the agent the ability to kinda jump between multiple tools like this.
- 1:32:18
Um, and so this-- these sorts of things are good for these estate-level questions. So things like where are issues concentrated, where is documentation thing-- thin, where does new documentation possibly belong on some other different type of subject that just came in if you're adding more data?
- 1:32:36
Um, all righty. So that brings us to the end of themes, and we have twenty-seven minutes about left. Are there any questions around this themes, uh, algorithm that anyone has really quickly?
- 1:32:54
Uh, yes. [speaking faintly] Yep. [speaking faintly]
- 1:33:23
Yeah. So that's a good question. And the question is, once you get the themes, so all the Leiden algorithm will do is assign an ID to these different groups, right?
- 1:33:36
And then what you do after that is sort of your choice. And your question is, are you just sort of taking from the data and just putting that there, or are you making some sort of inference afterward to label the different groups?
- 1:33:51
Here, we're doing the former. We're just taking what's in the data, and we're just showing it to you. Um, and the advantage of that is every time I run it, it'll be the same as long as the data stays the same.
- 1:34:03
If the data changes, it will change to reflect the data, so it's very stable. The disadvantage to it would be if your links in your documents, um, and the titles and things that are being scooped up, 'cause this is really only looking basically at document metadata and link metadata.
- 1:34:21
Um, if those things aren't already well labeled, this view might not be super informative right off the bat. That's why you have, you know, with, like, the, the GraphRAG, uh, methods that Microsoft came up with, they do a lot of heavy entity extraction because then what that will give is this sort of-- and they'll do, um, hierarchical
- 1:34:40
level summaries, right? So after they get the Leiden community, which is the same algorithm that they use, they'll do a summary that'll be LLM-driven on top of each theme.
- 1:34:50
Um, so that's possible to do, um, but then obviously it costs more money, it's slower, and the-- you-- if you run it twice, it might not return the same thing.
- 1:35:00
So there's trade-offs between, uh, each way of doing it. I'm showing you the sort of lighter way of doing it and the easier way, um, just 'cause it's faster.
- 1:35:09
And if you're just getting started with this, it might be easier to, to start there.
- 1:35:13
Um, may we have time for maybe one, maybe two more questions? Um, yes.
- 1:35:21
Um, how would you apply this to, like, uh, temporal data?
- 1:35:25
Temporal data?
- 1:35:26
Like, if it-- it's getting updated every day or every-
- 1:35:31
Yeah. I mean, um, I've seen customers, you know, basically every time-- 'Cause, 'cause the way Leiden works is it's, it really is this algorithm that where it will suck everything into a projection.
- 1:35:46
It will create its labels, and it'll, it'll die down, and then it will go away. So if your data is being updated constantly, um, you can recreate your IDs, um, and you can have almost like a time series of, of different theme IDs, for example.
- 1:36:03
Um, and then you can, if you want, create summaries sort of at the snapshot of when they existed, or you can see how they evolved over time. Um, but it's a very common use case.
- 1:36:13
A lot of people will actually use this even before AI. They'll use this for things like, um, fraud detection. So, like, looking at, um, like, credit chargeback fraud or, like, some of these other, like, um, anti-money laundering type of stuff to look at clusters.
- 1:36:27
And for that, they'll have to do it temporally. Like, they have to keep running it, um, to kinda see how things change over time and then predict the future, right?
- 1:36:34
So they're used in those scenarios too. Yep.
- 1:36:38
All right. One more maybe, and then I'm gonna have to move on.
- 1:36:45
All right. I th-- okay. Yes. [speaking faintly] So the question is, if you have a really big graph, how do you take this view that's being sent to the AI model and make it manageable? [speaking faintly]
- 1:37:14
Yeah. Um, so for this view, I think it's showing, like, fourteen themes. So there are cutoffs that you can make. So for example, you can say, like, for communities that are smaller than X threshold, like you don't necessarily need to highlight them.
- 1:37:33
Sometimes small communities are very important, which is why that conduance metric, which is powering that tightly interlinked, loosely interli-interlinked, you can also make that a cutoff. So if I'm interpreting your question correctly, it's sort of filtering down kind of the amount of information to what's most important to show the AI model on a larger graph.
- 1:37:52
Do I understand that correctly? [background noise] To make sure that the relationships on the nodes are correct. And, um, so- [background noise]
- 1:38:16
Y- [background noise] Yeah. Yeah. I mean, so i-in this scenario, we're really sort of trusting-- We're taking the source data kind of at its word, right?
- 1:38:33
If something links to a document, it links to the document, right? If it's erroneously linking to a document or there's a section that's malformatted, um, we wouldn't necessarily catch that.
- 1:38:45
But I suppose a good thing about something like an outline shape is that you can have your agent traverse it, um, automatically without you necessarily seeing it in small pieces, and it might be able to catch some of those things, right?
- 1:38:58
Um, so I suppose it does give you that navigation, would give you a way to kind of s-have an agent supervise the graph and understand, like, malformed data or data that's been a problem.
- 1:39:10
Um, but it's a good question. I don't know if we have a perfect solution to it. It's cleaning and cleaning messy data has always been a, you know, a thing.
- 1:39:19
Yep. All righty. Let's go ahead and, and move on 'cause I only have twenty minutes left, and I anticipate this last, uh, section will be-- this is the, the meatiest one, so hopefully we'll have enough time to go through it, especially because Claude has been slow.
- 1:39:33
So cross your fingers, um, 'cause this one is probably the heavier use of Claude. So there is a section here around just using the Neo4j CLI. Because we're just twenty minutes in, um, I'm probably and I'm not gonna go through it all the way, but I'll talk about it for a couple minutes.
- 1:39:50
The Neo4j CLI is a, a CLI tool, so I can run it in the command line. So here, for example, um, if I opened up a terminal window, I can go ahead and copy it in, and it will run a, uh, query for me.
- 1:40:07
And it also has the ability here to grab the graph schema. Um, and what that enables me to do is, um,
- 1:40:17
basically understand what's in the graph and then write a query based on that. And if you have your agent, which in this case, 'cause we're using a coding agent, it can access the Neo4j CLI.
- 1:40:27
It gives it the ability to do this graph reasoning, read the schema, and then do flexible queries. So this is very useful if you have a question that you didn't anticipate and the agent's sort of gluing things together between the shapes, right?
- 1:40:39
It has to write its own custom Cypher query. It can do that very efficiently. Um, and I've seen a lot of improvements using this along with the skills, so much better than the text to Cypher experience that we've had, like, even as, as soon as a year ago or six months ago.
- 1:40:55
Um, if you are going to be writing Cypher or doing anything text to Cypher with an agent, I'd highly recommend using the Neo4j CLI, um, as well as the Cypher and GDS skills that we were just going over.
- 1:41:08
So with that in mind, I'll go ahead and take it on to our,
- 1:41:13
in this case, our last section. If you were to take this offline, there's other informational sections that come after it.
- 1:41:21
Um, but basically, we're gonna start asking, um, some questions. Uh, the first question that we're going to ask it, and I will jump right to it because a lot of this documentation we've already went over, is if you remember from the beginning, we had our different personas, right?
- 1:41:40
We had sort of our, our, who we called our Danny, which is the floor technician, right? And they might have a question like, "Hey, for this VIN, with this specific code that I'm getting, what fix-- what have we done that has fixed this on similar vehicles?"
- 1:41:57
Um, and the motivation behind this, right, and behind a lot of the data is, as an auto repair shop, you want to minimize your, um, comeback ratio, which is basically how many times a customer has to come back because, you know, the fix didn't work, right?
- 1:42:16
Um, and so the data, especially on the warehouse side, will show, um, some of that history combined with the documentation on the actual parts and the recalls and the bulletins.
- 1:42:27
So what I've done here is similar to the gentleman's questions before. I, uh, I have it explain the steps that it used for the different shapes. You can see it's loading, um, the auto server skill.
- 1:42:40
So that was the, um, the skill that we have here, where we've also contains all of the scripts we've been working with. So the outline search and theme script it has access to, as well as the run SQL and the MCP server.
- 1:42:55
Um, that was this skill that we were talking about before. So I've pre-written that for this. You can read it, um, if you like. But it basically gives it, um, some general guidance on how to access the warehouse and also deal with the different shapes in the command interface.
- 1:43:13
And you'll see what it will do here. Um, it will look for the document code. It'll do a full-text search. It'll use the tree shape here to find cross-links and causes.
- 1:43:26
Um, and then it will get the join paths. Um, and it will actually do the query for the VIN. Um, and when it does that- It will go ahead and come back with basically the part number that needs to be replaced.
- 1:43:42
And in this case, there was, like, an old ignition coil that got revised that it had to replace it with. Um, so if you look, right, it, it first it did full-text search to sort of ground, uh, the document with the right code.
- 1:43:56
Um, so it looked for the code and also the misfire or rough idle. Um, it found, uh, the, uh, top hit, which is this engine type. It confirmed its grounding, so it shows the links from that, uh, manual over to these different procedures.
- 1:44:15
And then from there, it did a join path. Um, it basically looked at all the work orders, um, with that DTC code, uh, for that part. Um, and then it was able to bring back the ultimate question, which is, like, you know, from all the parts that were replaced and how we dealt with that code, it went
- 1:44:33
to the warehouse to grab that information. So you can see, like, this is a simple question. So
- 1:44:39
if you were using vector search and, like, Genie, like their AI search in Genie, and, like, Databricks, you could do this. But what often happens is to f- to basically find what it would need to do that linking on that tree shape, it would have to do much more vector hits, which each of those is, is, uh,
- 1:44:57
a chance, right, for this to run into an issue and not find the right document or potentially hallucinate and get something on a misfire that maybe wasn't related to that specific part.
- 1:45:09
But because it grounded in the tree shape and everything, it was able to, to get the right information and then link that back to the table.
- 1:45:17
Um, and so it can be helpful, and it can help with efficiency in these smaller questions. Um, but then what can happen is when you get to the estate-level questions is where it can get really interesting.
- 1:45:31
So I'm gonna go ahead and just copy this question, and I'm gonna let it start running. Um, it seems like Claude is moving faster now, which is good. But I'll talk about it as it's running.
- 1:45:41
So this is a question around, "Hey, are there mismatches between our documented procedures and problems that we're seeing in the field? And what documents are missing?" Or sort of on the other half, like, what documentations are we not leveraging at all inside of our warehouse data, right?
- 1:45:58
'Cause we have our documents which tell us about, like, the recalls and the bulletins and, and all this sort of stuff, um, and the manuals, but then we also have the work order history from our warehouse.
- 1:46:09
And so this is a question that someone in a supervisor role or someone in an analytics role might be interested in, right? Because it's sor-- and it's sort of like, uh, proving a negative or a mismatch because you're, you're sort of saying, like, you know, "I, I don't know what I'm looking for.
- 1:46:27
I'm looking for a gap though." And you can imagine that with a tool like vector search, this would be a very hard question 'cause sim-- or any type of similarity or lexical search.
- 1:46:37
Because, like, if you're just doing that alone, by definition, your search, you, you can't really search for a negative. You have to search for things that are there. Um, and so what I've found, and I think what we've found as a company, is that graphs can be very useful when you start having these more global types of
- 1:46:53
questions, these estate-level questions that you wanna ask, particularly if they're around patterns where you might not even know what you're looking for yet.
- 1:47:03
Yes. And so this one takes a while to run because it, at, at a certain point here, it does have to take a large number of codes and join some data together.
- 1:47:15
Um, but you'll see at the end here, it'll, it'll kind of, uh, trickle in, and it, it'll, it'll tell you how it went about finding everything.
- 1:47:25
Um, and oftentimes, what you see with these, it'll, it'll use some of the document data with some shapes, and then it will go back, and it will go back to the warehouse and query from there.
- 1:47:35
Um, it'll run through a lot of different things here.
- 1:47:46
Um, another thing just as, just while it's working on that, I did tell it here for sake of clarity to not use the Neo4j CLI. And the reason that I, I have that here is so that you can see it using the, um, the different shapes.
- 1:48:01
Um, just for sake of understanding how the different shapes kinda fit together and work, once you hand your agent the Neo4j CLI, um, it becomes very powerful because it can start writing custom Cypher queries, and there will be instances where it'll prefer doing that over some prefixed shape.
- 1:48:20
Um, and I'd say that as our sort of Texas Cypher capabilities and as we k- keep building up more skills, it'll start to prefer more free-form Neo4j CLI stuff, uh, much more frequently.
- 1:48:34
And this one can sometimes take a little while to work through, so I'll give it, uh, another twenty seconds or so. Or maybe I can even open it up to a few questions while we're here, while we're waiting for this one.
- 1:48:46
Yep.
- 1:48:47
So, um, can you explain how
- 1:48:51
So basically, what it's going to do is it's going to look at the, um-- Well, I actually have to have it come back and remind me exactly how it, um, how it goes through.
- 1:49:14
Um, but basically, what you can see from the work orders, what has been worked on, right? And then you can sort of take the codes from there and see what documents it has been using.
- 1:49:26
Um, and then there's also going to be high comeback history on using some of the wrong parts. And so you sort of get this view of, okay, well, there's a bunch of documentation that we're maybe not hitting because we're getting all these comebacks from, like, using potentially the wrong part.
- 1:49:44
Um, so there, there's that half of it, and then there's some, um, documentation that we have, um, that's just not covered because we're using DTC codes that's just not covered inside of the warehouse.
- 1:49:54
So we'll know that, like, certain documentation hasn't really been hit at all. Um,
- 1:50:01
so here it actually took a little bit more of a, um... And it will do this sometimes. Here it used semantic expansion, um, so it actually went in and did a much more comprehensive, um, semantic expansion search.
- 1:50:17
It's supposed to, in this case, use the outline. I think because it had the hierarchical URI, um, it was probably able to do this a little bit better. Um, but if I go back up,
- 1:50:31
um... Where did it show? Um, yeah, it, well, it was able to show here the field codes essentially, um, that it was missing. So, um, there was basically two field codes, um, that got a, um...
- 1:50:50
Yeah, the headline mismatch or diagnosed with the wrong procedure. Um, so there's basically this mismatch, um, where a couple of these parts among or something, typical in the library document.
- 1:51:05
Yeah, so there, where the correct repair isn't, um, referred to basically, um, and that's causing a problem for the warehouse. Um, and then there's other, um, DTC codes that occur in the field exactly that have two, um, that have no code-level documentation, which are these two.
- 1:51:24
So there's codes that are occurring which basically aren't documented that it was able to find. Um, it's a shame here that it didn't use the outline. It's supposed to do that because basically, when it uses the outline, it's able to traverse through and find all of the links a little bit more efficiently.
- 1:51:40
It wouldn't have done the comprehensive full text search call that took it a while in this case. Um, but even here, because it had the hierarchical URIs and that semantic expansion on the, um, full text search, it, it was able to eventually find it.
- 1:51:54
Um, but it's a good lesson that when it does use the outline, it can come back faster because it can traverse out on the different links. Um, the other thing here, the last one that I'll run 'cause we only have eight minutes left, um, I'll go ahead and copy it here.
- 1:52:10
Um, and this one is primarily, let me go ahead and copy it, um, is gonna leverage our, uh, themes shape. So, um, this is asking for common patterns across all our bulletins and recalls, um, and how many of the cars sort of each affects.
- 1:52:29
So we have our work order history inside of our, uh, warehouse and, uh, basically what we wanna find out is like which, you know, how does the sort of themes that we have correlate with, um, our work order history.
- 1:52:47
Um, and to do that, it runs that theme pattern to be able to pull out the high-level themes and then correlate it back to our work orders.
- 1:52:57
And so it's a coverage question, so you can see it'll run the themes.
- 1:53:05
And then, um, eventually here, we'll go ahead and bring back,
- 1:53:10
um, all of the, all of the relevant information. But basically what it's doing is it's, it's finding the themes. It's going to go and pull sort of the types of fixes that it has in the work order history, and then it's gonna do a join of sorts to kind of group them under the right theme.
- 1:53:31
While this is running, are there any other questions about this theme shape or anything? I know other people there's... Yes, go ahead.
- 1:53:40
How are we identifying this shape? At what point-
- 1:53:43
Sorry, say that one more time.
- 1:53:45
At what point are we identifying this shape? Is it during the graph construction?
- 1:53:50
How-- During the graph construction...
- 1:53:53
When we are defining this shape.
- 1:53:56
Yeah.
- 1:53:57
Shape.
- 1:53:57
Yeah. So the shapes that I, that I-- are actually defined inside of our specs. So if you go here, our outline shape, um, our specs and our docs. So this was defined more thinking through like, "Here's what we want it to look like for the agent."
- 1:54:15
And then once we define that, we come up with sort of the query structure that we want, and we use that to inform our data model. Um, and all of the documents were loaded essentially, um, into that data model that I went over about an hour and a half before, towards the beginning of the course.
- 1:54:31
Um, it's that Has Containment tree with all of the links between it.
- 1:54:37
Um, and you can see here it'll, um, it'll bring back the, um, that it used themes, it didn't use search, um, and then it, uh,
- 1:54:51
also, uh, queried the, um... If I go up here, you can see the cars affected. So it basically went to the warehouse with that connection shape, um, and it was able to sort of group them under, um, the different, uh, theme types.
- 1:55:07
So it's like that theme, the different theme types, um, that we have, and then kind of with the cars and the work orders grouped underneath by percentages.
- 1:55:15
Um, yes. Over here. [background noise] Yeah, either one.
- 1:55:23
So do you have a sense of accuracy of how, how, how well these, or how much
- 1:55:34
Do you, do I have a sense of accuracy of how well these do when the knowledge bases expand? Um, for this, I haven't run any specific benchmarking on like exactly what I've shown you today.
- 1:55:43
But I will say that when we do have customers that run these, they'll often come up with their own custom ontologies, and then they will run benchmarks, uh, that will basically say like, "How effective is this query pattern against, you know, ordinary vector search," for example.
- 1:55:58
And you would use that to prove it out on, on a specific type of dataset. Here for this course, this is more conceptual to understand kind of like the different shapes that you would use to help ground your data.
- 1:56:09
Um, and it can always use work in terms of how you were to, like, build the skill, right? To make sure it guides through the right thing so it uses, you know, each step efficiently essentially.
- 1:56:23
Are there any other questions? Yep.
- 1:56:28
In, in this case, the, the sparks code for, uh, your page between graphs and documents and tables and data-
- 1:56:38
Yeah
- 1:56:39
... are there cases where that is a bit clustered? For example, like, say you have data and you have like a good connection between the data points and, and you want to make analysis like that?
- 1:56:52
Well, maybe I don't fully understand. So you have, um, a connection point between,
- 1:56:59
between what? Between...
- 1:57:02
Let's say, let's say hopefully you have the financial statements. You have like a database structure data.
- 1:57:15
Yeah.
- 1:57:15
Also you have like the CEO comments about the basic info.
- 1:57:17
Yeah.
- 1:57:17
You, you will have a very-
- 1:57:17
Yeah. No, we do not have... So right now, so now that I understand your question, the question is, is there a link between the connection structured data graph and the unstructured one, and there is not in this case.
- 1:57:29
It's, they're completely unlinked, and the agent is sort of extracting, you know, a part from one or it's extracting like, um, yeah, basically like a code, right? And then referring back to the document.
- 1:57:44
So it's, it's using that to kind of do its own join in real time. You could create that linking, and that could be valuable for more deterministic mapping. Um, here we didn't do it, and the main reason I didn't do it was really for speed of getting started 'cause I did kinda wanna provide code that would be
- 1:58:02
easy and also model agnostic. Um, and this is that. And then if you wanted to later create those connections or those links, you could.
- 1:58:12
Um, any other questions? All righty. Well, thank you everyone. Hopefully, that was, uh, informative. [clapping] If you wanna go back, the, the workshop's available for you to take. It's, it's online.
- 1:58:27
I am gonna have to take the Anthropic key and the BigQuery key down eventually. I'll, I'll leave the BigQuery one up, uh, for a while, but the Anthropic one I'll have to, uh, eventually take down.
- 1:58:39
So unfortunately, you will need to provide your own key. But other than that, you should be able to take it just fine. Um, and I think that's all I have, so I'll leave it for my next guest.
- 1:58:49
Hopefully, you guys have enough time to jump into your next session. [outro music]