AI Engineer

Make Your AI Agents Predictable With Graph Engineering - Zachary Blumenfeld, Neo4j

1791 summary words 8 min summary Watch video

Start with the signal

8 min read

Summary

At-a-Glance

  • Verdict: Watch fully
  • Core thesis: Make agent behavior predictable by compiling policies, successful decision traces, and procedures into explicit, executable graph-shaped skills that route work programmatically rather than leaving routing to an LLM.
  • Why it matters: This offers a practical control-plane pattern for reducing agent variance, model cost, and audit risk while preserving provenance across data, decisions, tool calls, and workflow runs.
  • Best use: Use it as an architecture reference for governed agent workflows—especially compliance, approvals, and other high-consequence processes—not as independent proof of Neo4j performance claims.

Executive Summary

Blumenfeld frames graph engineering as the practice of making agent work an explicit graph: nodes perform work and edges route state. He argues that the new part is not graphs themselves—state machines, workflow graphs, and knowledge graphs are established concepts—but applying them as a discipline for agent systems. His emphasis goes beyond runtime orchestration graphs such as LangGraph or ADK: he proposes persistent context graphs and procedural graphs as portable artifacts that sit alongside enterprise data.

The central operating idea is to turn loosely expressed policies, prose skills, and prior agent decision traces into a graph-shaped, executable skill. Hard policy rules and routing are moved into deterministic scripts; structured decision models handle bounded judgment calls; agents invoke the resulting skill rather than improvising the sequence of steps. This shifts responsibility for workflow control away from the LLM and reserves the model for tasks where language or judgment is actually needed.

The loan-approval demo shows the intended pattern: connect a business-plan PDF, Databricks transaction data, lending policies, and prior decisions; run an agent over that context; then compile successful but inconsistent runs into a YAML graph skill. The resulting flow applies hard rules, routes ambiguous cases to a decision model, optionally escalates to human review, writes a report, and lints that report. Every run and branch can be persisted in the graph for later inspection.

The video is particularly relevant for agent control planes because it links workflow determinism to governance and economics. Blumenfeld claims the compiled procedure reduced latency and enabled a smaller model, but he explicitly labels the result a demo rather than formal research. The durable value is the architecture pattern: versioned, inspectable procedures and execution traces stored beside the domain context, so workflows can be tested, audited, migrated across runtimes, and improved from observed runs.

