AI on Your Lakehouse: Context Comes in Shapes, Not Queries — Zach Blumenfeld, Neo4j

AI Engineer · 119 min · 1095 sentences · from YouTube's caption track

Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.

  1. 00:12Hello everyone.
  2. 00:14Welcome today to get started on AIE.
  3. 00:18Um, so right here, uh, there's some steps for getting started.
  4. 00:23I went over this around 10 minutes ago.
  5. 00:25Um, but basically our workshop that we're going to take today is driven by a website called Graph Academy.
  6. 00:32And if you go to that first QR code there to the left, uh, that'll take you there.
  7. 00:37You have to enroll with your email.
  8. 00:39Um, and then if you go down to set up your environment, uh, there's a code spaces there with everything set up and you can get that rolling now.
  9. 00:47It'll take maybe about five minutes or so.
  10. 00:50Um, and you can grab your credentials then as well.
  11. 00:53There's um an anthropic API key.
  12. 00:56Uh if you have your own cloud code key um or your your own subscription, please feel free to use that.
  13. 01:02Otherwise, we provided one for you.
  14. 01:04Um and then there's another key there for reading from BigQuery tables.
  15. 01:08So 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.
  16. 01:21So today your team um will be myself.
  17. 01:24My name is Zach Blumenfeld.
  18. 01:26I am an AI research engineer at Neo Forj.
  19. 01:29Uh 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 and running.
  20. 01:44So, as you have questions, um I don't have a mic set up for you, but uh go ahead and raise your hand.
  21. 01:51I'll sort of I'll take time around every 10-15 minutes during natural breaks.
  22. 01:56Um and and I can take some questions, but also flag Ben and Ryan as well if you're going through some steps and you're having some trouble setting things up.
  23. 02:05Um and they can help get you unblocked.
  24. 02:08Um so what we're going to 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
  25. 02:22um and then there's the data lake part which is all of your unstructured documents and oftent times what can happen is you're given these tools like text to SQL and vector search
  26. 02:34and nowadays we don't really have trouble accessing that data Um, but sometimes there are still some challenges around how do you give your agent the right type of context, whether or not they can see all the data in the way that they need
  27. 02:47um, and really take a slice to answer the right type of question.
  28. 02:51And 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
  29. 03:03um but then also provides structure for some of your documents um and then allows you to do a lot of useful stuff with that.
  30. 03:10Uh we do have a scenario here that we're going to go over.
  31. 03:14Um, we've created a fictional autofix group, uh, which is, think of it like a a Pep Boys Auto or something.
  32. 03:21It's a national auto repair chain.
  33. 03:24And they have all of these bays.
  34. 03:26They 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.
  35. 03:36Um, and you have sort of your floor technicians, right?
  36. 03:39These are the Danny's that are listed here where they have the cars inside of the bay and they're going to need to ask some questions.
  37. 03:47Um, you have leadership at this organization that wants to create a co-pilot uh to be able to assist these technicians on the floor.
  38. 03:56Um, and then obviously you have people like Sam who are us, the AI engineers who actually have to build the thing.
  39. 04:02Um, and so if they already have their data in a warehouse, what we're going to be looking at today is the example on BigQuery.
  40. 04:10So 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 data bricks as well as snowflake.
  41. 04:24Um 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.
  42. 04:37Um, 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.
  43. 04:46But 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 fall through the cracks.
  44. 04:59And 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
  45. 05:12but oftent times it's going to be on these estate level questions.
  46. 05:16So things like for example, what are we missing?
  47. 05:19Like what documentation maybe don't we not have to cover all of the different cars that are coming in or what documentation maybe are we not leveraging at all.
  48. 05:29So 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?
  49. 05:36It can't really find a negative example.
  50. 05:38Um there's also questions that we have where we want patterns across everything.
  51. 05:42So say, you know, you might want to ask, well, you know, what are, you know, the common types of patterns that we see?
  52. 05:49Is there anything that we're failing to fix over and over again?
  53. 05:53Or, 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 data set.
  54. 06:03Um, and then the other one is just asking how records relate inside of a large SQL store.
  55. 06:08Um, 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?
  56. 06:17And so there's going to be three concrete shapes that we'll introduce you to today.
  57. 06:22Uh, so the first one um, we're going to call table of contents and it's somewhat like a tree structure uh, but with also different types of links between them.
  58. 06:33You'll see how it works.
  59. 06:35Um this is going to be used on the unstructured data.
  60. 06:38Uh on the unstructured data site as well, we have something called themes.
  61. 06:42Um and what themes does is it surfers surfaces global patterns inside of your data that might not be apparent um or you might not know about beforehand.
  62. 06:52So uncovering unknown patterns and groupings.
  63. 06:55Um, and then the third one which when we take the course we're actually going to go over first is this connection shape which is essentially a semantic layer on top of your data warehouse.
  64. 07:09And so how many people just a show of hands here are familiar with like graph and graph rag.
  65. 07:18Okay so a fair number of you then how many people in here have used neo forj before?
  66. 07:25Okay.
  67. 07:25Also like uh maybe 30 40% something like that.
  68. 07:29So this room seems like you know fair fairly uh fairly familiar with graph basics but I'll I'll go over it just here really quick.
  69. 07:37So Neoraj we're we're a graph intelligence platform.
  70. 07:42We have a graph database at at at the heart of it.
  71. 07:44Right.
  72. 07:45Um and basically when we talk about what a graph is we're talking about it from a property graph data model perspective.
  73. 07:53And 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.
  74. 08:04Relationships which are the verbs or associations between those things.
  75. 08:09So like person owns car, person drives car, person is related to other person.
  76. 08:15And then we have properties that go on these both the relationships or sometimes we'll call those edges and the nodes which are sometimes called vertices.
  77. 08:25And those can be anything from strings, they can be numbers, they can be dates, they can be vectors, um um all sorts of things.
  78. 08:35And 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.
  79. 08:46Um, and that provides a ton of benefits that we'll see we'll see later in the course.
  80. 08:52So, 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.
  81. 09:04Um inside of the workshop lakehouse, have it open here.
  82. 09:11I should probably restart this guy really quick.
  83. 09:16Start my code base.
  84. 09:17Um, but basically it should take you to this page.
  85. 09:22Um, this shouldn't wouldn't say continue course for you if you if it's your first time going to it.
  86. 09:27It would say enroll to take the course.
  87. 09:30So, you have to go through that path to enroll to take the course.
  88. 09:34Um, and then basically the whole thing from here on out is just going to be me guiding you through this course and kind of showing you all the different uh things that we can do.
  89. 09:44Um, there's about 17 lessons in here.
  90. 09:46We've broken it up by the different shapes.
  91. 09:49Um, but basically if you go into the course, you can kind of click through here.
  92. 09:56I go over the scenario a little bit.
  93. 09:59But while I'll do that, I think what you should do is jump to this environment section.
  94. 10:03So basically, you go down to the bottom here.
  95. 10:08go to your environment and um from here you can say open code space and in fact I will open a new code space here just so that I can I can walk through it uh live with you as well.
  96. 10:27Yeah, of course.
  97. 10:28Um, go back to here.
  98. 10:39Why don't you all go ahead and capture that?
  99. 10:56Yes.
  100. 10:56So it'll create a code space in your own GitHub if you want.
  101. 11:00There's a link to the repository.
  102. 11:02You could run it locally.
  103. 11:04Um just keep in mind that we've set it up so that it will auto start in the code space.
  104. 11:09So there's another um bash script that you can run to run it locally and it will it will set everything up for you.
  105. 11:15Um but it it depends a little bit on your local environment.
  106. 11:19You have to make sure you have cloud code installed um and all these sorts of things.
  107. 11:24So, we'd recommend that you use a Code Space one if if you're comfortable doing it locally.
  108. 11:30I I I've run it locally all the time before, too.
  109. 11:38All right, everyone's everyone's copied the uh QR code.
  110. 11:46I'll give it another 10 seconds or so and then I'll I'll move back over.
  111. 11:52Yep.
  112. 11:53Ben and Ryan can help you out if if you don't have this one.
  113. 12:02Okay.
  114. 12:03So, when you start up as well, there's some workshop credentials here.
  115. 12:09Uh I'll I'll be uh blasting these keys uh a after the course.
  116. 12:13I'll leave them up for just a little bit.
  117. 12:15Um but basically, give it some time to start up.
  118. 12:19Uh- once it once it does, what you'll do is you'll go into your environment file here.
  119. 12:28And maybe I can make this just a little bit bigger so it's easier to see.
  120. 12:32You will place your anthropic key in here as well as the uh the BigQuery key.
  121. 12:38The other thing that you're going to want to place in uh if you go back to the course um is down here, it should give you a um Neo Forj credential.
  122. 12:56So, this is accessing our graph database.
  123. 12:59They've been all pre-provisioned, so it's going to be different for each one of you.
  124. 13:03You're going to have a different one.
  125. 13:04So, copy the one from your screen.
  126. 13:06Um, and you're going to put it inside of this environment file as well.
  127. 13:11Um, and it it will take a while, like you see with mine, the environment file hasn't uh quite popped up yet.
  128. 13:17So, it can take a few minutes for that all to go through.
  129. 13:27Um, so we'll we'll give that a little bit of time to start up.
  130. 13:32Hopefully, it won't take too long here.
  131. 13:38While that's running, I'll I'll give a little bit of an overview here of what we're going to do in the next step.
  132. 13:43So, basically, once we get this set up and and we get Claude up and running, um we're going to walk through um the first shape for our day, which is this connection
  133. 13:56semantic layer shape.
  134. 13:57And then after that we'll follow it with the table of contents one that we were talking about and the communities one.
  135. 14:04So we'll be working with the structured data first and then moving into the into the unstructured bits.
  136. 14:13Um once for those of you who do have it loaded basically you have your terminal down here.
  137. 14:21You can go ahead and call Claude.
  138. 14:24Um, we'll be working through Claude Code as our agent.
  139. 14:30Um, the internet is a little bit slow too, which is expected as you go through with this as well.
  140. 14:54I should um Oh, here we go.
  141. 14:56We'll set up show you what this looks like here in a second.
  142. 15:05Anthropic key as well as BigQuery one.
  143. 15:38All right, perfect.
  144. 15:46And 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, and then
  145. 15:56it should here give you the option to select the enthropic key.
  146. 16:01Just go through and press enter.
  147. 16:03Yes.
  148. 16:05And then you want to use the MCP server here.
  149. 16:08So you're going to select yes.
  150. 16:11And I'm going to skip the tour.
  151. 16:14And then I can ask that question just to make sure it can connect to Neo4j.
  152. 16:42And for me, I already have some nodes in because I'm working with um a graph that's been cached already for my previous course.
  153. 16:51Um for you, it will it will come up as an empty sandbox.
  154. 16:56So, one thing that uh I want to note here too in terms of how we're going to be working with Neo forj and with cipher, which is our graph query language.
  155. 17:07I think we've come to a point now where a lot of us aren't h hand typing uh our own code line by line anymore.
  156. 17:16We're using agents to help us build things obviously.
  157. 17:20And so in this workshop it's going to be the same thing.
  158. 17:24Basically we're going to be using something called the Neo Forj CLY um which is a CLY tool that will allow your agent to run uh queries directly against the database.
  159. 17:36When I was working inside of Claude, you saw it running there for a second.
  160. 17:40And that also ships with a Neoraj cipher skill.
  161. 17:44Um, 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.
  162. 17:54And we'll use that for some of the algorithms when we get to the theme section.
  163. 17:58Um, in terms of just helping us do agentic coding.
  164. 18:02So, I'm not going to have you guys handw write really any um cipher query code.
  165. 18:07I'm going to show you throughout this workshop how to use an agent to help you write that with with specs that are created.
  166. 18:15Um and hopefully that'll be useful for you more on on the day-to-day if you ever decide to use uh cipher um whether it be with Neo forj or not.
  167. 18:29Um, so how is everybody doing now?
  168. 18:33I I'll take a second here to stop.
  169. 18:36Go ahead and raise your hand if you have any questions here.
  170. 18:40Or are we all good?
  171. 18:42I have one question over there.
  172. 18:55Yeah.
  173. 18:55So the question is, can I use cursor?
  174. 18:58And so the answer to that is you should be able to.
  175. 19:01Yes.
  176. 19:02I 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.
  177. 19:11Um if not, when you go to open code, yeah, you can clone the repository here.
  178. 19:17So if you follow that link, you could clone it.
  179. 19:19You can get it locally.
  180. 19:21Um and then you'll see here there's directions.
  181. 19:24There's a shell file that you can run that will set everything up.
  182. 19:27You can take a look at what's in there.
  183. 19:28It's it's a bunch of basic stuff.
  184. 19:31Okay.
  185. 19:31Awesome.
  186. 19:32Yeah.
  187. 19:32And just a little bit about the structure of this thing.
  188. 19:34I forgot to mention um there's a lot of stuff inside of the uh inside of uh the the workspace here.
  189. 19:44Um obviously inside of Cloud we have our skills file.
  190. 19:49Um, so I've gone ahead and pre-written a skill here.
  191. 19:55Um, that covers basically a lot of what we're going to do.
  192. 20:00Uh, inside of here as well, there's uh a file called uh outline and search and theme.
  193. 20:07So, these are going to be the shapes that we'll be working with.
  194. 20:11um to query BigQuery there's just a very small um well that this is actually a a database query file but the run SQL one this one for querying bigquery just a very simple
  195. 20:22um um basically way of uh reaching out to BigQuery and just calling it with a uh with um a simple SQL command.
  196. 20:32Um and inside of these files as we'll see later there's there's places to fill in a spec.
  197. 20:37So that's going to be where we do some of our agentic coding.
  198. 20:40Um, but everything in here, if you wanted to like load this into BigQuery yourself, there's something for that.
  199. 20:46Um, if you want to go ahead and run this on data bricks, there's directions here to like load it into into data bricks and use Genie and AI search there if you want to compare.
  200. 20:57Um, and then this is just a sim link over back to the uh cloud files.
  201. 21:03Um, there's solution scripts as well.
  202. 21:05Also 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.
  203. 21:13Um 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.
  204. 21:24So if you go in here we have our bulletins and our manuals and everything.
  205. 21:30Um this is showing you the uh the raw PDF.
  206. 21:33But 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.
  207. 21:42Um so anyway, with all of that, we'll go ahead and hop along to our first section here, which is going to be connections.
  208. 21:57So, we have basically our data inside of BigQuery right now.
  209. 22:04And in fact, if I go back to my overview, just to show you what it looks like really quick.
  210. 22:09This is the uh schema.
  211. 22:11Uh so, we've kept it very simple for this course.
  212. 22:14Obviously, in the real world, you'd have a much bigger schema than this.
  213. 22:17Um but we have our work orders, uh which is sort of like the middle or the star of the scheme.
  214. 22:23you have your vehicles, um the different uh DTC codes, procedures, uh work order parts, and then the parts themselves.
  215. 22:32Um and they join together in a very simple primary foreign key pattern.
  216. 22:36Um we'll get into our documents later in the course.
  217. 22:39It's just basically a a big bucket of of PDF files.
  218. 22:44And so what we want to do here is to help our agent be able to effectively join everything together, we're going to give it a graph representation of a semantic
  219. 22:57layer.
  220. 22:58And to build that semantic layer, we're going to use something called Neoarta.
  221. 23:03Um Neoarta is a labs project.
  222. 23:06So at Neo Forj, we have our core engineering, which is like our, you know, cloud SAS platform, um our graph analytics stuff and all of that.
  223. 23:14But we also have labs projects where we move a little bit faster.
  224. 23:18Um, and inside of that labs project, we created this neocarta.
  225. 23:22Um, and what it does is it creates a metadata graph.
  226. 23:25Um, 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.
  227. 23:34Um, and if you think about it, people, you know, these words ontology and semantic layer and all these things are kind of they're thrown around a lot lately, especially this summer.
  228. 23:43And 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.
  229. 23:52A semantic layer helps something understand what the consistent agreed upon terms are so it can query the data accurately.
  230. 23:59Um and then at Neo Forj we have other things like virtual graph.
  231. 24:03There's a link 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 cipher.
  232. 24:12We won't be using that here, but there there is um sometimes uh value in in giving sort of a graph view of the schema.
  233. 24:20Um but anyway, what Neo Carter will do is it we'll see in this next section um uh it has an MCP server basically that will sort of suck all the data in from the um
  234. 24:34from BigQuery just the metadata and it will create this graph.
  235. 24:39Um and that's what you do in the next section.
  236. 24:41So, I'll go ahead and jump to there.
  237. 24:45And I've already run this script.
  238. 24:47But basically, when you see this script, what you're going to do is you're going to copy it.
  239. 24:51And then you're going to go over to here.
  240. 24:54And then, um, you're going to bring up your terminal, which our terminal.
  241. 25:02And then, uh, I like to just open a new window.
  242. 25:05That's not my cloud window.
  243. 25:07Um, and you're going to allow paste.
  244. 25:10And then you're going to go ahead and run that.
  245. 25:12I've I've already run it.
  246. 25:13Um so I won't do it again, although it should be item potent.
  247. 25:17Um but basically once you run that, uh it'll create this um these six tables with these five reference join paths.
  248. 25:28And once you've done that, you can come back in here and even just run this to check.
  249. 25:33And it's kind of cool what it looks like.
  250. 25:34Um this is this is what it looks like inside of the graph database.
  251. 25:38And 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
  252. 25:53and then you'll have your table and then you have your columns.
  253. 25:57Um and those can also optionally have these representative values on top of them.
  254. 26:04Um, 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, a little example prompt down here
  255. 26:18and I can go into my window and go back to Claude and I can ask a question like this.
  256. 26:28Which vehicle received part IC 2042?
  257. 26:32And I in this case I'm going to 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.
  258. 26:40Um inside of the skill itself it it has directions for this as well.
  259. 26:45Um, but what you'll see it'll do of this.
  260. 26:55It'll call that MCP server for Neo Carta and it's it's going to read that metadata semantic layer graph that we have in Neo forj.
  261. 27:03And so if you notice the thing that we're doing here really is we're not using the graph to copy the data over.
  262. 27:10There's not like an ETL into graph.
  263. 27:13What we're doing is we're using the graph as a semantic layer.
  264. 27:17So we're just pulling metadata about the columns and the rows and all of these things and we're going to use that to inform a text to SQL query once it uh decides to go ahead and run here.
  265. 27:43How is claude working for everyone right now?
  266. 27:46Are we seeing a lot of uh slow clouds?
  267. 27:48Fast.
  268. 27:49Yeah, slow.
  269. 27:51Okay.
  270. 27:52Interesting.
  271. 28:03I'll give it a little bit of time here.
  272. 28:05I don't know why it would be go moving.
  273. 28:08Huh.
  274. 28:09A little bit slow.
  275. 28:31Yeah.
  276. 28:32Does everyone have Yes.
  277. 28:48Yeah, sure.
  278. 28:49So, the question is, can I recount how I got to here while we're we're waiting for Claude to come along?
  279. 28:55So, basically, um the QR codes that are being passed around, there's two here.
  280. 29:02uh one of them is uh to enroll in the course.
  281. 29:06So the course that I'm going through is online.
  282. 29:08It'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.
  283. 29:17Um so you have to sign in and enroll in the course.
  284. 29:19Uh once you do that you'll you'll click through and you'll make it to this environment section.
  285. 29:26Um, and when you do that, uh, it'll take about five minutes or so for everything to to populate and come up.
  286. 29:33Um, if you're using code spaces, you have the option to run it locally.
  287. 29:37Um, but then once you do that, essentially, um, you're going to come in here and you're going to get your credentials and you're going to grab the anthropic API key,
  288. 29:48um, as well as the, uh, the BigQuery key here.
  289. 29:52Um, and then once you do that, you'll be able to um access all the things in the workshop.
  290. 29:58Basically, um, you're using, as you saw here, um, oh, cool.
  291. 30:04We're actually making progress.
  292. 30:06Um, we're using cloud code inside of inside of code spaces here.
  293. 30:15Sorry, can you repeat that really quick?
  294. 30:21Yes.
  295. 30:21The Neo Forj sandbox is um if I if I were to go back to that environment section um you see the button here to open code space and then you should have down here
  296. 30:39um your own sandbox credentials.
  297. 30:42So, it won't be these exact ones because it's it's different for every participant, but you'll go ahead and copy those.
  298. 30:51And then once you're in here, uh you'll be able to um you have your environment file.
  299. 30:58And inside of your environment file where you put your anthropic and your BigQuery key, you'll also put the Neo Forj ones.
  300. 31:05If you don't see a environment file and you see nothing or you see the end.ample, example, it just takes it a while to populate that.
  301. 31:13There's other things that are running.
  302. 31:14It's running another shell script to kind of create everything for you and um populate all the different files.
  303. 31:22So, my my hunch, and someone can scream at me if I'm wrong, is that if Anthropics this slow right now, it's more of a anthropic problem and not necessarily a one person's account problem.
  304. 31:35Um, 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.
  305. 31:43I think it's it's
  306. 31:45Yeah.
  307. 31:46Well, yeah, but this should also be running remotely, right?
  308. 31:50Is it Is it just the Wi-Fi?
  309. 31:52Okay.
  310. 31:55Yeah.
  311. 31:56Well, the funny thing is I would think in Well, never mind.
  312. 31:58I don't know.
  313. 31:59It's running in Codespaces, but maybe Code Spaces is still using the the local uh the local Wi-Fi.
  314. 32:05Um, okay.
  315. 32:08So, so we're back here.
  316. 32:10Basically, 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
  317. 32:25the different uh queries that it wanted to run.
  318. 32:28You can see it ran that the small SQL uh Python file um and it it did all of its selects and it joins to be able to to pull together
  319. 32:38uh these tables that list out um the the answer to that question essentially.
  320. 32:43Um if I was to go back the question here was uh what would we ask?
  321. 32:50Go back to the connection shape.
  322. 32:54Um yeah, which vehicles received, you know, these these separate parts over here.
  323. 33:04Um and and it it provided that list um down here by by make apparently um and then vehicle count.
  324. 33:13Um so that's the basics of this first shape.
  325. 33:17And 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.
  326. 33:28Uh in this case, it used a primary foreign key uh relationship inside of the information schema inside of BigQuery uh to enforce that.
  327. 33:36Neoarta 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.
  328. 33:45Um, are there any uh questions about this first sort of connections graph semantic layer shape that we're working with?
  329. 33:57Yes, I have one over here.
  330. 34:14Neo for you.
  331. 34:15So the question was can you give us more context into the Neo Forj near quarter like what we're doing strategically um so what Neo Forj is doing strategically and this right here so
  332. 34:26Neo forj 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 so if you have a supply chain for example
  333. 34:42and 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.
  334. 34:49A graph database is very good for that.
  335. 34:52But 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
  336. 35:05how tables might interrelate.
  337. 35:07So that even though the end join it might only be a three or four hop join, you might have had to understand hundreds of tables or something to be able to arrive at that conclusion.
  338. 35:17And so we're focused a lot right now on these concepts of ontologies and semantic layers and what we're calling virtual graph where the focus isn't only just etling data in but about okay
  339. 35:30maybe you want to keep your data where it is and you still want to 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.
  340. 35:41Um so Neo Carta is a labs project.
  341. 35:44We 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 cipher queries.
  342. 35:56So it gives you a graph schema of your of your database and then it allows you to run cipher 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.
  343. 36:09So, 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.
  344. 36:23Yeah.
  345. 36:24Yep.
  346. 36:24Grap and Yes.
  347. 36:25And we're doing a ton of stuff inside of context graphs as well and and and um and all of those layers.
  348. 36:31Yep.
  349. 36:33All right.
  350. 36:34Awesome.
  351. 36:34Um any other questions?
  352. 36:37Okay, I have one question over here.
  353. 37:03Yeah.
  354. 37:03So, so the question is um why would we not take our OOLTP data which is right now is this warehouse of vehicle orders and and stuff and just migr
  355. 37:16or or some subset of it.
  356. 37:18Why wouldn't we just push that into the graph?
  357. 37:20Well, I think in a lot of cases that's easier said than done, right?
  358. 37:25Because if you think about a lot of production use cases, you can have terabytes of data which gets updated continuously.
  359. 37:32And 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.
  360. 37:39Um, 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.
  361. 37:49And then a lot of times what people end up not really understanding until they get in those situations is the security posture.
  362. 37:57Because if you have sensitive data that's in one system, it might not even though you could physically move it in, you you might not actually be able to for security reasons take that data and just move it into another database.
  363. 38:08Um so so there's various reasons why you might not necessarily want to move your data over.
  364. 38:14Uh 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?
  365. 38:24So 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 in that case it makes a lot more
  366. 38:40sense to to bring the data in.
  367. 38:42Um and then as we'll see in the next sections when your data is already unstructured uh there's benefits to bringing it into a graph because then you can give it a graph structure.
  368. 38:51All right.
  369. 38:53I saw one other question over here.
  370. 38:55Yes.
  371. 39:03So the the question is does it rebuild the graph every time you initialize Neo Carta?
  372. 39:08And 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
  373. 39:20ports the data in um and then once it's ingested into Neoarta just the metadata then that stays there.
  374. 39:28So like for me I didn't rerun that build connections right because I just took the course last night.
  375. 39:33Um so like for me I and I probably could have because I I think it's an item pot and load but I just didn't want to deal with it.
  376. 39:39So, it was there for me and then I just ran the queries on top of it.
  377. 39:44Yep.
  378. 39:46All right.
  379. 39:47Any any other questions?
  380. 39:50I have one over here at the end.
  381. 39:53Yes.
  382. 39:53Yes.
  383. 39:54You
  384. 40:04the the Neo Forj cipher skill.
  385. 40:07Um, so I don't know if I might be able to uh grab it really quick.
  386. 40:14Um, I can show you Neo forj cipher skill.
  387. 40:26But this is these are all developed internally by our team.
  388. 40:29So if you go here actually through the Neo Forj CL, you can download a ton of these skills.
  389. 40:34So if you see here, there's there's the cipher one, but then we also have the different ones for like agent memory, for cloud infrastructure, for different drivers, like if you're using Java or Go or or all those things.
  390. 40:47Um, 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, cipher 2526.
  391. 41:03Um, so so it it it has all of the latest.
  392. 41:08So I' I'd encourage you to use the Neo Forj CLI because it will basically you can load one or multiple of these skills and you'll get the latest knowledge
  393. 41:18there because it otherwise what what it's going to do is it's going to go on the internet and get the Stack Overflow questions from like four or five or six years ago and it's going to give you outdated bad cipher basically.
  394. 41:31CLI
  395. 41:33it is.
  396. 41:33Yes, it is loaded in.
  397. 41:35And uh if you look at the um the install file that we use inside of dev container, uh you'll see um where we installed the Neo Forj agent client, the skill.
  398. 41:48So the commands in there um that that basically allowed you to do that.
  399. 41:54All 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.
  400. 42:00Yes, right there.
  401. 42:17um bronze so like 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 NeoAR Carta
  402. 42:33is really customer-driven for us.
  403. 42:35It was made by our field team.
  404. 42:37So as customers come in and they have questions about less un less structured data um and even things like documents have been considered for Neo Carta and so there's this backlog that's forming right now.
  405. 42:50Everything's moving very fast.
  406. 42:52I 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 Neo Carta, but I know we're working right now on a data bricks connector
  407. 43:03um and maybe some metric views and other things.
  408. 43:16All right, awesome.
  409. 43:17So 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 Neil Carta.
  410. 43:26So all righty.
  411. 43:28So so let me go ahead and move on for sake of time because we're coming 15 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.
  412. 43:40So now I'm going to jump to the next section.
  413. 43:43And so that was working with structured data and now I want to work with unstructured data.
  414. 43:50And this is going to be the documents part.
  415. 43:53So we have if we go over to our little uh our little uh source data stuff here.
  416. 44:01So in this case I'm going to read them locally to load them.
  417. 44:06Um but you know it's reading from cloud storage reading locally.
  418. 44:11Um there there often isn't a huge difference.
  419. 44:14Um basically we have these bulletins in PDFs.
  420. 44:19Um we have manuals which are considerably longer.
  421. 44:23Um and then we have recalls as well.
  422. 44:25And because 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.
  423. 44:37Um, but basically, uh, there are these multi-section documents.
  424. 44:42Um, and you'll see here that they have, uh, this linking that they do to go over to different sections in other documents.
  425. 44:50So, they're all kind of interlin together as they refer to one another.
  426. 44:54Um, so, for example, right inside of inside of this manual, um, it talks about these different platform codes for this ABS system, um, and diagnostic troubleshooting, right?
  427. 45:05and it will link over to there.
  428. 45:07All of this data, by the way, is I simulated.
  429. 45:09It's not sensitive or or anything like that.
  430. 45:11Um, 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.
  431. 45:20And um what we want to accomplish with this basically is we want to give our agent a table of contents.
  432. 45:28And and by a table of contents, I mean something that looks like this thing.
  433. 45:32So, what I want to allow the agent to do here is not just search for key terms.
  434. 45:38We'll give it search too, but I don't know if has anyone heard of like page index?
  435. 45:44Anyone know who they are?
  436. 45:46Maybe some of you.
  437. 45:47So, 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 and not I'll call this outline.
  438. 45:59I'll call it table of contents.
  439. 46:00I need to get the terminology a little bit better aligned.
  440. 46:03But 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.
  441. 46:14You have the bulletins which is a subfolder.
  442. 46:16Then you have these documents underneath.
  443. 46:18And so you have this containment tree.
  444. 46:21And 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.
  445. 46:30So it's more than just a table of contents that's a tree that goes down.
  446. 46:34It also has these links, right?
  447. 46:38And these links and basically everything in here have a URI.
  448. 46:42And 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.
  449. 46:51So you see like you have your technical library here, right?
  450. 46:56And then slashbulletins.
  451. 46:58So, like if I'm down in, you know, this TSB recall notice, I know that it's part of bulletins, um, or safety bulletin, rather, not a recall, and it's part of a technical library, just like it's also linking to a manual
  452. 47:13here.
  453. 47:14Um, and you can see the name of the manual, then it's inside of the manual subfolder.
  454. 47:19Um, 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
  455. 47:27text or or even a link to the raw text.
  456. 47:30And so, and then if I uh plug this in and we'll see how this works with outline later, I can actually get these sub trees so I can like dig in and drill down on these different pieces of content.
  457. 47:41Um, that's the general idea with this.
  458. 47:43And so what this gives the agent to do is not just search like vector search or or lexical search but actually kind of traverse through the documents in a sense.
  459. 47:53Um and the data model that we're going to use in this case we're actually going to import the data into graph.
  460. 48:02Um I have a I have a quick question for everyone.
  461. 48:07So, everyone here is knows Graphrag.
  462. 48:09When they think of Graphrag, and maybe someone can raise your hand and I'll I'll pick on someone for a second.
  463. 48:16I want you to tell me what you think like the pro the the building the graph process is for Graph Frag.
  464. 48:23So, I don't know if anyone wants to wants to volunteer if they're familiar.
  465. 48:27You're going to raise your hand.
  466. 48:30Yes.
  467. 48:44Yeah.
  468. 48:44And they build they build the they build the links from from the So there's different ways, right?
  469. 48:53And 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?
  470. 49:02And so graph rag oftentimes we have an entity extraction piece to it as well.
  471. 49:09So we can use an LLM to kind of say hey like extract the different parts the different vehicles from the from the graph and have them be separate entities
  472. 49:21and then have those links to like the original document chunks and all all of this stuff.
  473. 49:26And that's great and that works really well.
  474. 49:28Um here what I'm going to show you is something that's much more lightweight and I think maybe to the point that you were making um we're actually going to use a deterministic
  475. 49:41loading.
  476. 49:42So if you see here the way that this graph structure is going to work is you're going to have your library and then you're going to have this containment tree that reflects what we saw.
  477. 49:50And 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.
  478. 50:05Um, and then you'll have um next section links.
  479. 50:08So 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
  480. 50:22um but you can also do it with hyperlinking and other things depending on depending on what your data looks like.
  481. 50:28So, it's all deterministic with the containment tree for one and then the ordering of the sections as well as the links.
  482. 50:36Um, and the benefits of having a deterministic load like this is number one, it's going to be item potent.
  483. 50:42Um, so like you're not relying on an LLM in the beginning.
  484. 50:46Um, it's often going to be a little bit faster.
  485. 50:48Um 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 lexical or document structure graph rather than like a full
  486. 51:05like entity uh you know extraction type of pipeline to create a graph.
  487. 51:11Um and it it explains here what I just said with the different link types.
  488. 51:16Um and then and and like I said before these URLs carry a hierarchy.
  489. 51:21So every node for example that that head node at the top here for the library will get its URI manuals will have that plus back slashmanuals um going down sort of the containment tree to the to the file name and then the different sections
  490. 51:41and um this is the script you're going to copy to load it in.
  491. 51:45So basically again you'll take this, you'll go over to here.
  492. 51:50Um you'll open your bash terminal.
  493. 51:52Now I believe I've already done this so I'm not going to run it again even though I I'm pretty sure it's item potent.
  494. 51:58Um but basically once you run that um what you'll end up getting is and I'll just make sure it's actually in the graph.
  495. 52:06It is for me.
  496. 52:07You'll end up getting that uh that model that we just saw.
  497. 52:10It should only take Well now it might take a while if the Wi-Fi is slow.
  498. 52:14although I don't think it should.
  499. 52:15Um, 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
  500. 52:28followed up here into our different sections.
  501. 52:30And if I were to zoom in here, um, you'll see we have the has links in the next section, but then we also have the links too.
  502. 52:39And I can go in and click on these and you can see kind of how the thing grows and everything kind of links to each other.
  503. 52:48And now that we have that, um, basically in the next section, we can go ahead and build our tool.
  504. 52:56Um, basically the script that goes along with our our custom autofix skill that we've created uh to um to actually like create that outline shape that we saw in the beginning, the the table of contents
  505. 53:11to hand our agent.
  506. 53:13And so if I go ahead to that next section, um, and again, like I said, what I want to do here is I'm going to go ahead and copy this.
  507. 53:25This is the this is the prompt.
  508. 53:28Um, where if I go ahead and feed that to my claude, it should go ahead and get to work.
  509. 53:44And because I know that's going to take a while, I'm going to have it start running here.
  510. 53:48But basically, what it's doing as it goes through um is if I go under and I look at my skills, um you'll see that I left inside of here
  511. 54:04um this wired query.
  512. 54:06This is this is the query that it needs to create um to be able to create that outline shape.
  513. 54:11And I've instructed it inside of the language here to use the Neo Forj cippher skill and reference a spec in doc outline format.m MD.
  514. 54:23So this is generally how I like to write more complicated cipher queries, more complicated graph queries is I'll write a spec for it.
  515. 54:31Um, and so if I go to my docs folder, you'll see I'll have my specs in here and I have my outline format spec where I say this is the shape,
  516. 54:40right?
  517. 54:41And then it it talks here about how it needs to be human readable and uh yes, we will allow you to edit and um and some of the optional arguments it needs to have.
  518. 54:56So, right, because oftent times it's like pseudo code that we'll have and we don't know exactly how to put it together.
  519. 55:03Um, 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.
  520. 55:20[snorts]
  521. 55:28And then it will say when it's done.
  522. 55:30And 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
  523. 55:43thing here which it goes has which is that containment edge and you see this star 0.25 it's actually parameterized inside of the inside of the query.
  524. 55:56So like uh if I go back to my um me go to where it changed um if I go back to here it's it's parameterized inside of this string.
  525. 56:09So it gives you like an option to how deep you want to traverse.
  526. 56:13Um and that that's sort of the graphy nature of kind of putting together this table of contents.
  527. 56:18There's there's a second query in here too which is much simpler which just grabs the links after that.
  528. 56:24Um so that basically uh once that's done I can go ahead and um copy I'll run the whole thing.
  529. 56:35If if you just run the script without any depth parameter or without a specific URI, it's going to return everything in the graph.
  530. 56:43So it wouldn't be the way that I'd I'd run it with with a larger graph here.
  531. 56:47We end up with because we only have a couple hundred documents.
  532. 56:51Um so I can get away with it here.
  533. 56:53Um, but if I ran that, um, it'll it'll bring back a ton.
  534. 57:02And, but you can kind of see here, um, zoom out.
  535. 57:08So, you can see, right, that it gave me this.
  536. 57:11And 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.
  537. 57:19Um and then what you can do with this right is you can give it an optional depth parameter.
  538. 57:25So for example, if I just said depth equals one.
  539. 57:29Uh go you don't like clearing to the bottom and I say depth one.
  540. 57:39Then if I did that um it'll go ahead and just go one down.
  541. 57:45And then the other cool thing with this too is you can provide it a specific URI.
  542. 57:51So if I saw you know a specific URI here that I wanted to give it um then it will basically start at that Falcon 2.0 no document just like
  543. 58:05you know if I um if I was here now and say okay well actually you know I want to do um I want to do it but I want to do it for something that I see up above like
  544. 58:17maybe this links 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 and then it will basically give me you know that document and everything it links to.
  545. 58:34So you can say see how an agent can go through now and sort of grab these URIs and kind of traverse all through the through the graph and give itself these hierarchical
  546. 58:43and and linked views.
  547. 58:50Um the okay yeah why don't we why don't we take a second for questions.
  548. 58:56So we have one in the middle here.
  549. 59:09Um well so later in the course I'll in the workshop here for some of the last questions I do instruct the agent to say exactly what steps it followed.
  550. 59:28Um are you seeing it use something different?
  551. 59:34Right.
  552. 59:37Yeah.
  553. 59:38So it should be apparent in the tool call history.
  554. 59:41Um so you can you can look at the different tool calls that it made because in the case for example of connections it's calling an MCP server.
  555. 59:50So those should be inside of your tool calls.
  556. 59:52And 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 yeah so so for cloud code for example you can look at the tool call history
  557. 60:05um 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 use to be able to to answer this question.
  558. 60:18Um, you know, obviously for a production system, you would you would want to look at the logs and everything, but for here and for learning, I I that's how I'll I'll expose it.
  559. 60:28Um, is there are there any other questions about uh trees outlines?
  560. 60:37Yes.
  561. 60:37One right here.
  562. 60:45Yeah.
  563. 60:47Yeah.
  564. 60:47So, um it is uh all the code for that should be in uh oh yeah, we'll need to restart.
  565. 61:01Um oh, that was a different codebase.
  566. 61:03Thank Thank goodness.
  567. 61:04All right.
  568. 61:05Um yes, inside of load, if you go to load documents, this is this is just the cipher queries.
  569. 61:16And then you have your parse corpus um down here.
  570. 61:21So yeah, it's basically just using regx in here to try to find, you know, the the right stuff.
  571. 61:27In this case, the documents are already fairly well structured, right?
  572. 61:32So mileage may vary depending on what your document sources are.
  573. 61:36In 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.
  574. 61:44If it's messier, you might have to use like um you know, gler or different types of looms and there's stages of complexity for that.
  575. 61:53All right.
  576. 61:54Yes, we have a question over here.
  577. 62:01Yes.
  578. 62:09Yep.
  579. 62:10Can be done with any model.
  580. 62:11The only thing that Neoarta and any of these tools well neo I'll start with neocarta neocarta is really responsible for creating that semantic layer metadata graph and providing you an MCP endpoint
  581. 62:24right so as long as you can access that MCP server it's model agnostic okay so that was that was a question about basically we're using opus 4.8 here and can we use any other type of model and the answer to that question is is yes we're using a skills framework and then in and then for Neo Carta
  582. 62:42we have MCP um Neo Carta also has a CLI so there's there's other ways to access it too um I have one question all the way in back there
  583. 63:09So 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.
  584. 63:24So in this case, we have a very deterministic load.
  585. 63:28So we're deciding ahead of time what to name our relationships.
  586. 63:32Um, and that is a bit of a a taste or a judgment call, right?
  587. 63:37Uh, I tried to keep it simple here where has is very simple.
  588. 63:40It's a containment relationship.
  589. 63:42I also know that I'm going to want containment going multiple levels.
  590. 63:46So, I probably want a common name for all of those because if I have like has folder, has document section, it makes the cipher complicated.
  591. 63:55Um, so that's sort of why I kept that naming very short.
  592. 63:58Same with links too.
  593. 64:00Um 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.
  594. 64:11But then the more complicated your data model becomes.
  595. 64:14And 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
  596. 64:23um 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 cipher queries together with something like the Neo Forj CL or humans, right?
  597. 64:34When we're trying to, you know, write our own uh sort of parameterized queries.
  598. 64:45Yep.
  599. 64:46Yeah, that's true too.
  600. 64:47Um, and we see that right that 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
  601. 64:58sort of the the physical data model that you have, right?
  602. 65:01Um, and so that's that's part of the reason why we have these metadata graphs to to help manage that sort of different or that delta between them.
  603. 65:09I'll take a couple more questions and then we'll we can move on.
  604. 65:12Yep.
  605. 65:27Yeah, that's an interesting question.
  606. 65:29Um, 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 text search
  607. 65:42work I do.
  608. 65:43I use at least full text search um, with this sort of stuff.
  609. 65:47So, 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.
  610. 65:53Um, there's certain things that semantic search is not as great at answering that really require document navigation to understand how like everything connects together, right?
  611. 66:04Um, so big examples would be like proving something doesn't exist.
  612. 66:09Like how do you do that with semantic search, right?
  613. 66:11or understanding um even like how you know there might be different parts related to a specific document or something.
  614. 66:21You 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.
  615. 66:33Um so yeah, not the question was if it's a replacement for semantic search and I don't think it is.
  616. 66:38No. Um, one more in uh back there.
  617. 66:57So, 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?
  618. 67:09Um, yeah.
  619. 67:10And again, it's it's again, it's a data modeling question, right?
  620. 67:13Like there could be a situation where we're looking at the data model that we just went over.
  621. 67:19Um, well, it's not it's not here.
  622. 67:21It's in my uh it's in my last one.
  623. 67:25um when I look at the uh when I look at the shape um zoom out of that a little bit where it might be useful to have like an actual parts node or something
  624. 67:40right 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 the or the other way around.
  625. 67:54Um, and that works for me.
  626. 67:57So, you know, it's still as as things evolved, like two years ago, I probably would have said you would need that like additional node.
  627. 68:05Now, it seems like agents are smart enough where maybe you don't all the time anymore.
  628. 68:10Um 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 in the graph or else
  629. 68:26it just your inference isn't going to make sense.
  630. 68:28So I hate to say it depends on use case.
  631. 68:32I don't want to be that person, but it it sort of does in a sense.
  632. 68:36All right.
  633. 68:37Um, oh, okay.
  634. 68:39Yeah, 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.
  635. 68:47So, um, let's go to So, we went over all of this stuff.
  636. 68:54Um, oh yes.
  637. 68:56So, we need to build our uh search query.
  638. 69:00So, similar to what we just did and to the the question that the gentleman had over here, uh we want to be able to um we want to be able to build
  639. 69:14um some sort of search as well to help augment this.
  640. 69:18So, um this is going to be much more simple, this search uh file.
  641. 69:24Um basically, I'm just going to use a lucine style index.
  642. 69:28Uh, and I I'm not going to use vector search here.
  643. 69:32It's the Neo Forj itself has um a lucine full text search index, but and I'm going to do and if you see here, it's basically doing the same thing where
  644. 69:43I have the uh this this wire that it has to fill in.
  645. 69:48Um, and it's going to use a cipher skill to do that.
  646. 69:51While it's it's running there, you're allowed to edit.
  647. 69:56Um, we might as well wait till it's done.
  648. 70:01All right, it's going to finish up.
  649. 70:03So, basically, uh, if you see here, it's the way this works is you call the full text index.
  650. 70:11Um, it's indexed on the document and the section nodes.
  651. 70:15Uh, so every node that has text in it, like we don't put folders through through this lucine index.
  652. 70:20Um, and then it will give you a score.
  653. 70:23Um 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.
  654. 70:33Uh so if I was to go back into this uh file um and I looked at the way that this query run I have this wear statement.
  655. 70:41Um so I'm applying this as a post filter basically where I'm doing the full text search first.
  656. 70:47Um and then I am filtering it by the URI.
  657. 70:50So I can say like only search under like this section of the manuals basically.
  658. 70:56Um so it just helps me refine my my search a little bit with those hierarchical URIs.
  659. 71:01Uh, 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.
  660. 71:13Like 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 kind of tough.
  661. 71:22So what I often do for this is I'll use something called semantic expansion.
  662. 71:27Um 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 shuttering
  663. 71:37that it might be a misfire or something else too.
  664. 71:40So it and because this is a lucine index um I can do that.
  665. 71:44So for example right I can say like misfire or rough idle and it will search for either of those.
  666. 71:52Um, if I go back to my bash script 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.
  667. 72:07And it I can also search as I was saying before under recall.
  668. 72:10So I can search for coils under just the recall uh subfolder library.
  669. 72:16So that would be the idea here.
  670. 72:18Um, 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 reversal.
  671. 72:32It just sort of filters down to to things underneath.
  672. 72:37Um, all righty.
  673. 72:42Awesome.
  674. 72:43Um, are there any quick questions just around the search piece there?
  675. 72:52The lucine search.
  676. 72:54We have one question over here.
  677. 73:09Yeah.
  678. 73:09So the question is we just loaded the documents into the into lucine and then we're searching underneath different sections appropriate sections.
  679. 73:20Yeah.
  680. 73:20So basically if it might make more sense if we actually took a look at the the query that we're running here.
  681. 73:26So here's the I'll make it this big.
  682. 73:32Um so here's here's the cipher query and I'll I'll create a space here so you can kind of see it better.
  683. 73:38So we have a lucine index that we've set and we set it when we loaded the graph.
  684. 73:45We set it on the document and the section nodes.
  685. 73:49So 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 lucine
  686. 74:00is whatever I've fed it in with that script.
  687. 74:04And so that's going to 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.
  688. 74:14If I know that I only want to search underneath recall notices, I can hand it that URI and it will say only nodes whose URI starts with that thing.
  689. 74:26So it's applying that post filter afterwards if that makes sense.
  690. 74:32Yeah.
  691. 74:32Yep.
  692. 74:36You have a question.
  693. 74:55So the question is if say you already have a graph and you haven't created your lucine index yet, could you prompt claude code to basically do this for you?
  694. 75:04Um so I I think yes to be honest I might have done that with this course initially.
  695. 75:11I might have actually had Claude do it.
  696. 75:14I can't remember because I' I've rebuilt this in in a in a few different ways.
  697. 75:18Um, but I think the answer to that is yes, your mileage may vary depending on your data.
  698. 75:23A lot of times with when you set up a lucine index too, it's like especially it's very flexible inside of Neo forj.
  699. 75:30So 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.
  700. 75:38So, you know, there there's a lot that flexibility can also be a little bit of an Achilles heel too when you ask an AI model to do because it might not understand,
  701. 75:47you know, all those various options.
  702. 75:48But in general, yes, you you can have um you can use agentic coding to to help put this together for you.
  703. 75:57Um yes, in the middle there So the question is how important is it that the name of the documents be accurate for the agent to traverse it effectively?
  704. 76:22Um,
  705. 76:30I think I think it would.
  706. 76:32Yeah.
  707. 76:33If 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.
  708. 76:42So, it might misinterpret what a document means, right?
  709. 76:46Um that's why having the search augmentation alongside of it is useful because it can actually look in the document.
  710. 76:53Um with these things what I've seen because I use this actually for my own knowledgebased management.
  711. 76:58I have my own open source library that I use which has these tools.
  712. 77:02Um the biggest problem is when you have documents that are outdated or drifted, right?
  713. 77:08Um, 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?
  714. 77:18Um, and the document naming is actually important.
  715. 77:21Um, and link naming as well is important too.
  716. 77:24Um, 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
  717. 77:35uh a synonym or something, right?
  718. 77:37where you name the link like that can be very helpful if that's there right because then it's like oh I know exactly why I'm linking out to this other thing
  719. 77:45um so that's when sometimes using like a language model inside of the ingest if you don't have that could could be beneficial um yes over here so when you get a new document that comes in
  720. 78:05um so the nice thing about this is that it's all an item potent load which means that say your entire graph went away tomorrow as long as your documents didn't change if you load them you'll get the same graph
  721. 78:21so worst case scenario yes you would have to reload the whole graph but this load is deterministic now you can also and I've experimented with this again in some of my other
  722. 78:33um work is you can say oh well I have one document that changed and I just want to update that one node.
  723. 78:40You just have to be aware of the fact that it links to other things.
  724. 78:42So 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.
  725. 78:57So there's little edge cases there that you have to work through.
  726. 79:00But um if you're able to do that maybe we can talk after and I can show you.
  727. 79:05You 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 sinking.
  728. 79:12Yep.
  729. 79:14All righty.
  730. 79:15Um is do you have your hand up back there?
  731. 79:21You're just scratching your head.
  732. 79:23All right.
  733. 79:24Um then I guess we have one question here.
  734. 79:48right?
  735. 80:04the default after something like page index would be search.
  736. 80:11Yeah.
  737. 80:12Yeah.
  738. 80:12So I think the question is the question basically like um for the way that the agent reasons about it that it would call outline first to then use like search.
  739. 80:23Yeah.
  740. 80:24Yeah.
  741. 80:24It it could work that way.
  742. 80:25It could work some way where it will search first to find a relevant document and then try to find everything it links to.
  743. 80:31In which case, it would be the opposite way around.
  744. 80:35All right, awesome.
  745. 80:36Let's um let's move on here then to make sure that we have time for all of our questions.
  746. 80:43Um so what are we doing here?
  747. 80:50This is just more asking more full text search.
  748. 80:57Why don't we because we're at 39.
  749. 81:02Well, I think we already effectively went over a lot of this material here.
  750. 81:08Um, some of this is designed so that if you come back to it later, it kind of overdocuments what I'm talking about.
  751. 81:16So these steps and some of the optional work will help you understand cipher a little bit better.
  752. 81:22Um and kind of exactly how exactly how all the pieces fit together.
  753. 81:27But given given the pace that we're moving at, why don't I go ahead and jump over to our um theme section.
  754. 81:35So I'm going to skip over the optional practice lesson here and I'm going to go right into into themes.
  755. 81:43So this is going to be our third and uh last shape of today.
  756. 81:51The the idea with this is if you run so this cipher query is basically going to be loading a graph and I'm just looking at that links to relationship between the documents.
  757. 82:02So 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.
  758. 82:20Um, so you can see like this, you know, um, uh, this this this guide here that's a um that's a manual is being linked to by all of these different repair procedures.
  759. 82:35And if if you zoom out, what ends up happening is you'll get natural clusters of things.
  760. 82:41And this also happens a lot like in these kaparthy 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
  761. 82:56those things that you didn't actually know existed before.
  762. 83:01And so we're going to use something called lien community detection.
  763. 83:06By a show of hands, how many people in this room are familiar with what graph data science is?
  764. 83:12Well, yes.
  765. 83:14Okay.
  766. 83:14So, so not too many of you.
  767. 83:15Do how many people know what community detection in a graph is?
  768. 83:21Okay.
  769. 83:21So, we we have some of you.
  770. 83:23So, so community detection is this idea where right if if I have this graph um and you can kind of see if I zoom out if you if especially if you're running it locally you can see that there's these like natural little like clusters
  771. 83:38right of nodes that are highly interlin together 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 cluster, then this globule becomes a cluster and this one down here.
  772. 83:56Um, and and if if we can do that, we can start understanding our data at a global scale really well.
  773. 84:03So, this is like that initial like Microsoft graph rag idea too of like of global versus local search, right?
  774. 84:10We'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.
  775. 84:15We're just going off of literally the the structure of the documents.
  776. 84:20The algorithm that we're going to use for that labeling is called Leiden, which is similar to Louane, which if you talk about community detection, Luane will come up a lot.
  777. 84:30Leiden is I almost see it as like a um the sort of next step.
  778. 84:35It's a little bit more efficient um in in the way that it runs.
  779. 84:40And um it it's using Neo Forj's graph data science library.
  780. 84:45So 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
  781. 84:55where we'll take 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 a graph that has say millions or billions of nodes we can start
  782. 85:09performing this clustering and then identifying um basically the different interconnected communities.
  783. 85:17and um these clusters.
  784. 85:20If I um keep going down, basically the the format that we're going to go for here, sort of the view that we're going to show our agent is this one.
  785. 85:30And so it's a little bit hard to see because it's a sliding window, but basically we'll have what are what we're calling themes.
  786. 85:38And these themes are going to be these buckets of documents.
  787. 85:41we'll have a sense of how tightly or loosely they're interlin using um this conduance metric.
  788. 85:46It's basically like going to be this metric around like how interconnected the nodes inside cluster are versus how much they um are connected outside of the cluster.
  789. 85:56So we can say something's tightly interlin or loosely interlin.
  790. 86:00um 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
  791. 86:13inside each of them 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
  792. 86:27um is about you know um BCM um and and bus and all these sorts of things.
  793. 86:36And then if if I go down like this next cluster is going to be about brakes um and rotor pads and um hydraulic lines.
  794. 86:45So it's all braking stuff.
  795. 86:47So you end up with these very natural sort of clusters that come up.
  796. 86:51And so this is very useful from sort of a whole estate wide question because you can start to understand in your data kind of how everything kind of groups and clusters together.
  797. 87:02Uh and so the way that we build that is similar to what we were doing before where we have that script and we have our um our spec as well.
  798. 87:16Um, so collapsing the sections and it talks a little bit here and I I kind of want to give us the last half an hour to go through the final questions.
  799. 87:26So I'll speedrun this a little bit, but basically when we create this projection and I'll just go ahead and and copy this thing.
  800. 87:34Maybe I'll I'll do this script thing first.
  801. 87:36So like we did before, um, inside of here, uh, if I look inside of my themes.py Pi file I I have this wire for this for the projection that piece where we take the graph and put it into memory.
  802. 87:50Um the actual liiden algorithm here I'm just calling it with that graph data science library.
  803. 87:56Um so in theory you can you can kind of agent code all of these.
  804. 88:00Um but I'll just do this one.
  805. 88:02Um oh that's not good.
  806. 88:04I want to be able to make sure I copy the right thing.
  807. 88:07So, similar to before, um, we have our, um, sure that the right thing that I just gave it.
  808. 88:16Yeah.
  809. 88:17So, we're telling it to use a cipher skill and the GDS skill to put this together.
  810. 88:21If 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.
  811. 88:30Um, and it will tell us kind of how we want all the headers and things to be formatted.
  812. 88:35Um, and so we'll go ahead and um create that create that for me.
  813. 88:44And while it's creating that, I'll talk a little bit about the projection.
  814. 88:48So there's some graph manipulation that we do to bring it efficiently into a projection.
  815. 88:54Um, 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,
  816. 89:06we just aggregate that all to the document level.
  817. 89:08Um, 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.
  818. 89:27All righty.
  819. 89:28So, that looks like it's coming along.
  820. 89:34Yes.
  821. 89:35Okay.
  822. 89:37So, it went ahead and created that for us.
  823. 89:40Um, 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.
  824. 89:54Let me just make a new terminal.
  825. 89:57So, I can go ahead and and call that theme script that we just edited.
  826. 90:02And then it will do that community detection.
  827. 90:04And you'll see here that I'll get that view.
  828. 90:08Um 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 kind of understand now
  829. 90:20um all the different areas of the vehicles that that my documents go over.
  830. 90:25Um there's other parameters that you can feed this.
  831. 90:28Um so for example we have a gamma parameter and basically what that will do is uh basically tells it kind of um how how much to split everything into.
  832. 90:42So it's one parameter that we're exposing.
  833. 90:45If you went to the graph data science documentation there's many others.
  834. 90:49Um but like I got 13 groups running it here.
  835. 90:53If I if I try to make it more refined with gamma equal to two.
  836. 90:56So it's one by default.
  837. 90:58it will give me I think in this case 14.
  838. 91:01Um so it basically splits it up into more groups.
  839. 91:06A 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.
  840. 91:14Basically um as you go along and you start to understand your corpus better, you may want to tune some of these hyperparameters.
  841. 91:22Um and this gave us 14 different themes.
  842. 91:26Um, let's see what we have here.
  843. 91:36Yeah.
  844. 91:36And it never really names a theme is sort of the point of this.
  845. 91:40So like everything that you get um is just directly from the document.
  846. 91:45If 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.
  847. 91:58And 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.
  848. 92:10So, it gives the agent the ability to kind of jump between multiple tools like this.
  849. 92:18Um and so this the these sorts of things are good for these estate level questions.
  850. 92:23So things like where are issues concentrated?
  851. 92:26Where's documentation thing thin?
  852. 92:28Where does new documentation possibly belong on some other different type of subject that just came in for adding more data.
  853. 92:36Um all righty.
  854. 92:38So that brings us to the end of themes and we have 27 minutes about left.
  855. 92:46Are there any questions around this themes uh algorithm that anyone has really quickly?
  856. 92:54Uh yes.
  857. 92:57Yep.
  858. 93:24Yeah.
  859. 93:24So that's a good question and the question is once you get the themes so all the line algorithm will do is assign an ID to these different groups right
  860. 93:36and 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
  861. 93:49the different groups.
  862. 93:51Here we're doing the former.
  863. 93:53We're just taking what's in the data and we're just showing it to you.
  864. 93:57Um, and the advantage of that is every time I run it, it'll be the same as long as the data stays the same.
  865. 94:04If the data changes, it will change to reflect the data.
  866. 94:06So, it's very stable.
  867. 94:08The disadvantage to it would be if your links in your documents um, and the titles and things that are being scooped up, because this is really only looking basically at document metadata and link metadata.
  868. 94:21um if those things aren't already wellleeled, this view might not be super informative right off the bat.
  869. 94:27That's why you have, you know, with like the the graph rag 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 level summaries,
  870. 94:41right?
  871. 94:42So after they get the light in community, which is the same algorithm that they use, they'll do a summary that'll be LLM driven on top of each theme.
  872. 94:50Um, so that's possible to do.
  873. 94:52Um, 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.
  874. 95:00So there's trade-offs between uh each way of doing it.
  875. 95:03I'm showing you the sort of lighter way of doing it and the easier way.
  876. 95:07Um, just because it's faster and if you're just getting started with this, it might be easier to to start there.
  877. 95:13Um, may we have time for maybe one maybe two more questions.
  878. 95:18Um, yes.
  879. 95:25Temporal data.
  880. 95:31Yeah.
  881. 95:32I mean, um, I've seen customers, you know, basically every time because because the way Leiden works is it's it really is this algorithm that where it will suck everything into a projection.
  882. 95:46it will create its labels and it'll it'll die down and then it will go away.
  883. 95:51So 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
  884. 96:03um 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 a lot of people will actually use this even before AI they'll use this for things like um fraud detection
  885. 96:19so like looking at um like credit chargeback fraud or like some of these other like um anti-moneylaundering type of stuff to look at clusters and for that they'll have to do it temporally like they have to keep running it um to kind of see how things change over time and then predict the future.
  886. 96:33Right.
  887. 96:34So they're used in those scenarios too.
  888. 96:36Yep.
  889. 96:38All right.
  890. 96:39One more maybe and then I'm gonna have to move on.
  891. 96:45All right.
  892. 96:45I Okay.
  893. 96:47Yes.
  894. 97:01So 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?
  895. 97:14Yeah.
  896. 97:15Um so for this view I think it's showing like 14 themes.
  897. 97:22So there are cuto offs that you can make.
  898. 97:24So for example you can say like for communities that are smaller than X threshold like you don't necessarily need to highlight them.
  899. 97:33Sometimes small communities are very important which is why that conduance metric which is powering that tightly interlin loosely inter interlin you can also make that a cutoff.
  900. 97:42So 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.
  901. 97:52Do I understand that correctly?
  902. 98:00to make sure that the relationships on the nodes are correct.
  903. 98:04And um so yeah.
  904. 98:26Yeah.
  905. 98:27I mean, so in this scenario, we're really sort of trusting, we're taking the source data kind of at its word, right?
  906. 98:33If something links to a document, it links to the document, right?
  907. 98:37If it's erroneously linking to a document or there's a section that's malformatted, um, we wouldn't necessarily catch that.
  908. 98:45But 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?
  909. 98:58Um so I suppose it does give you that navigation would give you a way to kind of have an agent supervise the graph and understand like malformed data or data that's been a problem.
  910. 99:10Um but it's a good question.
  911. 99:11I don't know if we have a perfect solution to it.
  912. 99:14It's cleaning and cleaning messy data has always been a, you know, a thing.
  913. 99:19Yep.
  914. 99:20All righty.
  915. 99:21Let's go ahead and and move on because I only have 20 minutes left and I anticipate this last uh section will be this is the the meatiest one.
  916. 99:29So hopefully we'll have enough time to go through it especially because Claude has been slow.
  917. 99:33So cross your fingers um because this one is probably the heavier use of claude.
  918. 99:38So there is a section here around just using the Neo Forj CLY because we're just 20 minutes in.
  919. 99:45Um I'm probably end I'm not going to go through it all the way but I'll talk about it for a couple minutes.
  920. 99:50The Neo Forj CLY is a a Cly tool.
  921. 99:54So I can run it in the command line.
  922. 99:56So 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 and it also has the ability here to grab the graph schema.
  923. 100:11Um and what that enables me to do is um basically understand what's in the graph and then write a query based on that.
  924. 100:21And if you have your agent which in this case because we're using a coden agent it can access the neo forj cli it gives it the ability to do this graph reasoning read the schema and then do flexible queries.
  925. 100:32So 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?
  926. 100:39It has to write its own custom cipher query.
  927. 100:42It can do that very efficiently.
  928. 100:44Um, and I've seen a lot of improvements using this along with the skills.
  929. 100:48So much better than the text to cipher experience that we've had like even as as soon as a year ago or six months ago.
  930. 100:55Um, if you are going to be writing cipher or doing anything text to cipher with an agent, I'd highly recommend using the Neo Forj CLY.
  931. 101:04Um, as well as the cipher and GDS skills that we were just going over.
  932. 101:08So, with that in mind, I'll go ahead and take it on to our, in this case, our last section.
  933. 101:15If you were to take this offline, there's otherformational sections that come after it.
  934. 101:21Um but basically we're going to start asking um some questions.
  935. 101:26Uh 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
  936. 101:40right 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
  937. 101:52what fix what have we done that has fixed this on similar vehicles.
  938. 101:57Um, 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
  939. 102:09how many times a customer has to come back because, you know, the fix didn't work, right?
  940. 102:16Um, 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.
  941. 102:27So, what I've done here is similar to the gentleman's questions before, I uh I have it explained the steps that it used for the different shapes.
  942. 102:37You can see it's loading um the auto server skill.
  943. 102:40So that was the um the skill that we have here where we've also contains all of the scripts we've been working with.
  944. 102:48So the outline search and theme script it has access to as well as the run SQL and the MCP server.
  945. 102:55Um that was this skill that we were talking about before.
  946. 102:58So I've pre-written that for this.
  947. 103:00You 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.
  948. 103:13And you'll see what it will do here.
  949. 103:16Um it will look for the document code.
  950. 103:19It'll do a full text search.
  951. 103:21It'll use the tree shape here to find cross links and causes.
  952. 103:25Um and then it will get the join paths.
  953. 103:28Um, and it will actually do the query for the VIN.
  954. 103:33Um, and when it does that, it will go ahead and come back with basically the part number that needs to be replaced.
  955. 103:42And in this case, there was like an old ignition coil that got revised that it had to replace it with.
  956. 103:49Um, so if you look right, it at first it did full text search to sort of ground uh the document with the right code.
  957. 103:56Um so it looked for the code and also the misfire or rough idle.
  958. 104:02Um it found uh the uh top hit which is this engine type.
  959. 104:07It confirmed its grounding.
  960. 104:09So it shows the links from that uh manual over to these different procedures.
  961. 104:15And then from there it did a join path.
  962. 104:18Um it basically looked at all the work orders um with that DTC code uh for that part.
  963. 104:25Um 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 to the warehouse to grab that information.
  964. 104:35So you can see like this is a simple question.
  965. 104:38So if you were using vector search and like Genie, like their AI search and Genie and like data bricks, you could do this, but what often happens is to to basically find what it would need to do that linking on that tree shape, it would have to do much more vector hits,
  966. 104:55which each of those is is 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 n't related to that specific part, but because it grounded in the tree shape and everything, it was able to to get the right information
  967. 105:14and then link that back to the table.
  968. 105:17Um, and so it can be helpful and it can help with efficiency in these smaller questions.
  969. 105:23Um, but then what can happen is when you get to the estate level questions is where it can get really interesting.
  970. 105:31So, I'm going to go ahead and just copy this question and I'm going to let it start running.
  971. 105:35Um it seems like claude is moving faster now which is good but I'll talk about it as it's running.
  972. 105:41So 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
  973. 105:55are we not leveraging at all inside of our warehouse data right because we have our documents which tell us about like the recalls and the bulletins and and all this sort of stuff
  974. 106:04um and the manuals but then we also have the work order history from our warehouse and so this is a question that someone in a supervisor role or someone in an analytics role might be interested in, right?
  975. 106:15Because it's sort and it's sort of like 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.
  976. 106:27I'm looking for a gap though.
  977. 106:30And you can imagine that with a tool like vector search, this would be a very hard question because sim or any type of similarity or lexical search because like if you're just doing that alone
  978. 106:40by definition, you're search you can't really search for a negative.
  979. 106:43You have to search for things that are there.
  980. 106:45Um, and so what I found and I think what we found as a company is that graphs can be very useful when you start having these more global types of questions, these estate level questions that you want to ask,
  981. 106:56particularly if they're around patterns where you might not even know what you're looking for yet.
  982. 107:03Yes.
  983. 107:05And 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.
  984. 107:15Um, 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.
  985. 107:24Um, and oftent times 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.
  986. 107:35um run through a lot of different things here.
  987. 107:46Um, another thing just to just while it's working on that, I did tell it here for sake of clarity to not use the near forjly.
  988. 107:54And the reason that I I have that here is so that you can see it using the um the different shapes.
  989. 108:01Um, just for sake of understanding how the different shapes kind of fit together and work.
  990. 108:07Once you hand your agent the Neo Forj CLY um it becomes very powerful because it can start writing custom cipher queries and there will be instances where it'll prefer doing that over some prefix shape.
  991. 108:20Um, and I'd say that as our sort of Texas cipher capabilities and as we keep building up more skills, it'll start to prefer more free form Neo forj Cly stuff
  992. 108:31uh much more frequently.
  993. 108:34And this one can sometimes take a little while to work through.
  994. 108:37So, I'll give it a another 20 seconds or so.
  995. 108:41Or maybe I can even open it up to a few questions while we're here.
  996. 108:44While we're waiting for this one.
  997. 108:46Yep.
  998. 109:02So, 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
  999. 109:12how it goes through.
  1000. 109:14Um 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.
  1001. 109:26Um and then there's also going to be high comeback history on using some of the wrong parts.
  1002. 109:33And 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
  1003. 109:42potentially the wrong part.
  1004. 109:44Um so then 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.
  1005. 109:54So we'll know that like certain documentation hasn't really been hit at all.
  1006. 109:59Um, so here it actually took a little bit more of a um, and it will do this sometimes.
  1007. 110:08Here it used semantic expansion.
  1008. 110:10Um, so it actually went in and did a much more comprehensive um, semantic expansion search.
  1009. 110:17It's supposed to in this case use the outline.
  1010. 110:20I think because it had the hierarchical URI um, it was probably able to do this a little bit better.
  1011. 110:28Um but if I go back up um where did it show?
  1012. 110:35Um yeah it well it was able to show here the field codes essentially um that it was missing.
  1013. 110:41So um there was basically two field codes um that got a um yeah the headline mismatch or diagnosed with the wrong procedure.
  1014. 110:54Um, so there's basically this mismatch um where a couple of these parts on the library document.
  1015. 111:05Yeah.
  1016. 111:05So there where the correct repair isn't um referred to basically.
  1017. 111:11Um and that's causing a problem for the warehouse.
  1018. 111:14Um and then there's other um DTC codes that occur in the field.
  1019. 111:18Exactly.
  1020. 111:19that have two um that have no code level documentation which are these two.
  1021. 111:24So there's codes that are occurring which basically aren't documented that it was able to find.
  1022. 111:29Um 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
  1023. 111:37all of the links a little bit more efficiently.
  1024. 111:40It wouldn't have done the comprehensive full text search crawl that took it a while in this case.
  1025. 111:45Um, but even here because it had the hierarchical URIs and that semantic expansion on the um, full text search, it was able to eventually find it.
  1026. 111:54Um, 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.
  1027. 112:02Um, the other thing here, the last one that I'll run because we only have eight minutes left.
  1028. 112:07Um, I'll go ahead and copy it here.
  1029. 112:10Um, and this one is primarily, if I go ahead and copy it, um, is going to leverage our, uh, theme shape.
  1030. 112:19So, um, this is asking for common patterns across all our bulletins and recalls um, and how many of the cars sort of each affects.
  1031. 112:29So, we have our work order history inside of our uh, warehouse.
  1032. 112:36And uh basically what we want to find out is like which you know how does the sort of themes that we have correlate with um our work order history.
  1033. 112:47Um and to do that it runs that theme pattern to be able to pull out the highle themes and then correlate it back to our work orders.
  1034. 112:57And so it's a coverage question.
  1035. 112:58So you can see it'll run the themes and then um eventually here it will go ahead and bring back um all of the all the relevant information.
  1036. 113:14But basically what it's doing is it's it's finding the themes.
  1037. 113:19It's going to go and pull sort of the types of fixes that it has in the work order history and then it's going to do a join of sorts to kind of group them under the right theme.
  1038. 113:31While this is running, are there any other questions about this theme shape or anything?
  1039. 113:36I know other people there's Yes.
  1040. 113:38Go ahead.
  1041. 113:43Sorry.
  1042. 113:44Say that one more time.
  1043. 113:50how during the graph construction.
  1044. 113:56Yeah.
  1045. 113:57Yeah.
  1046. 113:58So the shapes that I that I are actually defined inside of our specs.
  1047. 114:02So if you go here, our outline shape um our specs in our docs.
  1048. 114:09So this was defined more thinking through like here's what we want it to look like for the agent.
  1049. 114:15And 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.
  1050. 114:22Um, 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.
  1051. 114:31Um, it's that has containment tree with all the links between it.
  1052. 114:37Um, and you can see here it'll um it'll bring back the um that it used themes.
  1053. 114:44it didn't use search.
  1054. 114:46Um, and then it uh also uh queried the um if I go up here, you can see the cars affected.
  1055. 114:58So, 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.
  1056. 115:07So, 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.
  1057. 115:15Um yes, over here.
  1058. 115:21Yeah, either one.
  1059. 115:32Do do I have a sense of accuracy of how well these do when the knowledge bases expand?
  1060. 115:37Um, for this I haven't run any specific benchmarking on like exactly what I've shown you today.
  1061. 115:43But 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
  1062. 115:55you know ordinary vector search for example and you would use that to prove it out on on a specific type of data set.
  1063. 116:02Here for this course this is more conceptual to understand kind of like the different shapes that you would use to help ground your data.
  1064. 116:09Um, and it can always use work in terms of how you were to like build the skill, right?
  1065. 116:14To make sure it guides through the right thing so it uses, you know, each step efficiently essentially.
  1066. 116:23Are there any other questions?
  1067. 116:25Yep.
  1068. 116:38Yeah.
  1069. 116:52Well, maybe I don't fully understand.
  1070. 116:55So, you have um a connection point between between what?
  1071. 117:00Between Yeah.
  1072. 117:14Yeah.
  1073. 117:17Yeah.
  1074. 117:17No, we do not have so right now.
  1075. 117:19So, now that I understand your question, the question is, is there a link between the connection structured data graph and the unstructured one?
  1076. 117:27And there is not.
  1077. 117:28In this case, it's they're completely unlin and the agent is sort of extracting, you know, a part from one or it's extracting like um yeah, basically like a code,
  1078. 117:40right?
  1079. 117:41And then referring back to the document.
  1080. 117:44So, it's it's using that to kind of do its own join in real time.
  1081. 117:48You could create that linking and that could be valuable for more deterministic mapping.
  1082. 117:54Um here we didn't do it and the main reason I didn't do it was really for speed of getting started because I did kind of want to provide code that would be easy and also model agnostic.
  1083. 118:04Um and this is that and then if you wanted to later create those connections or those links you could.
  1084. 118:12Um any other questions?
  1085. 118:16All righty.
  1086. 118:17Well, thank you everyone.
  1087. 118:19Hopefully that was uh informative.
  1088. 118:22If you want to go back, the the workshop's available for you to take, it's it's online.
  1089. 118:27I am going to have to take the anthropic key and the big query down eventually.
  1090. 118:33I'll I'll leave the BigQuery one up uh for a while, but the anthropic one I'll have to eventually take down.
  1091. 118:39So, unfortunately, you will need to provide your own key, but other than that, you should be able to take it just fine.
  1092. 118:45Um, and I think that's all I have.
  1093. 118:47So, I'll leave it for my next guest.
  1094. 118:49Hopefully you guys have enough time to jump into your next session.
  1095. 119:06[music]