Agents Are Where Microservices Were in 2015 — Roberto Milev & Uday Kanagala, Navan https://www.youtube.com/watch?v=32nrHU6zHU8 AI Engineer · 19 min · 191 sentences · sentence-level transcript from YouTube's caption track; each line begins at the time shown [00:01] [music] [00:13] Right. [00:14] Hello, everybody. [00:15] Um welcome to our talk. [00:17] My name is Roberto Milev. [00:18] I am the chief architect at Navan. [00:21] And I have Uday here, who's also part of the architecture team. [00:25] Uh Navan is a travel and expense management company. [00:30] And we'll share with you some of our learnings around how you run an AI and what have we uh discovered. [00:37] So, uh if you've been long enough um in this industry, you remember that over time there are a few paradigm shifts. [00:47] And we all tend to jump on a bandwagon and try to uh kind of do things, all right? [00:53] Last time was when we all jumped on the microservices bandwagon. [00:58] And out of that, a lot of good things came out, like container orchestration, Kubernetes. [01:04] Then we had service mesh, uh circuit breakers, all of those good things. [01:10] But it didn't happen overnight. [01:12] Like it took a long time. [01:14] It took some time for us to learn how to do these things. [01:18] So, one of the quotes from there is, "If you can't build a well-structured monolith, why even try to build microservices?" [01:25] Uh it kind of translates today because if you can't build a single agentic loop, why go in and try to build a multi-agent orchestrated system? [01:37] So, over time, just like previously, uh a reference architecture is emerging. [01:44] So, we have learned a few things by by doing in production. [01:50] We have a lot of agents, a lot of tokens per day being used. [01:55] And as I said, there are few layers that have standardized, that have crystallized around what do we need to run agentic flows reliably in production. [02:07] Runtime memory, context management, all around operational cross-cutting concerns, and around orchestration as well. [02:16] So, today we'll go over some of these layers, all of these layers actually, and we will show kind of where the industry is, what we have done, what we have learned, [02:26] and and so on. [02:28] So, starting at the runtime layer, we've talked a lot and we've built a lot of services in order to scale them statelessly before. [02:40] And now we're in a new world where, you know, agents are stateful by nature. [02:44] They need to have persistent sessions. [02:48] They need to have isolation. [02:50] Their life cycle is different than the life cycle of a traditional API service, and so on. [02:57] So, the cloud providers have jumped in and try to fill this gap. [03:03] Um, you know, AWS, GCP, Azure, they all have a some incarnation of a agentic runtime. [03:13] If you scan the QR code for this slide and for the following slides, you will see a comparison of some of the features and how different cloud providers try to try to [03:23] approach this. [03:25] At Nvono, we run everything on AWS. [03:28] AWS has an agent core runtime. [03:31] We heavily use that, but we have filled some gaps around that, like the session persistence and rehydration is something that we have built. [03:41] And we also run a bunch of other bunch of SDKs for writing agents. [03:47] And part of these runtimes is typically they are framework agnostic, although they all prefer their native framework in a way. [03:57] Um the next layer in the stack is around memory. [04:03] Um we started with rag. [04:05] Rag was kind of a big thing for a while. [04:08] We were kind of driven to that out of necessity because you cannot fit an unlimited amount of context into an agent. [04:18] And over time um all of these cloud providers and the industry has implemented a pipeline where memory is kind of automatically generated by following a workflow of ingestion, extraction, [04:32] and then consolidation and retrieval. [04:34] And there are parts of rag that are built in things like a long-term memory that inherently has some semantic characteristics. [04:43] But memory is built up over time from short-term conversational memory to long-term memory that you kind of manage yourself. [04:51] Uh then episodic memories about kind of instances that worked well and didn't work well. [04:57] Uh and so on. [04:58] We at Navan again being a AWS shop, um utilize their agent core memory. [05:06] But we are also kind of doing it in a way that uh matches matches our our use case. [05:14] And then the next thing is context management. [05:16] You know, it's a hot topic. [05:18] It was a hot topic and it's still a hot topic. [05:20] Context windows are growing bigger, but there's never enough context or if there is too much context again, agents struggle with that cuz you lose focus and so on. [05:31] Um what we found working is that uh focusing on skills as a unit of context. [05:38] And I'll explain what I mean by that. [05:40] Uh we look at skills as both having context, meaning instructions and uh setup about a certain domain or a task. [05:49] And there's also the the second part of the skill, which is the tool execution and you know, the agentic part. [05:56] And we compose context dynamically out of skills that we use as units of work that are pluggable, that we can test independently, and that we can reuse. [06:11] So, for example, when we are we have an agent, we have skills that are that are specific to a domain. [06:19] And based on that, we compose them. [06:21] And we rely on the you know, the progressive disclosure, which is a feature of the skills itself to start with a limited scope of context and then expand by included [06:34] metadata further down the the line. [06:39] I'll hand it over to Uday Uday now to kind of walk us through the rest of this. [06:44] Thanks, Rudra. [06:46] All right. [06:47] Can I have a quick show of hands here who have who had built an agent uh which failed halfway through multi 20 20 step or 30 step process and be able to figure out quickly [07:00] or reason about why the agent failed. [07:05] So, again, logs we've generally been traditionally with microservices, we all are familiar with logs. [07:11] There's logs out there and then we go check out the logs. [07:13] But this changes everything the moment we switch to agents. [07:17] Agents output a lot of thinking. [07:20] There's too much to consume. [07:22] So, that's not the right way to do it, right? [07:23] So, traditionally, that was the way, but our thought has to be changed right now. [07:28] In the in the way they Claude as an example, when we take Claude as an example for an agent, there is hooks and we can intercept everything that Claude as an agent that does at that level. [07:40] So, what kind of tool it calls, right? [07:43] What kind of decision it's making? [07:44] So, before pre-tool and post-tool call or a pre-decision or a post-decision, so all of that are a point point in time for us to intercept and make a decision [07:54] and either block to do a blocking operation or to log in metric or emit a metric, right? [08:01] So, this is a critical place where we can emit auto traces. [08:06] At Nvone, we use one of our provider to interest to emit these auto traces and through these traces we should be able to figure out the spans, the traces and at what point in time where the agent is stuck, [08:20] which gives much more confidence into how we operate and build the agent. [08:26] This is day-to-day operational challenge. [08:29] Building agent these days there's so many frameworks, but how do you navigate building and operating an agent later is primary concern. [08:37] Um And moreover, the reasoning chain, the thought process and critical signals that we emit here as part of the trace captures, we emit a few primary signals here. [08:50] What is the current goal the agent is going through, the reasons behind its operations and the belief status and the tool calls that it's making. [08:58] So, this kind of gives us a judgment pointers. [09:00] Um Um in the traces. [09:03] And when we make when the agent makes a decision, there is a confidence score, how confident it is when it makes the judgment, right? [09:12] So, whether there are multiple paths that it leads to this choice or whether this is an inferred answer. [09:18] So, basically these are signals that gives us confidence later to review. [09:22] If this is an inferred answer, there could be a human in the loop to guide through and tweak the agent to perform a little better. [09:32] Again, um Can I have a raise of hands again to see how confident are you like 100% confident in testing pipelines with your agents? [09:43] Right. [09:43] So, this is one of the other um critical aspect today. [09:49] Um Because agents are non-deterministic. [09:53] We've all been used to program and write much more deterministic flows. [09:57] And we know how it works. [10:00] The Can I ask an engineer? [10:01] Engineer can come and tell me how this the algorithm, the sequence of operations. [10:05] Everything is programmed in our mind. [10:06] Everything is expectations. [10:08] But now the agents come into a non-deterministic way. [10:10] And how do we test them, right? [10:11] So, that is very criticality here. [10:14] And yeah. [10:15] We are also struggling. [10:17] Um we've uh started doing building agents. [10:20] We the day to operations was challenging and then we failed in a lot of steps. [10:24] How do we course correct? [10:25] The moment we change something, something else broke breaks, right? [10:29] So, how do we do that? [10:30] Um one one approach that we took uh this is from um research papers uh around the in a multi-step uh orchestration, when an agent makes uh 30 steps or decisions to make to reach to a goal, [10:46] if that is a program or that's a different story. [10:49] But this is not a program. [10:50] This is non-deterministic way of It makes up its own steps every time uh differently. [10:58] So, how can we chart a deterministic graph here? [11:03] Is it possible? [11:04] No. Can we have a trajectory of its starting from an end to a goal and then see how much how far it went in the trajectory and how far it went from the source to the destination [11:17] is what we can compute to evaluate the efficiency or the completeness of the agent agent evaluation. [11:26] So, we we heavily rely on um trajectory vals um and uh this There are few other signals uh as I briefly spoke around uh in the previous slide around the inferred signal. [11:38] Um If the answer is from an in in inferred answer, uh how can we uh loop that into uh and make a signals around uh how can we classify that this is a regression and make fixes towards the agent? [11:59] Uh So, the next is the uh guardrails. [12:06] Um Where Is this the one? [12:12] Yeah. [12:15] So, guardrails and authorization, um this is uh critical displays a critical role in enterprise AI. [12:24] A lot of information is being piped to models. [12:28] Um there could be sensitive information that goes into it uh without our knowledge. [12:33] And we as uh uh leaders, how can we put in this governance layer um to stop this um is very uh critical here. [12:43] And and the concept of uh authentication and authorization um is taking up a different approach here. [12:51] Um traditionally, we've seen um a user or a service account, but now what is an agent? [12:57] Agent can be acting as on behalf of users. [13:00] There is so much of things uh so many of use cases there. [13:03] Hey, book me a flight whenever it's cheaper than $200, right? [13:07] So, we just tell this assertion and then agent go figures out and does this action on behalf of me. [13:12] So, is it me making this purchase or is it agent me making on behalf of me? [13:17] So, there is Agent acts as a on behalf of user or agent uses a service account as well. [13:24] So, the line is being blurred here and we need to make fine-grained authorization decisions here, and the policy layer that's where the guardrails and authentication authorization plays a critical role. [13:36] And in the one what we employ here is before every tool call pre-tool and post-tool, we have this guardrails to check and block and make a informed decisions. [13:52] And this single agent versus multi-agent, again, this is kind of a orchestration wars you can think of with it to build a single agent or a multi-agent. [14:03] Again, as Roberto briefly hinted if you can't perfect and build a single agent, why go towards multi-agent, right? [14:12] So, learn from our uh failures, experiences, and build towards that. [14:18] At Navan, yeah. [14:20] What the approach that we have taken is single master, and then we adopted sub-skills. [14:26] Um There are sub-agents within it. [14:29] So, it's a single agent that can progressively load the skills and understand decisively what needs to be loaded into the context, and then make this navigation through the use case. [14:44] But there are other patterns that are also emerging. [14:48] There are different class of use cases here. [14:50] One is um agent-to-agent communication. [14:53] So, there are If you take a large scale organization, and there are so many of these teams that are that are acting as the boundaries, and they don't talk to each other, let's say. [15:02] How do we communicate? [15:03] There are two agents on either of the side, right? [15:06] How do we do it? [15:07] So, there is A2A protocol which can help us establish the contracts in terms of skills. [15:14] And we can use A2A as a protocol there, which kind of is a boundary between the teams. [15:22] Yeah, over to you, Uday. [15:29] All right. [15:29] So, as we went through the stack, it's obvious that um some components of the stack are in a more mature state and we already have good answers for them. [15:40] As Uday said, the runtime, I think it's pretty much solved. [15:43] We are so advanced in orchestration and we are running LLMs in kind of uh a very uh brute-force way. [15:51] So, scaling is not a not a problem. [15:53] Also, memory, I think uh as uh the frontier LLMs get better and as our practices get better, we will uh find a way to cover the majority of the use cases and there is good maturity around the the cloud providers. [16:10] Uh MCP has emerged as the de facto protocol and tool calling is now a feature that everybody supports. [16:18] So, we are seeing some industry convergence around that as well and MCP as a standard is also evolving. [16:25] Now, it's becoming stateless. [16:27] It's uh we are reaching a point where kind of we know how to invoke uh services and and and tools with agents. [16:35] Uh in some areas, things are happening, but you know, there's still a lot of unknown. [16:41] Around observability, there is a push towards OTEL, but does OTEL really work for agentic calls? [16:49] Uh yeah, you can make it work as Uday was saying. [16:52] Um also, we are getting more comfortable around um around that the the the the testing patterns. [16:59] It's very hard to test, but we have found a way to give customers um quality experiences even with the unreliability of agentic system and I think that's kind of [17:09] uh getting in a in a state that is uh that is more better defined. [17:15] Orchestration is another one um, where, you know, we have a uh, we have patterns, uh, we can build, you know, bigger agents, smaller agents. [17:27] Uh, as we said previously, probably the right answer is to not over-engineer. [17:34] Uh, so we're learning there and and and uh, a pattern of school thought is also emerging. [17:41] Uh, where we're all struggling with and the previous talk was about this for the developer, um, AI assistant development perspective, but also we're seeing these issues from our production agents. [17:54] It's very hard to predict cost and it's very hard to manage cost, uh, and put guardrails and solve this in a way where there is reliable, maybe fallback or have agents be, [18:07] uh, using cheaper models for certain tasks. [18:11] Uh, uh, this is all driven by kind of the big AI vendors who, I think, their interest is for us all to spend more tokens. [18:21] Um, replay and debugging, Woody talked about that, that's also a big big issue. [18:26] It's very hard to understand, but I think this is also something that that is going to be solved because we can now use, uh, agents to uh, get over the cognitive overload of trying to debug [18:41] what they do. [18:43] And then standards, um, standards are emerging uh, by, you know, the community. [18:50] Uh, Hotel, as I mentioned, agent to agent is young, it's kind of pushed by certain vendors, but I think over time we will we will get, uh, there. [19:00] Uh, with all of this said, you know, we know what we need and it's up to us to write and build it. [19:07] Thank you, everybody. [19:09] [applause] [19:27] I