Key Takeaways

  • Claim: Graph engineering should cover three related graph types: execution graphs for runtime orchestration, context graphs for memory and decision provenance, and procedural graphs for reusable steps and routing logic. | Evidence: The speaker defines execution graphs as agent/workflow nodes and routers, context graphs as decision traces connected to domain data, and procedural graphs as skills containing steps such as calls, decisions, escalation, and validation. | Implication: Do not treat an agent graph only as a framework-level runtime object; model the surrounding data, historical decisions, and operating procedure as first-class graph artifacts too.
  • Claim: The main path to predictable agents is to remove routing and hard-policy interpretation from unconstrained LLM reasoning and encode them in an executable procedure. | Evidence: In the loan workflow, hard lending rules determine automatic approval or denial; unresolved cases are routed programmatically to a bounded decision model, then to either human review or report generation and report linting. | Implication: For Ken's agent systems, identify every high-risk branch and convert it into explicit code, typed structured outputs, or a deterministic router; leave the LLM to evidence synthesis and constrained judgment. | Caveat: The speaker does not specify how the hard rules, escalation thresholds, or decision-model calibration were validated; these controls must be independently tested before use in consequential production decisions.
  • Claim: A persistent context graph can unify short-term conversation state, long-term extracted entities, and reasoning/decision traces with the underlying enterprise data. | Evidence: Neo4j's proposed knowledge layer sits between sources such as Databricks, BigQuery, Snowflake, documentation, and Markdown/Obsidian files, while retaining conversations, entities, tool calls, timestamps, and decisions. | Implication: A graph-based memory layer is useful when answer quality depends on entity resolution and provenance across multiple systems of record, rather than merely retrieving semantically similar chunks.
  • Claim: Successful agent runs can be distilled into reusable, graph-shaped skills that retain traceability while making execution more deterministic. | Evidence: The demo compiles prior loan-decision runs into a YAML skill containing execution scripts, assets, source policy documentation, routing points, and other references; the skill can then be represented and run as a graph. | Implication: Treat production traces as candidate process-mining input: mine repeatable patterns, formalize them into versioned skills, and require review before they become operational policy. | Caveat: The talk shows a compilation workflow but does not establish that automatically extracted procedures are correct; human review and regression evaluation are still needed before promoting learned traces into canonical workflow logic.
  • Claim: Storing workflow definitions and run histories as graph artifacts improves governance because operators can inspect paths, branch coverage, failures, and provenance over time. | Evidence: The speaker describes an inspector that shows run status, approvals and denials, branches taken, individual execution steps, and which branches have never been exercised; traces are persisted beside the data used by the workflow. | Implication: Observability should include workflow-level questions—such as untested branches, unusually frequent escalations, and route changes—not just token, latency, and tool-error metrics.
  • Claim: Proceduralization can reduce latency and enable smaller models because the model no longer has to discover the workflow and routing at inference time. | Evidence: For the loan demo, Blumenfeld says a larger-model graph-only approach was correct 'pretty much every time' but took 2.7 minutes; using the AIP procedure nearly halved time, and moving to Haiku reduced it further. He also cites approximately 30 seconds to two minutes wall-clock versus roughly 7.5 minutes in a comparison shown during the demo. | Implication: Benchmark deterministic workflow extraction against a strong model-only baseline on your own tasks, measuring correctness, escalation quality, branch coverage, latency, and total cost rather than assuming savings transfer. | Caveat: These figures are informal demo observations, contain multiple comparison baselines, and are not a controlled benchmark; the speaker explicitly says the demo is not formal research.
  • Claim: Graph-shaped skills are intended to be portable across agent runtimes rather than locked inside a single agent harness. | Evidence: The speaker contrasts runtime frameworks including LangGraph and ADK with a stored knowledge-layer artifact, arguing that any harness able to consume the skill can run its logic. | Implication: Keep procedures in a runtime-neutral, versioned representation where possible, but validate adapter and semantic compatibility before relying on portability claims. | Caveat: The transcript does not identify a broadly adopted cross-runtime standard or demonstrate interoperability across multiple production frameworks.

Detailed Brief

Where the pattern is most valuable

  • Claims: The proposed architecture is aimed at domains where correct answers require both cross-source entity resolution and adherence to fixed procedures.; The graph is positioned as a knowledge layer beside systems of record, not as a replacement for warehouses, operational databases, or source documentation.
  • Evidence: An asset-management/compliance example combines documentation with entities whose ticker symbols and names differ across databases, then uses expressed graph logic to produce governed audit reports.; Uber is cited as using configuration graphs to operationalize geographically varying driver and vehicle compliance requirements assembled from a sprawl of microservices.
  • Caveats: The asset-management and Uber examples are brief customer-style references, not detailed implementation case studies with measurable outcomes.
  • Implications: Prioritize this pattern where policy variation, entity identity, source lineage, and explainability are all part of the task; a simple linear workflow may be cheaper and clearer for stable single-source processes.

Neo4j product framing

  • Claims: Neo4j presents its database and analytics capabilities as the substrate for an AI layer containing agent memory and graph-oriented workflow artifacts.; The speaker identifies Neo4j Over Agent Memory Service (NAMS) as a reference architecture for working with these memory and procedural graph concepts.
  • Evidence: The talk describes a stack consisting of the core database and analytics layer, with graph-AI tooling above it to load, connect, and inspect data and agent artifacts.
  • Caveats: Some tooling described is characterized as labs, experimental, or reference architecture work rather than a fully specified production product.
  • Implications: Separate the transferable design principles—explicit procedures, provenance graphs, branch observability—from the vendor decision; assess whether Neo4j's operational model, query layer, and AI tooling fit the existing stack.

Notable Concepts & Terms

  • Graph engineering: The discipline of representing agent work explicitly as graph structure so work, state transitions, and control paths are visible and governable.
  • Execution graph: The runtime orchestration graph in which agents, tools, and routers are nodes and edges transmit state.
  • Context graph: A persistent graph connecting conversation history, extracted entities, domain data, and reasoning/decision traces to provide memory and provenance.
  • Procedural graph: A graph representation of a skill or operating procedure, including steps, decisions, validation, and escalation paths; it need not map one-to-one to agent nodes.
  • Graph-shaped skill: A portable YAML-like artifact compiled from documentation or past runs that includes scripts, assets, references, routing logic, and source policy material.
  • AIP library: The library used in the demo to compile and execute a procedural skill; the transcript does not expand the acronym, but it is presented as the mechanism that makes the procedure executable.
  • NAMS / Neo4j Over Agent Memory Service: Neo4j's cited reference architecture for storing and inspecting agent memory, decision traces, and related graph artifacts.
  • Branch coverage for agents: Observability of which procedural branches were taken, never exercised, or failed—an operational governance signal beyond final-answer accuracy.

Operator Notes / Why Ken Should Care

  • Select one existing agent workflow with expensive model-driven routing—such as approval, compliance review, or incident triage—and enumerate its hard rules, judgment calls, escalation gates, and required report checks.
  • Create a versioned procedure schema that separates deterministic code, structured decision calls, source-policy references, and human-review gates; do not embed all four in a prompt.
  • Persist run-level route, tool-call, source, outcome, and failure metadata, then build alerts for never-tested branches, unexpected route shifts, rising escalations, and policy-version drift.
  • Run a controlled evaluation comparing the current free-form agent against the procedural version using identical cases; require no regression in correctness or escalation safety before optimizing for model size and latency.
  • Evaluate Neo4j/NAMS as one implementation option only after defining interoperability, retention, access-control, and audit requirements for the graph memory/control layer.

Source/Metadata

  • Title: Make Your AI Agents Predictable With Graph Engineering - Zachary Blumenfeld, Neo4j
  • Transcript words: 5821
  • Duration seconds: 1235
  • Timestamp note: No timestamps or chapters were present in the supplied transcript; substantial portions of the demo and closing material are duplicated.
Full transcript 3589 words · 26 min read
0:12

We're going to talk about graph engineering today. How many people have heard about that term graph engineering? Okay, so a fair amount of the room. And then just so I understand, how many people here are familiar with Neo4j and have used Neo4j? Okay, so we got a few people. So that's good for just letting me know who we're talking to today. So just some history on some of the verbiage that's being used. There was a tweet that went out by Peter Steinberger, I think earlier this year in the summer, that talked about graph engineering. And it was almost like, is this a new discipline that's happening as this evolution from prompt engineering and context engineering?

0:57

And there's a lot of hype around this. And the name for this is new, but the mechanisms are not really new. We've always known in computer science generally about state machines and workflow graphs and knowledge graphs and all these different things. What's changing is really how we think about them in reference to agents. And what I'm going to talk to you about today is how we think about graph engineering. And I'm going to offer you a new perspective on this. So if we actually try to define what graph engineering is, I think a good definition is it's the practice of designing agent work as an explicit graph.

1:36

So where nodes do work and edges effectively route state between them. And I tend to think of it in terms of three different types of graphs. We have our general execution graphs, which you're probably very familiar with. So these are the workflow graphs with routers and agents as actual nodes that happen inside of an agent harness. But there's other ways that we can think about graph engineering too that overlap with this. So that includes context graphs. These are decision traces, instances of what's happened and how it connects to other data inside of your domain. And then there's also something that I'd call more procedural graphs.

2:18

So this is almost like having a skill or procedural knowledge as a graph where the steps might not be actual agents, but they might be steps inside of a way of doing something, a procedure. So different calls, maybe a step for a decision model, steps for different agents, whether to escalate validation steps and these sorts of things. And I'm really going to focus on these last two because I think we don't talk about them enough. And I think by understanding these, you can actually get a little bit at what the first graph is trying to do as well, but in a very portable and efficient way. So graph engineering lets agents really take on bigger, more complex work.

2:57

And that's why we care about it. And really, if you were to split it up, I think in terms of the benefits that a graph offers agents in this context, it would be predictability. So being able to constrain a path that an agent takes, making sure that the answer is basically accurate from a task that it's doing, and having an explicit graph, the ability to govern, control, and guide what the agent does, and audit it so you can understand what it's doing and make it better next time. And then the third one, which is going to be interesting that we'll talk about, is how do we actually make graph engineering portable?

3:11

And instead of thinking about a graph as something that happens in the runtime, it could be something that you can store and actually move between different runtimes and have inside of a knowledge layer, which gives you more interoperability and allows you to have a very simple stack. And in the runtime, when we think about the graph, it's really a piece of orchestration. So we're probably, all of us, or a large portion of us are probably familiar with LangGraph, ADK, and all these other agent frameworks, even to a certain extent, Anthropic's multi-agent research, and some other stuff fits inside of graph engineering.

3:38

And what I'm going to talk about today is actually what happens when we take that graph and we put it next to our data as context graphs and some of the things that I was talking about before. And really when you do this, as I was saying, you add this portability layer, you add the ability to take all of this knowledge and make it work with any type of runtime. So that's what I'm going to go over today. And this is what we're doing at Neo4j is we're defining this knowledge layer. And this knowledge layer sits between systems of record that you would ordinarily retrieve data from.

4:08

So DataMesh, BigQuery, Snowflake, these types of places. It could be documentation, it could be Obsidian, these markdown files. And then can we create standard protocols and artifacts that live inside of that layer that then you can take a graph engineering process and make it available to any runtime or any agent. And the way our product works, just so you know, at Neo4j, is we have our core database and then we have a ton of other AI stuff on top of it. So the database and the analytics layer, I'm going to be showing some of this throughout my talk.

4:39

But what I'm really going to be focusing on is this top layer where we talk about this agentic brain or these other memory tools that wrap around the database. So just know that as I go through, I'm going to be showing you data being loaded into the database. That's going to constitute our knowledge layer. It's going to come from multiple different sources. But a lot of the extensions of that tooling and some of the experimental things that I'm going to show you exist as this graph AI that hooks into that and loads data in and out of that.

5:08

So what we're doing at Neo4j and how we're thinking about this, we start with this concept of a context graph, which has different types of memory from short term memory, which is going to be your conversation history, your long term memory being entities that are extracted from that or from your data and then reasoning or decision traces inside of that. And one of the interesting things that we've been looking at from a research perspective, and this really started out not so much at that graph, but actually at individual skill level.

5:24

There was a paper that we wrote earlier this year that we published in a workshop and we were really trying to ask the question, can we take procedural knowledge, whether it be from past decisions or even something like a skill like we have here and compile it down to a graph. And what we came up with was a process of taking written material, often a skill MD file and the scripts and the references and assets and moving that into an actual graph structure, which is what you see on that other side.

5:40

And the result of doing this and giving the agent access to that graph structure, which has different nodes representing inside of the skill decisions, different routing points, different scripts that have to be executed, taking prose and compiling them down to deterministic scripts. When we do that and we force the agent to run that graph, what we see is increases in task reward and performance. So this was from a while ago. I am still working on updating it to the latest models. But we were able to use a smaller model. In this case, I think it was Sonnet.

6:15

And now we're on to Haiku, as a matter of fact. But we were seeing even for really challenging tasks over diverse fields in physics and computer science and various security, physical training, a whole ton of things, this overall increase in task reward performance. And we were able to switch over to this. And our PMs, Will Lohin, who works in our labs team, actually took this idea and said, well, if we can do that with skills, maybe we can do it too with these memory graphs.

6:36

So you can actually take that context graph that I was showing you earlier and distill a skill from that and have it still be connected in the same graph over to all of your past decision traces and data. And so then you get those performance benefits. But you also have all this provenance that goes back from every step. It's versioned. It's tracked. And you have governance over time where you can assess drift. You can understand where certain tool calls are coming from and their history. A human can go through actually inside of NAMS, Neo4j Over Agent Memory Service, which is our reference architecture for this.

7:17

There's a QR code there. And there will be another one at the end. And be able to understand, exactly how this works, edit it, change it, do all sorts of cool stuff with it. So again, what we're talking about now are these artifacts that you can move around. This thing makes a skill, right? And so any agent harness that can take that skill can now be running these graphs and doing all of this logic. And we have various customers that are using us for graph engineering types of tasks. I'll go quickly because we're starting to run out of time.

8:07

And even though they're not may not be using exactly the labs project that they have, we have consultancies which are working with other asset managers for tough problems in compliance. So being able to write audit reports, for example, where you have data that might come from multiple sources. How do you automate that but do it in a way that's governed and trustworthy? So you have compliance documentation, you might have entities with different ticker symbols and names from different databases and those only to be resolved.

8:41

So again, what we're talking about now are these artifacts that you can move around. This thing makes a skill, right? And so any agent harness that can take that skill can now be running these graphs and doing all of this logic. And we have various customers that are using us for graph engineering types of tasks.

8:46

I'll go quickly because we're starting to run out of time. Even though they're not using exactly the labs project that we have, we have consultancies working with other asset managers for tough problems in compliance. So being able to write audit reports, for example, where you have data that might come from multiple sources. How do you automate that but do it in a way that's governed and trustworthy? So you have compliance documentation, you might have entities with different ticker symbols and names from different databases and those need to be resolved. And so giving your agent these graphs that express the logic that you need to do on the data allows you to automate those things in a trustworthy way. And we have other people such as Uber that do this with configuration graphs. So if you have drivers across the country, compliance and regulations for different areas geographically vary greatly. And they come from this sprawl of microservices that you need to pull data from to figure out, okay, well, what is it for each area for each component of a car, for example? And so being able to express that logic and have it sit aside the data also helps them operationalize some of these things effectively.

8:50

So I'm going to jump to a demo now. I'm going to warn you in advance. It's going to be quite a lot and I'm going to jump through it quickly. But it's very interesting. And what I'm going to show you is how we can use that AIP library that I was talking about before to compile a skill and actually get a task that was not governed very well and took very long to run, cut its cost by 100% and then run it a lot, lot faster. And of course, it's a demo, not a formal research proposal, but you can go there and look at the code. It's all very transparent.

8:56

So this is going to be an example for a loan approval process. So in a loan approval process, there's lots of policies that have to be followed. Obviously, I'm not a financial expert, but many of you in the room are. And so there's probably going to be a policy doc. There's going to be a system of steps that have to be followed exactly. And then you need your agent to be able to explain those steps very clearly, articulate them and really get the answer right as if it was a human reviewing.

9:00

And the first thing you can do, like I was saying before, and I don't have time to probably run this all live and the Internet's going to be slow. So luckily, I have this preloaded. And the question that was asked was, should we approve this new loan for Rosa's Bakery business? And in this case, we have a business plan that's in a PDF that was uploaded. And that is the orange data. So if I was to scroll out here, you can see it here in the graph. That connects also to data that we pulled from Databricks, from past transactions, lending policy data, and past decisions that were actually made. And with that, the agent can crawl over all that information and basically realize that this person either had a loan before or there was a mistake before or something happened before and come up with an audit trail for that and basically post a solution very, very quickly.

9:07

And this is a great start. Just in terms of resolving data and being able to follow policies and understand how things connect, this is great. One of the issues with this is, and I can show you a graph of what this looks like. This is an example of me running more of these policies. And if I zoom in, I have a conversation here. And then I have my reasoning trace that exists inside of this graph. And all of these steps are time stamped and they have tool calls.

9:12

What can happen is if I look at this happening twice, I think this is the right query. This is two decision chains. So it's going to be a little bit hard to see. Let me zoom in. They're of different lengths, you'll notice. So one is longer than the other. In this case, it was because it found a precedent in one, something else that had happened before. But the problem with this is that if you run these over and over again, there's nothing actually enforcing that the agent follows an exact path. You might have a skill or something that will say, do these things. But then there's other problems where there are these decision steps where it's approve or deny is a simple one or approve it or send to a human to review. And those decision steps as well come with confidence scores. Or you say, if you're confident about it, if you're not confident about something, but those decisions aren't calibrated. So it would be great to take some of this and send it to something like a type-safe dev type of model as well to be able to do some of those things.

9:21

So what you can do is you can scrape all of this and you can compile it into a graph shape skill, which is what we did here. And that graph shape skill, if I go here, you're not going to be able to see it. But that's okay that you don't see a lot of the detail here. The important part is that we sort of compiled all the information down from those successful runs that we did, even though they were a little bit inconsistent. And we put them into this graph YAML shape inside of this skill. And this skill, even though you probably have trouble seeing, has scripts. It has assets here. It has sometimes other reference resources. It doesn't for this one. It also has source documentation around the policy that you're supposed to do for the loan. So there's basically a ton of stuff in here for traceability, but then also telling the agent how to run the skill.

9:29

But the great thing is, once the skill's in this YAML format, we can port it into all this different tooling, including inside of a graph, because it's all sort of this deterministic format. And in a graph, it looks like this thing here. So let me just run this sucker again. This is what it looks like. So you have all of these steps out here. And then basically what I just did is I wrapped a small client around this so the agent can say, hey, run the skill. And instead of the agent deciding all the routing steps, it's done programmatically. We took a lot of that policy down and we put a lot of it into these execution scripts.

9:33

Basically what's happening here, if I was just to sum it up, there's an execution that basically looks at, hey, do we meet certain hard rules around policies? After that, it's routed. If it's not auto-approved or denied based on that, it's routed to a decision model like dev or type-safe. And I can even probably show you a little bit of a clear view here. And it's given that model a risk to your choice. Let me make that a little bigger. Hold on. Whether or not there's some exposure material and then an outcome of whether or not you're approving or denying. And then the rest of this will basically follow down into writing a report, whether or not you need to escalate to a human review as this router. And then if not, basically the agent's going to write a report and there's a circulation here to sort of check and lint that report.

9:45

So once you do this and you sort of get the model going where, okay, now we have this CLI that we can just run this thing in. Well, now I can go in here and then maybe I probably don't have time to run this whole thing again, but I will give it a shot. I'll see if it goes and picks this up. It takes about two minutes to run. But the idea, while this is running and it should pick up the AIP skill, which it is here. Once you have it in this format, not only can you have the agent run this very quickly, you can track the runs. So for example, if I was to look at a single run, I can run this again. I could basically persist the runs inside of the graph. So this is a run of that skill with individual steps that it ran. And then I can just persist these over time. I can examine how well they work. So from a governance perspective, I have a little inspector here that I built really quickly. You can look at the status of all these. You can look at how a specific one ran, what was approved, what was denied inside of the process, what branches it took. And then once you have a graph, you can even do these cool observability things where you can ask, well, what branches were taken and which branches weren't taken, which is very interesting from a governance perspective. If it failed ever. All these cool different things.

9:50

You can track the runs. So for example, if I was to look at a single run, I can run this again. I could persist the runs inside of the graph. So this is a run of that skill with individual steps that it ran. And then I can just persist these over time. I can examine how well they work. So from a governance perspective, I have a little inspector here that I built really quickly. You can look at the status of all these. You can look at how a specific one ran, what was approved, what was denied inside of the process, what branches it took. And then once you have a graph, you can even do these cool observability things where you can ask, what branches were taken and which branches weren't taken, which is very interesting from a governance perspective. It failed ever. All these cool different things. And all of that is stored besides your data. And so in none of this, we're not creating a loop right inside of our agent. All we're doing here is giving it a CLI to run this programmatic skill that we compiled from documentation, or in this case from our memory graph. And this might take a while to run just because of the internet. But what I will show you is we ran this a few times. And what we saw is just running, I was using Fable. So my organization already yells at me for this enough. I'm spending a bunch of money. But just using Fable alone on the graph, and it was correct pretty much every time. But it took 2.7 minutes. When we had the procedure, it almost cut in half just using AIP. And then because we had the procedure, we can use a simpler model like Haiku, and then we can cut the model time down even more. And then, of course, the cost just goes way down. So because you're taking all of that load, right, of having to figure out all the routing, all the stuff you're doing, you're putting into these execution scripts, these JEV models and everything, which makes everything just much, much more efficient. And this is going to take too long to run. It's mostly internet. You can see here about half a minute or two minutes wall clock on average down from like seven and a half. All right. So anyway, I'll end it here. So I want to give you some resources to check out if you're interested in this type of stuff. Aura is our cloud service offering where you can get the database that I was showing you before. You get $100 of free credits. We have nodes coming up, which is a speakers event. There's a startup program. And then all the code that I was referencing and the other projects that I was using to hook up to your agent memory, all that stuff is down there. So I'll leave this up for a second until someone kicks me off. And I guess that's it for me for now.

9:54

So you have compliance documentation, you might have entities with different ticker symbols and names from different databases and those only to be resolved. And so giving your agent these graphs that express the logic that you need to do on besides the data basically allows you to automate those things in a trustworthy way. And we have other people such as Uber that do this with configuration graphs. So basically, if you have you can imagine if you have drivers across the country, compliance and regulations for different areas geographically vary greatly.

10:29

And they come from this sprawl of microservices that you need to pull data from to figure out like, OK, well, what is it for each area for each component of a car, for example? And so being able to express that logic and have it sit aside the data also helps them operationalize some of these things effectively. So I'm going to jump to a demo now. I'm going to warn you in advance. It's going to be quite a lot and I'm going to jump through it kind of quickly. But it's very interesting.

10:56

And what I'm going to show you is how we can use that AIP library that I was talking about before to compile a skill and actually get a task that was not governed very well and took very long to run. Basically cut its cost by like 100% and then run it a lot, lot faster. And of course, it's a it's a demo. It's not a formal research proposal, but you can go there and look at the code. It's all it's all very transparent. So this is going to be an example for a loan, a loan approval process. So in a side of a loan approval process, there's lots of policies that have to be followed. Obviously, I'm not a financial expert, but many of you in the room are.

11:38

And so there's probably going to be a policy doc. There's going to be a systems of steps that have to be followed exactly. And then you need your agent to be able to explain those steps very clearly, articulate them and really get the answer right as if it was a human reviewing. And the first thing you can do, like I was saying before, and I don't have time to probably run this all live and the Internet's going to be slow. So luckily, I have this preloaded. And basically, the question that was asked was, should we approve this new loan for this Rosa's Bakery business? And in this case, you know, we have a business plan that's in a PDF that was uploaded.

12:16

And that is, let's see, the business plan is the orange data. So if I was to scroll out here, you can see it here in the graph. That connects also to data that we pulled from Databricks, from past transactions, lending policy data, and past decisions that were actually made. And with that, the agent can crawl over all that information and basically realize that this person either had a loan before or there was a mistake before or something happened before and come up with an audit trail for that and basically post a solution very, very quickly. And this is a great start.

12:55

Just in terms of like resolving data and being able to follow policies and understand how things connect, this is great. One of the issues with this is, and I can show you a graph kind of of what this looks like. This is an example of me running more of these policies. And if I zoom in, I have a conversation here. And then I have my reasoning trace that exists inside of this graph. And all of these steps are time stamped and they have tool calls. What can happen is if I look at this happening twice, I think this is the right query. This is two decision chains. So it's going to be a little bit hard to see. Let me zoom in. They're of different lengths, you'll notice.

13:41

So one is longer than the other. In this case, it was because it found a president in one, basically something else that had happened before. But the problem with this is that if you run these over and over again, there's nothing actually enforcing that the agent follows an exact path. You might have a skill or something that will say, like, do these things. But then there's other problems where it's like there's these decision steps where it's approve or deny is a simple one or approve it or send to a human to review. And those decision steps as well come with confidence scores.

14:14

Or you say, like, if you're confident about it, if you're not confident about something, but those decisions aren't calibrated. So it would be great to, like, even take some of this and send it to something like a type safe, you know, jev type of model as well to be able to do some of those things. So what you can do is you can scrape all of this and you can compile it into a graph shape skill, which is what we did here. And that graph shape skill, if I go here, you're not going to be able to see it. But that's OK that you don't see a lot of the detail here.

14:45

The important part is that we sort of compiled all the information down from those successful runs that we did, even though they were a little bit inconsistent. And we put them into this graph YAML shape inside of this skill. And this skill, even though you probably have trouble seeing, has scripts. It has assets here. It has sometimes other reference resources. It doesn't for this one. It also has source documentation around the policy that you're supposed to do for the loan. So there's basically a ton of stuff in here for traceability, but then also telling the agent how to run the skill.

15:20

But the great thing is, once the skill's in this YAML format, we can port it into all this different tooling, including inside of a graph, because it's all sort of this deterministic format. And in a graph, it looks kind of like this thing here. So let me just run this sucker again. This is kind of what it looks like. So you have all of these steps out here. And then basically what I just did is I wrapped a small client around this so the agent can say, hey, run the skill. And instead of the agent deciding all the routing steps, it's just done programmatically. We took a lot of that policy down and we put a lot of it into these execution scripts.

16:04

Basically what's happening here, if I was just to sum it up, there's an execution that basically looks at, hey, do we meet certain hard rules around policies? After that, it's routed. If it's not auto-approved or denied based on that, it's routed to a decision model like dev or type safe. And I can even probably show you a little bit of a clear view here. And it's given that that model is given like a risk to your choice. Let me make that a little bigger. Hold on.

16:42

Whether or not there's some exposure material and then like an outcome of whether or not you're approving or denying. And then the rest of this will basically follow down into writing a report, whether or not you need to escalate to a human review as this router. And then if not, basically the agent's going to write a report and there's a circulation here to sort of check and lint that report. So once you do this and you sort of get the model going where, okay, now we have this CLI that we can just run this thing in. Well, now I can go in here and then maybe I can probably don't have time to run this whole thing again, but I will give it a shot.

17:24

I'll see if it goes and picks this up. It takes about two minutes to run. But the idea, I guess, while this is running and it should pick up the AIP skill, which it is here. Once you have it in this format, not only can you have the agent run this very quickly, you can track the runs. So for example, if I was to look at a single run, I can run this again. I could basically persist the runs inside of the graph. So this is a run of that skill with like individual steps that it ran. And then I can just persist these over time. I can examine how well they work. So from a governance perspective, I have a little inspector here that I built really quickly.

18:09

You can look at the status of all these. You can look at how a specific one ran, what was approved, what was denied inside of the process, what branches it took. And then once you have a graph, you can even do these cool observability things where you can ask, well, like what branches were taken and which branches weren't taken, which is very interesting from a governance perspective. It failed ever. All these cool different things. And all of that is stored besides your data. And so in none of this, we're not like creating a loop right inside of our agent.

18:43

All we're doing here is basically giving it a CLI to run this like programmatic skill that we compiled from documentation, or in this case from our memory graph. And this might take a while to run just because of the internet. But what I will show you is, we ran this a few times. And what we saw is just running, I was using Fable. So my organization already yells at me for this enough. I'm spending a bunch of money. But like just using Fable alone on the graph, and it was correct, you know, pretty much every time. But it took 2.7 minutes. When we had the procedure, it almost cut in half just using AIP.

19:24

And then because we had the procedure, we can use a simpler model like Haiku, and then we can cut the model time down even more. And then, of course, you know, the cost just goes way down. So because you're taking all of that load, right, of having to figure out all the routing, all the stuff you're doing, you're putting into these execution scripts, these JEV models and everything, which makes everything just much, much more efficient. And this is going to take too long to run. It's mostly internet. You can see here about half a minute or two minutes wall clock on average down from like seven and a half. All right. So anyway, I'll end it here.

20:01

So I want to give you some resources to check out if you're interested in this type of stuff. Aura is our cloud service offering where you can get the database that I was showing you before. You get $100 of free credits. We have nodes coming up, which is a speakers event. There's a startup program. And then all the code that I was referencing and the other projects that I was using to hook up to your agent memory, all that sort of stuff is down there. So I'll leave this up for a second until someone kicks me off. And I guess that's it for me for now.

Reading tools

Type to find a passage

Appearance
Ask this transcript

Add a note