Latest / Agentic Conversations (formally mlops.community) / 9 Commandments for Building AI Agents
Transcript
- 0:00At any given point in time, there will be a bottleneck or
- 0:03something that doesn't work. It's like, oh, we need, you
- 0:05know, authentication solution. We need a better RAG solution.
- 0:08We need a better embedding store.
- 0:10We need the better model. Yeah, I don't think there's a
- 0:13simple vector where I say like, well, in that space we'll never
- 0:15buy again or never build. How do you make sure that your
- 0:19agent has this idea? OK, this is ambiguous actually
- 0:23don't know what to do. So I need to go back and forth
- 0:27with a person to actually understand what the problem is.
- 0:31We always prefer to have this clear borders between things.
- 0:35Reason, act, observe, plan, act. It hardly ever happened like
- 0:42this. Today we're talking with Paul
- 0:47and Dimitri about building effective AI agents and the
- 0:52design principles that go into that.
- 0:55Paul is the VP of AI at Process and Dimitri is a senior Director
- 1:00of Data Science. I, myself and Dimitrios the host
- 1:04of the ML OPS Community podcast that you are listening to.
- 1:08Let's get into the conversation. For all this talk of AI
- 1:14workforce, I still haven't seen enough agents helping me with my
- 1:17work. Your e-mail has got to be
- 1:21basically your whole when you opened your laptop, the
- 1:24notifications that you had were overwhelming me just in the 1st
- 1:285 seconds, yeah. But I mean, you know, it would
- 1:32be helpful if they actually start to take away some work.
- 1:34So far, they're helping a lot in creating more work.
- 1:37But it goes to that idea of the cognitive load and then how you
- 1:41can get this overload because information is so cheap now.
- 1:45Yeah. And how it just, it can be so
- 1:48noisy. I continuously reference your
- 1:51idea on. We plugged an agent into GitHub
- 1:54and we turned it off about 6 hours later because it was just
- 1:57constantly pinging and pinging. Super verbose, like giving all
- 2:00sorts of commentary that just then requires you to read that,
- 2:04process it, judge it, and act on it or not.
- 2:07I call it like the agents or the LLMS, and AI in general is
- 2:13disrespectful of my time. It doesn't recognize that.
- 2:17You have a finite amount of time.
- 2:18Yeah. And so it will be verbose and it
- 2:21will give you all of this information or it will ping you
- 2:24and just kind of like about nothing important.
- 2:28And so that discernment, I'm not sure if you figured out a way to
- 2:33get through that filter. Oh, yeah.
- 2:36So I think there's a lot of interesting lessons from
- 2:39building agents for e-commerce where each of the initial
- 2:43experiments we were doing, we're just building, let's say, a
- 2:46chatbot for, you know, shopping and ordering food for buying a
- 2:50car, for looking through real estate.
- 2:52And it was sort of like you get people coming in and they say,
- 2:54you know, they're looking, let's say on OLX, right, which is our
- 2:58second hand marketplace. And they type in, you know,
- 3:00iPhone 15. That's start of the conversation
- 3:02is iPhone 15. If it's a search engine enter
- 3:06and then comes back like 10,000 tokens of yeah, you know, we've
- 3:10got this one over here. And then, yeah.
- 3:13Instead of just scrolling, you realize that that's suboptimal.
- 3:16So how do we deal with that? To ask you a question, we're
- 3:19starting to go into much more of an intuitive UI with Gen.
- 3:22AI, which is you give people some information, of course, but
- 3:26you know, which is tends to be more visual, much more
- 3:28structured. But at the end you have buttons.
- 3:31I said, listen, you now need to choose.
- 3:33Do you want more options, different options, cheaper
- 3:36options, options near me And so you kind of pre select what the
- 3:40next thing is the user wants to do.
- 3:42Yes. And you make it a clickable
- 3:44thing as opposed to then putting that sort of high cognitive load
- 3:46burden of them and actually having to describe all the other
- 3:50things that they want. So anyway.
- 3:52So this this feels like one of the principles in building out
- 3:56agents. We want to talk today all about
- 3:58the different principles that you can have when and you need
- 4:02to think about on a technical level with Dimitri.
- 4:04But then here, just like from your side of the fence, how do
- 4:09you enable the team to go out and make sure that they are
- 4:14fulfilling these different principles?
- 4:16And so when I think about this, I reference the last talk that
- 4:21we had with Flores and how you all are doing hackathons all the
- 4:25time and you're trying to really push the boundary of what are
- 4:30some wild ideas of where we can throw in agents.
- 4:33Through that, I imagine you learn a lot.
- 4:36Yeah, there's a lot of different things here.
- 4:38There's a big open question. Yeah, we do a lot of different.
- 4:41Whatever thongs, right? Viveathons.
- 4:43Codeathons, Hackathons. Oh, Viveathon.
- 4:46We did do a vivaton recently where?
- 4:47Sounds different than what I thought it was going to be for a
- 4:51minute. And so the, the, the, the, the
- 4:55goal here is, you know, the role of our team, right?
- 4:57So is, is, is to basically figure out where can we move AI
- 5:02into production agents, into production, into real products,
- 5:05into the real teams, that, where is it ready?
- 5:07And so the only way to do that, because this is, you know, the,
- 5:10the, the field moves so fast, the tools evolve so quickly is
- 5:13to continuously, you know, roll up your sleeve and try them in
- 5:17an AI team. You may assume that we all know
- 5:20and see and use all the tools every day and we try to, but if
- 5:24you don't actively spend time on exploring that, you also fall
- 5:28behind, right? We tried Devon a year ago.
- 5:31We tried, you know, madness. The moment came out six months
- 5:34ago. We tried DeepSeek all these
- 5:36things. And if you try them again today,
- 5:39they're significantly better, right?
- 5:42And many other tools that we tried didn't get significantly
- 5:44better yet, right? So, so having this sort of
- 5:48continuous drive to experiment, to try to hack around and see if
- 5:52they work is something we have very much in the DNA of the team
- 5:56to make sure that we also understand what's real and can
- 5:59go into production. And at the end, our goal and the
- 6:02team is to make sure we build real things that are useful and
- 6:07aren't just a demo. And so to have the distinction
- 6:10of what's ready and what's not, you need to get your hands dirty
- 6:12continuously and try it all the time.
- 6:15I want to ask you about how you think through forward
- 6:19compatibility, because like you said, a you test tools at a
- 6:23certain point in time. Those tools are how they are,
- 6:28but the teams continue working on them.
- 6:30The technology continues to get better.
- 6:33That's great. If you come back to it and you
- 6:35keep revisiting it, that seems like a lot of work.
- 6:40But also there are things that in my head are continuously
- 6:45getting better. And you can try to make them
- 6:49better and brute force this capability from the agents or
- 6:56the LLMS, or you can wait and maybe it'll get better in six
- 7:00months. So thinking through the forward
- 7:03compatibility and how that looks in a future that's moving so
- 7:08fast, like the six months down the line, is there going to be a
- 7:11longer context window? And then you don't need to think
- 7:13so much about trying to hack together a solution.
- 7:16Or is it something that you need to invest time into building
- 7:20yourself? Yeah, it's a great question.
- 7:22So at any given point in time, when we build a gentic systems,
- 7:27AI systems more broadly, there will be a, you know, a
- 7:31bottleneck or something that doesn't work.
- 7:33It's like, oh, we need an, you know, authentication solution,
- 7:35we need a better RAG solution, we need a better embedding
- 7:38store, we need the better model, right?
- 7:41Maybe the model doesn't perform at the same level.
- 7:43And you can think about what to solve the model problem.
- 7:46Like in theory, I could just go and, you know, train my own
- 7:50model, right? But I'll tell you like the
- 7:52fastest high value depreciating asset I know are LMS, right?
- 7:56Like companies spelling hundreds of millions of dollars in
- 7:59training these things. And then three months later
- 8:01there's a new one. And and they, they, they, they
- 8:04switch, right? Like it's a commodity in in many
- 8:06ways, Like then whatever there's a new one, everyone forgets
- 8:09about the old one, right? And all the traffic goes there.
- 8:11So you don't want to end up in a situation where a small team,
- 8:15even though we spend a lot of time on building the right
- 8:17things like, you know, we will train models, but only for areas
- 8:22where we are very confident that, you know, there's no,
- 8:25nobody's going to solve that for us because the specific domain
- 8:28and specific area, we need it to be efficient.
- 8:30So it needs to be fast and so on in terms of so, so forward
- 8:34compatibility here like again going through the list of
- 8:37problems could be, I don't know, maybe this the model we use
- 8:41today is too expensive. Should we therefore not like
- 8:45work with that model or should we just assume that in six
- 8:48months it's going to be, you know, 50% cheaper?
- 8:51And we actually operate under a couple of principles that where
- 8:54we believe that, you know, technology is going to kind of
- 8:57move in that direction no matter what. 1 is models will get
- 9:01cheaper at certain rate and we make some assumptions on that.
- 9:042nd is you know model context will continue to get, you know
- 9:07bigger. We've seen that happening.
- 9:09That's so true. And so you don't want to
- 9:11continuously optimize too much on the rag side and chunking and
- 9:14so on. If you know that eventually you
- 9:17know you'll have a near infinite context.
- 9:20You know, on certain modalities, we have some expectations of
- 9:23this voice or video or imagery that they will be able to get
- 9:26better over time. So you can already start to
- 9:29build solutions that today are 80%, but you know, soon they'll
- 9:32be, you know, 99%. So we, with that sort of
- 9:39intuition of where things will move, we're fairly calm to start
- 9:42building already and sort of take that in six months, it'll
- 9:46be cheaper, it'll be better and so on.
- 9:49But there are some areas where we actually need to build a
- 9:51solution like software to authenticate as part of a rag
- 9:55pipeline, to give you an example, right?
- 9:57We need to retrieve documents that are inside the enterprise,
- 10:00inside the company, and we need to make sure that only the, you
- 10:04know, certain types of agents can access that and use them for
- 10:07answering a certain question. We had that problem 2 1/2 years
- 10:09ago. And you know, we're pretty sure
- 10:12everybody is building these things has that problem, right?
- 10:15Because you need to also give agents the right permissions and
- 10:17so on. So then the question is, do you
- 10:19build for that yourself? And you're, so that is kind of
- 10:23the framework that you're working under and that's why you
- 10:27continuously are revisiting the different tools and you're
- 10:30seeing, did they get there yet? All right.
- 10:32We've got our eye on these set of providers like the composio's
- 10:37or the arcades or whatever it may be.
- 10:40You know you need off and so you're keeping an eye on the
- 10:44space, you're testing it and then you're waiting and then
- 10:47you're testing it again and you're waiting and you're
- 10:49seeing. Is it advancing in that rate
- 10:52that we're looking for? Absolutely.
- 10:54And and you know, there's just so many of them and the problems
- 10:58you're trying to solve are real observability, RAG
- 11:02authentication, you know, logging.
- 11:05And so all those things are real evals, real problems, and they
- 11:09all try to solve those real problems, but many of them
- 11:11aren't there yet. And so we try it, whether it's
- 11:13Align Smith and Arcade or Compose you.
- 11:15And sometimes, actually most of the time, unfortunately, we
- 11:18still have concluded that once we move to production, the tools
- 11:21are not there yet. But again, we're small teams.
- 11:24So I very actively encourage everybody in the team to make
- 11:28sure if there's somebody out there that solves this general
- 11:31problem, let's use that tool as opposed for us to build it.
- 11:36Unfortunately, often still the tools aren't ready yet, but
- 11:40we're starting to see with Arcade a good example, which we
- 11:42know we're now adopting because it's good, you know, good enough
- 11:47for what we what we want to build.
- 11:49And there's several others now in the, in the, in the, in the
- 11:51tool suite that we'll talk about.
- 11:54But there's another thing like actually what's in our benefit
- 11:58is that it's much cheaper to build software for it, you know,
- 12:00much easier because we've got all these tools now.
- 12:02So in some cases, we're actually faster, better off just to
- 12:07build, you know, our customized solution with of course, the
- 12:13Devins, the cursors, the wind serves of the world.
- 12:17Because it's much quicker than to go out there and evaluate 5
- 12:20vendors and test their solutions, which are never
- 12:23perfect for your, for your situation and get legal
- 12:26agreement, do price negotiations and so on.
- 12:28It isn't just only a economic like, is it what's cheaper,
- 12:31what's faster, right? And something we just need to
- 12:34move fast. And so we'll just put something
- 12:37together and some parts of the software that's fine to build
- 12:40our own. But what we see is it's much
- 12:42easier these days to and cheaper to build your own than it used
- 12:46to be 2-3 years ago where you just don't have time to build
- 12:49whatever, right? You know an authentication
- 12:51solution or content management system, whatever, right?
- 12:55So. Are there vectors that you feel
- 12:57like have been completely demolished that you never want
- 13:03to build or you never want to buy anything in that space
- 13:08because it's so easy to build and that time to production is
- 13:12so fast? Well, and it's never say like
- 13:16always or something or never or whatever.
- 13:18I think you, you know, as engineers, I think we always
- 13:23have the natural propensity to build, to build yourself.
- 13:27Yeah, right. It's fun.
- 13:28We think we, we, we, we prefer to do that.
- 13:30And so we understand it. So that's kind of where it's
- 13:33been. And then of course, as a team,
- 13:35you need to sort of make sure that you choose wisely.
- 13:37Build or buy and building is becoming much easier and
- 13:41cheaper. So that's that's one reason
- 13:44where for small things, we will build and and and ourselves more
- 13:48more frequently and buy hasn't been ready for many of the cases
- 13:52where concerns agents in production, but by the the space
- 13:54of options, what you can buy, of course, in two years from now
- 13:57will be much richer, right? You have all these startups that
- 14:01will mature, the solutions will mature communities, open source
- 14:03projects, standards like MCP. And so we, I mean, we build
- 14:07basically like a solution for MCPA.
- 14:09Year and a half ago they were called the tools controller,
- 14:12right? And now we have MCP and we're
- 14:14grateful because now you know, that makes all of our work much
- 14:17easier, right, because there's an agreement standard to this.
- 14:19So I think there will be some areas where, yeah, I don't think
- 14:24there's a simple vector where I say like, well, in that space
- 14:27we'll never buy again or never build.
- 14:30It really will depend a little bit on also what others are
- 14:32doing with compatibilities, with the models, with the, you know,
- 14:35other parts of the software stack you're interacting with.
- 14:38You've mentioned a few times different things that you're
- 14:42encountering and then later tech comes out to or a open source
- 14:48project or the standard like MCP.
- 14:51Do you see the folks that are on the team building tools and
- 14:59specifically becoming more adept at the tool building process?
- 15:06Or is it more in the vein of I just want to have the agent and
- 15:10I'm going to build this agent that goes and does something for
- 15:14me? So right now we are definitely
- 15:19thinking about most of the things we build as a, let's say,
- 15:26a set of building blocks that the end user can quickly stitch
- 15:31together to solve their need. I'll be give you a specific
- 15:33example. So our internal, you know, AI
- 15:35assistant token has been around for a while as if we talked
- 15:39about other episodes, you know, that answered millions of
- 15:42questions for, you know, 10s of thousands of employees around
- 15:44the world. And now people have, you know,
- 15:48lots of use cases as part of their daily workflows.
- 15:51Hey, I get this Excel sheet. I need to kind of upload it and
- 15:54write a memo around that, like a monthly report or something.
- 15:58Or I've got some customer calls that are coming in.
- 16:01I need to transcribe them to figure out, you know, what's
- 16:03being said in the sentiment. So there's examples where people
- 16:07are starting to basically, you know, integrate this, as you
- 16:11know, daily updates, daily reminders of things that they're
- 16:13doing right. Give me a plan, give me actually
- 16:16an agenda for the day. Generate a dot ICS file based on
- 16:19these things that I want to do that I can upload to my
- 16:21calendar. So I've got all my invites
- 16:23there. That's cool.
- 16:24So, but but those are you will be doing just something for the
- 16:27me and you know, the next person in the team will do something
- 16:30else. And so we are now with Tokan
- 16:35building spaces where people have basically the ability to
- 16:38create their own tools, integrate into their Salesforce
- 16:41environmenttheirmonday.com environment, their data bricks
- 16:44environment and have this general agenda capability that
- 16:48then they can point to those different tools to solve a
- 16:51certain problem. Many of those people are not,
- 16:54let's say native AI practitioners, right?
- 16:56So we need to make it really easy for them.
- 16:58There was like, think of it like GPTS, but you know, custom to,
- 17:02for us to, to pros to commerce to the our world, right?
- 17:06And that means that we have a certain set of systems that we
- 17:10integrate with, like I mentioned, data breaks, but also
- 17:13other cloud environments with data and them or financial
- 17:16systems, SAP and some that are standard tools that we make
- 17:19available. So anybody in finance can
- 17:22connect their part of that database or anybody in HR or the
- 17:25legal teams or the data engineers and so on to create
- 17:29their own agentic system. So then it's about offering
- 17:32people a general identity capability with a set of tools
- 17:37and giving them a no code way to describe what they're going to
- 17:41do. This agent or this space, this
- 17:44workspace, and this still can workspace is going to be meant
- 17:47for as an HR support bot, right? And then basically this HR
- 17:53employee points to what data that HR support bot needs to
- 17:56have access to, how to behave. They describe that click and now
- 18:00it's published to everybody in process and they can now get,
- 18:03you know, questions about paternity leave, about a
- 18:05performance review processes and so on created by somebody that
- 18:09has basically no and didn't have to program or understand any of
- 18:12the underlying agentic systems to build it.
- 18:16Do you feel like as you are using agents more and more it
- 18:23becomes clear that that is the way forward where these tools
- 18:28are going to be built with the number code solution?
- 18:31But then you have the engineers on the back end that are making
- 18:34it as easy as possible for the subject matter experts to put
- 18:39their magic touch on it and do their stuff.
- 18:44That's exactly right. So we actually have this theme
- 18:47across processors, AI workforce, and Sean will talk about that
- 18:50where we want to make sure that everybody's got access to their
- 18:53own AI workforce. You know, considered everybody
- 18:56should be able to have, you know, a team of junior analysts,
- 18:59some interns that are agents, right, that that they can create
- 19:04and have them work alongside them.
- 19:07And so we have very specific initiatives, you know,
- 19:10objectives for the coming period to actually measure number of
- 19:15agents that are created across the company, how often they're
- 19:19being used, how many questions they're asking to actually push
- 19:23the adoption of these basic capabilities for anybody in the
- 19:26organization that, you know, doesn't need to be software
- 19:29engineering, it's actually should be anybody.
- 19:32And we do that through Tokan and many other tools of course as
- 19:34well. OK, so going to these 10
- 19:37commandments that Dimitri is going to talk to us about, I
- 19:40wanted to get specific on one that potentially isn't
- 19:44understood the same way by every person, which is the memory
- 19:47piece. I know there's almost like two
- 19:49ways to think about memory. One is I know that you like
- 19:53buying a certain type of shoe or I know that you like these
- 19:58movies. Traditional kind of recommender
- 20:01system, I remember that you do these things and so I'm going to
- 20:06know that for the next interaction with you.
- 20:09And then there's another memory, which is the agents remember how
- 20:13to do things. And so they have this tool in
- 20:16their tool belt. Like you were saying, when
- 20:18you're connecting the different systems together, it would be
- 20:24great that an agent learns how to do something within a system
- 20:30and then it always has that in their memory so that it's not
- 20:34just guessing when it is trying to accomplish that same task
- 20:39again. This is such an interesting
- 20:42topic. I think the memory piece is, you
- 20:45know, it's an obvious area that we need to build that once you
- 20:49start to think about, you know, the types of memory that these
- 20:52agents need to have to accomplish certain tasks, they
- 20:55become, you know, you know, it becomes much more granular and,
- 20:59and, and in a way, nuance complicated what you need to
- 21:01build short term memory, long term memory, you know, like a
- 21:05character, right? How do they behave over time and
- 21:08so on. So there's lots of things to be
- 21:10said. Let me focus on the piece of the
- 21:14agentic memory, which is related to getting better at a certain
- 21:17task, which I think was where you were going, right?
- 21:21Because all sorts of other memory, like memory about me
- 21:24because you talked to me 25 times and so on.
- 21:26But let me focus on getting things done for you better and
- 21:29faster. Whether it's, you know, helping
- 21:30me with the PR and the software world and a genetic system like
- 21:34Devon or Manus or the e-commerce agents that we're building with
- 21:39the large commerce model and so on to help you find what you
- 21:42need. I think the overarching sort of
- 21:45thing that we're seeing here is that these agents will are now
- 21:50starting to learn from their experience with the world.
- 21:53And what does that mean if I go in and use an agent in in a
- 21:59commerce setting like we do at I food and Olex and take a lot in
- 22:02E Mag and the companies of the pros group.
- 22:05This agent, let's say I I come in with a search query and you
- 22:09know you're going to have a conversation with me about this.
- 22:12I don't know, let's say an apartment you want to rent in
- 22:15Poznan in Poland and it will help you find what apartment
- 22:20you'll say, well, I have this kind of requirement needs to be
- 22:2260 square meters. This is my budget.
- 22:25It needs to be in this area. And it's sort of refining that.
- 22:28And eventually, you know, you'll know whether we, we know the
- 22:31agent will know when this person contacted the the renter and
- 22:35said that's a successful event right now that we have, we've
- 22:37helped them something that they thought thought was interesting.
- 22:40And so in some cases, you also know when they actually, you
- 22:42know, made the agreement to move to that apartment.
- 22:45That journey is now something we can see, OK, that that was a
- 22:49helpful agentic journey. There's also other cases where
- 22:52the person doesn't find or it doesn't succeed, or we ask the
- 22:55agent to help browse the web, right?
- 22:58But it didn't find the information it needed and so on.
- 23:00That's also useful because that's a negative example, like
- 23:03in this case, it wasn't helpful for the intent of the user.
- 23:07Those experiences, if you store them, you can actually train
- 23:12your model to do better reasoning, right?
- 23:14Because all of these are reasoning agents now, right?
- 23:16So they have a model that they, the first thing it does is it
- 23:19reasons like DeepSeek, we've all seen it.
- 23:21And then now O1, O3O4 and so on are first making a plan and
- 23:26thinking through how should they approach this problem.
- 23:28Now that's generic reasoning. It's great.
- 23:31It's generic reasoning for answering a certain question
- 23:34that you any question on Chachi, BT, Claude, Gemini and so on.
- 23:39What we're trying to figure out is what does it look like if you
- 23:42use the experience of the agents storing when it was successful
- 23:45or not successful, those experiences to fine tune the
- 23:49reasoning. So now the reasoning becomes
- 23:52really good to help you build a certain type of software in your
- 23:58coding environment, right? Because you always care about
- 24:01having these standards. Or it becomes really good at
- 24:04taking a query in food delivery search query and helping the
- 24:08user find what they actually were gonna want to order.
- 24:11And when you say fine tune, you mean actually renting GPU's and
- 24:17fine tuning for? Yeah, we're training.
- 24:18It's not just throwing it into the.
- 24:20Training models, and it's not even just only fine tuning,
- 24:23there's all all of the training variants you can imagine that
- 24:26we're we're working with now to basically create models that
- 24:32understand what the best path to success looks like and what it
- 24:39what we're able. The reason we're able to do this
- 24:41because we can actually very quickly gather data other what
- 24:44works or not, because these are, you know, real experiences, real
- 24:46products in the world we've got. And, and so that allows us to
- 24:49create that flywheel, collect experiences got to the objective
- 24:54or didn't get to the objective. And it's sort of a, it's, it's
- 24:56sort of a reinforcement learning, not in the traditional
- 24:59technical reinforcement learning sense, but you do store the
- 25:01successful path and that becomes input in the next training
- 25:05round. And you're saying that is
- 25:08creating more memory, where that is it?
- 25:10It's like inherent memory in the model now.
- 25:13Right. And so that is it's it's a form
- 25:15of memory because you're storing all the successful paths to a
- 25:18destination, right? Or successful action because we
- 25:22have got, you know, hundreds of millions of interactions with
- 25:25users, those paths our store their memory, right?
- 25:29This I actually learned how to help somebody find their shoe,
- 25:32right? I actually learned where is the
- 25:33best way to help advise somebody on finding an apartment to rent
- 25:37in Poznan. I sorry I thought you meant find
- 25:40your shoe like you lost it in. Oh, no, yeah, sorry.
- 25:43Like buying a shoe, Right. So finding the shoe that you
- 25:46want for your next race. I lost my last example.
- 25:48Yeah. And I needed to find it.
- 25:49The model helped me. Yeah.
- 25:50And so, yeah. All right.
- 25:51Or if somebody says, hey, I want something healthy quick for
- 25:54lunch at the office. Yeah, like that's a search query
- 25:57that, you know, surprisingly, I guess surprisingly we're very
- 26:02bad at like at answering today, right?
- 26:04What's healthy for me? What's what is quick.
- 26:07What's yeah. And does it matter if you're at
- 26:09the office? Does it matter if it's you
- 26:10versus me? Like all these different things
- 26:13that by, let's say, being very deliberate about what memory
- 26:20you're you're creating and giving the agent access to can
- 26:23make a big difference. So.
- 26:25I hadn't heard or thought about that way.
- 26:28In thinking about memory, as you're taking successful
- 26:33journeys, you're also taking the non successful journeys and then
- 26:36you're giving the agent you're you're spending cycles on fine
- 26:41tuning it so that the agent has that part of it.
- 26:44I had always looked at it as something that you do after the
- 26:48reasoning model is there, or after you've set up your agent
- 26:52and it's just like memory that you're bolting on top of it with
- 26:56caching it for example. You can do that.
- 26:58So you can definitely do that. So some areas where we've done
- 27:03similar things is, you know, we, we've been playing out with web
- 27:08browsing agents like many others.
- 27:09So you give it a task, go and I don't know, find me the, the
- 27:13cheapest iPhone 15 seller today, right?
- 27:17Or help me order, you know, salad for lunch, let's say in
- 27:21the food earning space. And then this agent goes starts
- 27:24to browse it goes to the various websites.
- 27:28And what we saw initially was, you know, wow, like we tried
- 27:32this 50 times and it only succeeds, you know, 10 times and
- 27:36maybe sometimes five times because it got stuck on a
- 27:38capture, got stuck on it didn't scroll.
- 27:42It didn't really find the items because the search term it used
- 27:46wasn't good. So but what's cool is that you
- 27:49give it a simple task, go and find me a cheap healthy lunch to
- 27:52order to my home. And it goes to all the food
- 27:55delivery providers. It looks at the restaurants that
- 27:56are open it it goes and browses the web, right, like you or I
- 27:59would. But that search space is
- 28:04actually pretty broad, right? It'll take all these steps and
- 28:06these paths, if you will. And out of the fifty tries,
- 28:09let's say 5 are what you would have liked or you would have
- 28:13done yourself, right? And we then store those five so
- 28:19that next time somebody comes in and searches for food, in a
- 28:23general sense, it will access those five paths as a reference.
- 28:27Successful way to get to that. There will be slightly different
- 28:30things because maybe I was ordering in a different area and
- 28:33you're there or in different country or you know, you gave a
- 28:36different preference for whatever you wanted.
- 28:38Or the website got updated? Well, the website got updated
- 28:40then. Yeah, exactly.
- 28:41Then you're screwed. You're going to, well, you're
- 28:43going to find, you know, five more ways not to do it right,
- 28:46not to succeed. So and that can be accessed
- 28:51perfectly as it sort of, you know, in a cashed way.
- 28:56It doesn't need to be trained in the model, right?
- 28:58We also try those things. But I think the the important
- 29:02piece is once you start to be delivered about storing what's
- 29:05successful and what's that isn't the path to get to successful
- 29:09outcome. You can then feed that into the
- 29:11model either as a cash or through RAG, or eventually if
- 29:16it's large enough, like in our case, we actually also train
- 29:19models on that as well. It really goes back to what I
- 29:22was talking with Giannis about yesterday and he said, Oh my, my
- 29:27take is that evals are your Moat and so the better that you can
- 29:32get with your evals, the better you can expect your agents to
- 29:37perform. It's a really important
- 29:43realization to to, to like, if you don't know whether what your
- 29:49model or your agent did was good, very hard to improve.
- 29:55Like that's simple, right? I think that notion every
- 29:57understands. But then what does that mean in
- 29:58the real world? That means you need to actually
- 30:01get feedback from the users or know what they were trying to
- 30:04achieve or and know what they were trying to achieve to know
- 30:07whether they're successful or not.
- 30:08Because we've got, you know, basically 2 billion consumers
- 30:11that we serve across various parts of the world, interacting
- 30:13with the platforms in different ways.
- 30:15We do have ways to know whether they got to their outcome, you
- 30:19know, did they find what they were looking for?
- 30:21Did they buy something? Did they contact the seller if
- 30:24they're on the second hand marketplace and so on.
- 30:26That is an evaluation, right? Eval is a technical term we
- 30:30would use as AI development. Basically this was it, was it
- 30:34good or not? Was it successful or not?
- 30:35And that flywheel is indeed a mote because that means you can
- 30:39then feed it back into your genetic systems.
- 30:41They can use that to get better the next time this similar
- 30:45similar question comes in. And I like how you're saying
- 30:47there's many different ways. Once you know if it was
- 30:49successful or not, which is step one, yeah, Then you can figure
- 30:54out how to incorporate it into the technical side of the system
- 30:57with caching it or updating your RAG system or fine tuning it.
- 31:02I also like that you are hyper focused on certain tasks or
- 31:10certain verticals per SE. For example, if it is in
- 31:15e-commerce and you're just trying to figure out the path of
- 31:19one of these food delivery systems.
- 31:21When someone is using that, you know there's only a select
- 31:26amount of things that someone is trying to do when they get on to
- 31:31app and it's probably along the lines of ordering.
- 31:36Food, yeah, or ordering travel and so on.
- 31:39And we found that especially the generic agents, the broad ones,
- 31:43they're, they're very bad at some of these specific things.
- 31:46Like if I actually wanted to get some help in booking a flight,
- 31:50the agents get stuck. Like things that we think are
- 31:53very easy, these agents fail at. So an example is scrolling is
- 31:59not something they automatically do or understand or think about.
- 32:03If I go and select my departure and this and arrival
- 32:07destination, airport or look at the dates, typically every
- 32:10travel website is a little pop up, drop down, yeah, scrolling,
- 32:14pick up whatever calendar you need to pick up the dates suck
- 32:17at that. And so we were trying to do, you
- 32:20know, those help the users do those tasks.
- 32:23And sure, you know, you could perform at, you know, 50% on OS
- 32:27world benchmark or whatever other, you know, web browsing
- 32:31benchmark, these agents are being benchmarked against.
- 32:35That actually doesn't translate very well to the use cases we
- 32:38were help we are helping our users with.
- 32:40And so then storing this memory, right and say, OK, actually
- 32:44this, this is the way that you help the user find the flights
- 32:47from A to B and you need to scroll right, or you need to
- 32:50actually translate these dates into an action on, you know, a
- 32:53grid with a calendar and so on. Those are the kinds of things
- 32:56that we need to build and be very specific on to get to a
- 33:00certain level of accuracy for the user.
- 33:01Because this is, if it's not like in this case, we 95%
- 33:05successful or useful people won't use it, right?
- 33:08If it gets stuck all the time and you know and then chooses.
- 33:11The wrong flight. Yeah, exactly.
- 33:13Doesn't accept cookies in Europe.
- 33:16You need to accept cookies. A lot of agents don't know that
- 33:19so. They haven't been trained on
- 33:21enough European data. I want to bring in the experts
- 33:26now though, so let's get to that conversation.
- 33:30Action live. We are here with Dimitri in the
- 33:33studio. It's great to have you.
- 33:35I want to talk all about this unified rule set for building AI
- 33:39agents that you have put an enormous amount of thought
- 33:42behind. When I saw it I thought man this
- 33:46is so good. We need to have a full
- 33:48conversation and podcast and breakdown some of these.
- 33:51Hopefully we can get to all of them but I I want to hit the
- 33:54most important ones to start. That being said, AI agents is a
- 33:59contested term. You have a special definition
- 34:03for it. Give it to me.
- 34:04Yeah, so, well, thanks first of all, thanks for having me here.
- 34:09Yes, I think that for me, AI Agent is a solution that is able
- 34:16to achieve a task by selecting by itself the path towards the
- 34:22goal and also by defining itself what the end is, so where to
- 34:30stop. And I know that it's not
- 34:32complete. And you can have so many corner
- 34:34cases where you would point to a simple piece of software and
- 34:38say, well, it's kind of does that.
- 34:41And I know that some people say, well, what would be good to add
- 34:45here is memory. So it can learn from the past,
- 34:50It can learn from its mistake and do better.
- 34:53And yeah, I think that it's a, it's a fairpoint.
- 34:58But again, there are so many cases where you say even without
- 35:01memory, you can build a successful agent.
- 35:03Yeah. It does give you that spectrum
- 35:05of it's autonomous in a way. It also knows when to stop.
- 35:09It knows when to get more information.
- 35:11It's not a workflow that just gets kicked off and it's not
- 35:14something that you have to hard code and say do this, this,
- 35:17this, then this with a little LLM sprinkled in there and then
- 35:20you call it an agent. Exactly.
- 35:22So not everything which uses LLM and Flexible execution pass is
- 35:29an agent. So we need to be careful here.
- 35:33But also not everything which has certain rules predefined
- 35:38rules is not an agent. There are a few fundamental
- 35:45principles when building agents and I think you with this
- 35:50document you put the most fundamental at the top.
- 35:54What is that? Well, for me, the most important
- 35:58part is how does a cycle of an agent look like, right?
- 36:03So when we started building agent, by the way, we didn't
- 36:05know it was called agent yet. It was a couple of years ago and
- 36:10we did this piece, I believe that you talked to some of my
- 36:13colleagues about data analysts, right?
- 36:15And we essentially implemented what is now called React cycle.
- 36:23So reason act where we say you know what most of the problems
- 36:29that you need to address, they will be implemented by doing 2
- 36:34separate parts. One part is what we call
- 36:38comprehension and reasoning and another one is execution or
- 36:42acting. This is why React as a name is
- 36:45still a very popular concept and depending on a task at hand you
- 36:49will have a very different distribution of complexity
- 36:53between a comprehend and between execute or between reason and
- 36:57act. So let me give you an example.
- 36:59If you think about data analyst type of agent.
- 37:03So something which takes a problem and tries to extract
- 37:07information and provide you with an answer significant.
- 37:12The most complex part of this would be comprehension.
- 37:17So how do we take what user asks and bring it to the point when
- 37:22we know what we actually, what data we need to retrieve, what
- 37:27report we need to write? It's very difficult.
- 37:30My favorite example, it's real one.
- 37:32Somebody goes to data analyst and says what is the fastest
- 37:35growing company? Fastest growing by profit,
- 37:40revenue, people, sales. So open-ended.
- 37:44Fastest growing in last month last year.
- 37:47What do you mean right so and how do you make sure that your
- 37:52agent has this idea? OK, this is ambiguous actually
- 37:56don't know what to do. So I need to go back and forth
- 38:00with a person to actually understand what the problem is
- 38:04and then once you arrive so understand what's what person
- 38:08does a person actually means what is the fastest growing
- 38:11company from our portfolio based on the revenue in the past year.
- 38:17This is very easy to give to LLM to say, OK, please translate
- 38:22this into sequel for example, get this information and then I
- 38:26gonna combine it and present it in the report.
- 38:29So for this type of task, comprehension is extremely alone
- 38:35and difficult and complex and sometimes almost impossible, and
- 38:40execution is somewhat simpler. You can also look at the simpler
- 38:44task. Let's say you you give your tool
- 38:50a document and say, you know, extract all information and tell
- 38:53me a couple of insights about AB and C In this case, the
- 38:59comprehension of a task is very trivial.
- 39:02The execution still not as complex as in the previous
- 39:08example, but bigger than comprehension.
- 39:10So the distribution is different.
- 39:13And this is the first thing that we did.
- 39:15And I think React was the first kind of a conceptual approach
- 39:19that we saw from most companies implementing when we start
- 39:23talking about Agent and then we start having more discussion,
- 39:28OK, but what else is there? So what I like to add is
- 39:36observe, think, act and then reflect.
- 39:44And it's more or less taken this initial things.
- 39:48So comprehension, reasoning and splitting it into two parts.
- 39:53One is observe and this is understanding user and
- 39:58circumstance. Let me give you an example.
- 40:03We did a small demonstration where we were, we created an
- 40:09agent we that can order food for you.
- 40:12So you sit in the office, you basically click a button and
- 40:16you'll say, hey, I'm in office, I'm late, I want my new, my
- 40:19usual. And this is.
- 40:21That's it. And 2040 minutes later there is
- 40:25a Courier at the door and basically you've got your usual
- 40:28stuff, right? So significant part of initial
- 40:35agent work is actually just looking at understanding user
- 40:39circumstance. So saying, hey, this is
- 40:42Demetrius, he's in process office, it's late.
- 40:45So it immediately shrinks the space where solution can be
- 40:52found, right? And then you come and say usual
- 40:56and basically just solves it, right?
- 40:58So it knows what to do. It hands it over to execution
- 41:01part and then basically after it's easy.
- 41:06So hopefully it illustrates a bit.
- 41:09The observed part reflect part is something that is not usually
- 41:18implemented, but at the moment you see it in the very specific
- 41:22scenarios. The best example to give is if
- 41:27you've got a coding agent, because coding agent you've got
- 41:31an assignment, you it's executed, writes a code and then
- 41:35you reflect on the code whether it's by trying to execute it or
- 41:40trying to execute, write an execute unit test or whatever.
- 41:44It sees the result of execution. It says, OK, I'm not doing well
- 41:48on one or two or three matrixes, so I need to repeat the loop.
- 41:53And this would be a part which is difficult to do without
- 41:58reflect, because then you more likely to create solution with
- 42:02errors and all suboptimal solutions.
- 42:06So the observed part is really this filter of do I have enough
- 42:09information? Is the ask clear enough?
- 42:13If it can pass through that filter, then you can reflect and
- 42:18say, can we set something up so that if I do not have some piece
- 42:24of information, I go back and I ask that.
- 42:28And so it's almost like you're getting through the observed
- 42:34part. There's one filter.
- 42:36The reflect part is almost like another filter on top of it.
- 42:39Reflect part is at the end once you execute something like.
- 42:43What did happened during this? Execution.
- 42:45I see. Yeah.
- 42:46The observed parts starts at the beginning, so we understand what
- 42:50the circumstance we are in and then think part is, do we
- 42:53understand what needs to be done and how it shall be done.
- 42:57And think part is more often connected to discussion about
- 43:02ways that we've got static plan and dynamic plan and we can
- 43:04touch upon it later and so on. One of the things that I think
- 43:10people find confusing, we always, I think, prefer to have
- 43:16this clear borders between things.
- 43:18So we say reason, act, observe, plan, act, observe.
- 43:25Think it hardly ever happened like this?
- 43:30Not so bad. Because quite often when you
- 43:32think about what you need to do or you think about context of
- 43:38request, you actually also need to do something.
- 43:42Allow me to again illustrate it with examples that I mentioned
- 43:45before data analysts. So what helps?
- 43:49If there is an ambiguity in the request, that analyst can go
- 43:56read some documentation about company, maybe go to database
- 44:00and look what data is available. So it doesn't go come back to
- 44:05you with this range of random questions trying to decrease
- 44:10ambiguity. It basically come back to you
- 44:12with more precise. OK, but do you mean this or this
- 44:16like this is defined like this and so on and then it drives
- 44:22your kind of communication with agents, so it creates this
- 44:26loops. Yeah, and sometimes the loops
- 44:29can be very small, other times they can be much bigger.
- 44:32But the key is that you have various loops happening
- 44:37throughout your agent journey. Yeah, absolutely.
- 44:40What I put there as a cycle is not prescriptive in a sense.
- 44:43You always have to do it. So there are some use cases
- 44:47where you say OK, like, but reflecting is not critical, so
- 44:53it will not break. Some other cases you say without
- 44:55reflect, you actually never get to this top performance.
- 45:00In some cases you say, you know, observe it's more about
- 45:03personalized and whatever. Like if you've got a very simple
- 45:08task like give this recording, transcribe it and translate it.
- 45:14How much context do you need to understand?
- 45:17Probably 0. You just need to think, OK, so I
- 45:19need to actually call transcription tool, I need to
- 45:21call translation tool if it's separate from LLM, and then I
- 45:26need to basically call something else and I'm done, right?
- 45:29So observe and reflect kind of this additional things that
- 45:35depends on circumstance could be make or break stuff, but the
- 45:40core element is still. Are you looking at that as the
- 45:44agent will figure it out or you are trying to understand the use
- 45:49case and then? At the moment I think that based
- 45:55again on our experience, it's still a bit with a developer.
- 45:59So people who built the agent, they say, OK, this is what we
- 46:03need. But of course, the more
- 46:05sophisticated you've got agents, the more you need this freedom.
- 46:11Freedom indeed. Now there's another design
- 46:15principle that you have which is extracting all capabilities as
- 46:19tools. And I liked this because it's
- 46:22not just other systems or other tools that you can use, like a
- 46:28Gmail tool, etcetera, but even humans can be a tool that you
- 46:33use, if I'm understanding it correctly.
- 46:37I think that you are more adventures, let's put it this
- 46:45way than me. I did not think about humans as
- 46:48tools to be honest. I was thinking about other
- 46:50agents as tools. This was a bit of limit of my
- 46:54risk taken. But no, you're absolutely right.
- 46:57So I think that basically if you look at agent, what we again
- 47:02discussed at the beginning, it's important that agent has old
- 47:09various tools available because it will need flexibility to
- 47:12decide how to execute a task. And I think that in the simplest
- 47:18way, everything that it can call, everything it can use,
- 47:24whether mechanical or human, it's a different story.
- 47:27Could be and should be abstracted the way as a tool
- 47:31with some simple interface for input output.
- 47:35We recently had some ideas from various companies of how it may
- 47:39look like. But essentially if I call a
- 47:43specific tool, it's called via API.
- 47:46If I call another agent, by the way, it could be also done as a
- 47:53call to a tool. If I ask human for help in the
- 47:57way you can abstract it in the such a way that it basically
- 48:02looks like just a call in a tool, and then you've got a lot
- 48:05of freedom I think. Yeah, I was thinking humans just
- 48:08because it's almost like if you think about human in the loop in
- 48:12a way that is kind of a tool because you're getting the okay
- 48:17approval, which can be a tool. Absolutely agree with you.
- 48:21So I I see both sides of argument.
- 48:24So you're basically saying, look, sometimes when we give a
- 48:28request to agent, we already in the way provide ourself as a
- 48:33tool. And I can relate a very simple
- 48:36example. Sometimes I'm using one of these
- 48:39agents to help me to create a documentation and what I put in
- 48:43an instruction for my request and saying if you need more
- 48:46information ask me. So this is explicitly saying OK
- 48:51use this interface so send the question to me and I response to
- 48:56you. And then the way from agent
- 48:58perspectives there is no difference sending me text and
- 49:01getting text from me or sending it to some API text and getting
- 49:06it from there. In the same way if you think
- 49:09maybe another similar example, so you use operator like system
- 49:17quite often they specifically say look you give it an
- 49:20assignment, it will execute, but if it gets stuck it will ask
- 49:24you. Exactly.
- 49:25And it could be in the specified point, for example, when you
- 49:28need to provide a payment, or it could be in the point where it
- 49:31says, you know what, I don't know what to do.
- 49:34So it's like error resolution. And in this case, again, I
- 49:37absolutely agree with you. It uses you as a tool.
- 49:41That's it. So the greater theme here is how
- 49:44can you think about abstracting as much as possible a way to
- 49:50make everything a tool call? Tell me about the sandbox idea.
- 49:55For the cult, yeah. So I think it's also very
- 49:59important. So what we saw over and over
- 50:02again and again, it's not only us.
- 50:05You can see the same idea when you are using other products
- 50:10like Anthropic or Open AI is that you've got tools, but
- 50:16sometimes you've got tasks that cannot be executed by a single
- 50:22tool specific tool. And this is where you want to
- 50:25have a flexibility to just write a code and you see it's
- 50:29happening. You basically have a code
- 50:31executor with limited capabilities to actually write a
- 50:38code. If you want to create graphs, if
- 50:43you want to run data analysis, if you want to ingest data, I
- 50:48don't know many different options.
- 50:52And I think that this is critical because it addresses
- 50:55this gap in OK. There are so many small tasks
- 50:58that you cannot foresee first of all and build it into stand
- 51:03alone tool. And second of all, you actually
- 51:06don't want to overload your agent with a list of 1000, let's
- 51:11say tools it can select from. It's much better to say, OK,
- 51:16you've got this core tool, core tools that you often need, and
- 51:21then whatever other what, 5% of scenarios you can cover with
- 51:27doing code. You build it yourself.
- 51:30The code, yes, you build it yourself.
- 51:32Essentially builds it. And this brings up this question
- 51:35of when is enough enough? I think we mentioned how right
- 51:40now there's a very popular thing of long running agents and the
- 51:43more time that you give it to think and to act, the better the
- 51:48outcome. And you had said there's a
- 51:52scenario where someone gives so an agent a lot of time to try
- 51:58and execute a task and it realizes there was a library
- 52:01that it needed, or it needed something merged APR request
- 52:05merged in a library. So the agent went and sent an
- 52:08e-mail. I.
- 52:09Look, this is anecdotical. I it popped up in my Xfit, I
- 52:15think. So let's take it as an anecdote.
- 52:18But I absolutely believe it when I read it because this is also
- 52:22something that we saw in some instances in our work.
- 52:25If you give a task to an agent and you do not limit execution
- 52:31and it's dynamic execution path. This is, by the way, probably
- 52:35where we need to talk about static plan versus dynamic plan.
- 52:39Yeah, it's a good point. Yeah, yeah.
- 52:41Bring that in. Yeah.
- 52:42So one of the things that people work on a lot is when you have a
- 52:50task and it's as a task is given to an agent, the agent has think
- 52:56about the task. And then as there are multiple
- 52:58options on how to go about it. One is you create a plan
- 53:03execution plan saying, OK, so this is my data.
- 53:06I going to call this tool. I going to take this out of
- 53:08this, call that tool, that tool, that tool, and then I come to an
- 53:13end. This is a more or less referred
- 53:16as a, a static execution plan. It's actually very nice for
- 53:23simple predictable tasks. Again, going back to one of my
- 53:27previous examples, let's say transcribing and summarise in
- 53:32the meeting. Well, it's very clear what needs
- 53:34to be done. There is no surprise between
- 53:37function calls about outcome. So you can do static planning.
- 53:43It's really good in the sense it increases chances of convergence
- 53:48so the agent will reach some result.
- 53:54But of course, for longer tasks there is increased risk of
- 53:58running into error in one of the intermediate steps and that
- 54:02cannot correct because the plan is fixed.
- 54:05Now the alternative to it is a dynamic planning.
- 54:09So you basically say, OK, I understand what I want to do.
- 54:12I know my first step I going to call it and then I going to
- 54:15observe result and I going to call it again something again
- 54:19and so on and so forth. Dynamic planning is great in the
- 54:23sense that it decreases probability of getting stuck on
- 54:27a particular error, but it increases probability of agents
- 54:32never convergent. So it can constantly go and go
- 54:35and go. And this is something that what
- 54:38I say, how do you explain to agents this very human concept
- 54:44that better is the worst enemy of good, right?
- 54:49So because because it's in theory, it can go forever trying
- 54:55to improve on your task and trying to get better and better
- 54:59results. So now going back to this
- 55:01anecdote that you mentioned, let's say you've got agent that
- 55:09wants to write a code and it can write a code, it can test, it
- 55:13can see if it works or not and then improve and so on and so
- 55:16on. And this agent has access to
- 55:19Internet, so it's not a big leap to understand that at one point
- 55:24it say, you know what, I can actually Google stuff.
- 55:27And we see already now if you use, I don't know, O3, for
- 55:31example, it does a web search if it runs into an error it cannot
- 55:36resolve from its brain. And it does web search.
- 55:39And then if you give it also permission to, I don't know,
- 55:45write an e-mail, it can contact people asking for help like
- 55:49package developers. If, if it can go on web beyond
- 55:54web search. So with tools like operator and
- 55:57so on, it can go on Reddit, on forums, it actually post
- 56:00questions. It can.
- 56:01So again, back to what you mentioned earlier, it starts
- 56:05seeing Internet and human as tools to achieve a goal.
- 56:09And if you do not create any bounds on what your next step
- 56:13could be, then anything can happen.
- 56:17And again, it won't be a stretch to imagine if you give it a
- 56:21credit card, it will hire somebody to do a job for it.
- 56:24Yeah, it will go on Fiverr and then say can you do this for me,
- 56:28which is a fairly interesting piece to look at because if you
- 56:34would like the best result possible potentially you're OK
- 56:38with that and all of these outcomes.
- 56:41But now, like you're saying is there's that fine line of how
- 56:45much better can we get it if we let it go and we let it hire
- 56:51someone on fiver and we let it post on Reddit, all of that type
- 56:54of thing when it gets stuck. Or maybe it's just that it needs
- 56:59to incorporate you the human in sooner and say I'm stuck here.
- 57:04Do you have any plans for how I can make this better?
- 57:08So in that design principle, thinking about when to
- 57:12incorporate the human in or how to say enough is enough is
- 57:19something that I think is still. Is that an open question in your
- 57:22mind or have you figured out a way to do that?
- 57:25No, I, I think it's pretty much open question.
- 57:28I think that when to stop is an open question.
- 57:33I think that if you just leave it to the model, you observe 2
- 57:38behaviors typically. One is it's overconfident, it's
- 57:44achieved the goal. Generally.
- 57:46If you look at the lamps nowadays, even on a step of
- 57:49reason and comprehension, it's very difficult to get a model to
- 57:56acknowledge it doesn't know something, right?
- 57:59So you ask, OK, do you have enough information?
- 58:01More likely than no. It will say yes, even though
- 58:05it's obvious, like it's not enough information.
- 58:08And the same way if you ask a model, OK, you executed, do you
- 58:11think you did well and get to a good result, it's more likely to
- 58:15say yes. An opposite side is and again,
- 58:19it depends on what kind of instructions and guardrails you
- 58:22put in place, it will say no and just continue.
- 58:26So it's very difficult to struck the struck a balance between
- 58:31this overconfidence and a constant doubt.
- 58:34And I think it's still an open question.
- 58:37Well, it's funny because that was one of your pillars of what
- 58:41an agent is, is knowing when to stop.
- 58:44Yeah, yeah. Now talk to me about the memory
- 58:49piece. We talked with Paul for a minute
- 58:52in the beginning part of this episode on memory and how you
- 58:56have these two different types of memory paths.
- 59:00You also had mentioned this before.
- 59:03There's the memory of being able to complete a task in a way that
- 59:08it can do that reliably each time.
- 59:11And Paul was saying, well, this is where for us the evals are so
- 59:15important because if you can say what the path that got it to
- 59:19success is, then you can update that information in the models
- 59:27like abilities or toolkit in various ways.
- 59:30Maybe it's through caching or maybe it is just updating it in
- 59:34the RAG system or it's going as far as fine tuning.
- 59:37So for you, how do you look at memory in the space of design
- 59:45principles for building agents? So when I look at memory, I
- 59:51think about a couple of things. First one, you've got short term
- 59:57memory. I borrowed the term from
- 1:00:00somebody that I like. It's called scratch pad memory.
- 1:00:05And it's a, it's a memory that you use within the task.
- 1:00:10So basically you start with a blank list.
- 1:00:13And as you execute the task, as you call different tools, you
- 1:00:17interface with a user, you basically write down what
- 1:00:20happens, right? So this is short term memory
- 1:00:23from within a task. If it's a conversation, that's a
- 1:00:26conversation memory and so on. And then you've got a long term
- 1:00:29memory and a learned term memory is basically what happened
- 1:00:34overall across many interactions, across different
- 1:00:38sessions, across different tasks.
- 1:00:40And for me, this memory, I also look at it from two different
- 1:00:45angles. The first angle is more or less
- 1:00:48personalization. So you've got an agent and it
- 1:00:52executes tasks on your behalf and it learns something about
- 1:00:55you. Remember going back to observe
- 1:00:57like understand user and circumstance.
- 1:01:00So to we're talking about getting intelligence about user.
- 1:01:06So next time you ask my favorite, it actually knows what
- 1:01:10your favorite. It knows your communication
- 1:01:12styles. It knows a lot about you so.
- 1:01:16Basically preferences. It's preferences a bit, people
- 1:01:19sometimes call it like profiles, memories, whatever.
- 1:01:23But it's learnings about you that need to persist and need to
- 1:01:28be used later during an execution task.
- 1:01:32Now the second type of memory is OK, I did this task.
- 1:01:37What did go well, what I need to do better, and this is not
- 1:01:45related to you, it's related to the way that agent executed the
- 1:01:49task. Allow me to illustrate.
- 1:01:51So again, going back to something like creating the
- 1:01:57report based on some business data, an agent looks at
- 1:02:02conversation says, you know what?
- 1:02:04I spend a lot of time trying to search for city which didn't
- 1:02:09exist because I didn't know that there are Unicode or that the
- 1:02:14city name could be encoded in the data storage differently.
- 1:02:19So next time when there is a task like that, I first need to
- 1:02:23understand what the spelling is, if it's correct or not, what
- 1:02:26encoding is and I need to verify that the city is known before I
- 1:02:30start, you know, pulling all informational source looking for
- 1:02:33something which is not there. It's almost like the agent is
- 1:02:37doing a retro on its own. Exactly.
- 1:02:39Execution. Exactly.
- 1:02:41Exactly. And this is also part of
- 1:02:46reflect. So when I was talking about
- 1:02:51cycle I was given an example with called code writing and
- 1:02:57then reflect was really within the loop.
- 1:03:00But you can also have reflect a bit outside of the loop if you
- 1:03:05will, or at the end of overall execution, just looking at
- 1:03:08everything that happened so far saying, OK, these are my
- 1:03:11learnings and I think that this is very important part.
- 1:03:15You remember at the beginning I said what agents are and one of
- 1:03:20the elements is memory and memory of in the way of
- 1:03:26learning. And this is a part of how you.
- 1:03:29Contribute to learn, reincorporating that learning
- 1:03:32into the next time that the agent does that.
- 1:03:35How do you have this retro? The retro where the agent now
- 1:03:38understands? I could have done it better in
- 1:03:41these ways. What are you doing to update its
- 1:03:46understanding so that it does do that?
- 1:03:48So essentially what you do is you put this information into
- 1:03:53context. So you essentially change
- 1:03:56instruction to your agent. So you've got a place saying,
- 1:04:00okay, so you've got this task. And by the way, and this is also
- 1:04:04where RAC comes into play. So you need to eventually you
- 1:04:08will not be able to put all memory in, whereas it's
- 1:04:11personalization memory or execution memory or whatever.
- 1:04:14You need to find elements pertaining to user and to task
- 1:04:18at hand which are relevant and you pull them from long term
- 1:04:22memory and you put it in the context and you say OK this is
- 1:04:26what you need to take into account.
- 1:04:28Because basically you're saying, hey, by the way, the last time
- 1:04:33you did this, you said that you should have done these things.
- 1:04:37Make sure to remember to do that.
- 1:04:39Yes, essentially not, not phrased exactly like that, more
- 1:04:43prescriptive say saying like a good practice in this case to do
- 1:04:47this, this and this. You verify for this, this and
- 1:04:50this. But yes.
- 1:04:51OK, fascinating. And you also look go through the
- 1:04:57memory. So it's not necessarily part of
- 1:05:03agent execution. It could be part of environment.
- 1:05:06It could be something outside where you say, OK, so you've got
- 1:05:09this learnings, learnings, learnings, but you need
- 1:05:11sometimes to compress them, to generalize them because you
- 1:05:14cannot have like 100,000 execution and then you've got
- 1:05:18100,000 learnings, 90% of them are the same, right?
- 1:05:22So you just need to be able to generalize and compress.
- 1:05:25Yeah. And so then it it's like this
- 1:05:29reflect part plays into another one of these ideas.
- 1:05:33Tell me how it's different from the internal critic.
- 1:05:37Is that the same thing or are they separate?
- 1:05:41It could, it could be again. So I was trying not to separate
- 1:05:46internal external reflect in a way.
- 1:05:49So if you think about agent rights and code reflect is in
- 1:05:57fact internal critic. So it looks at the execution, it
- 1:06:02says, OK, this is what this is what the test shows we didn't do
- 1:06:07well, right? It could be also look at
- 1:06:11something in other scenarios to look at document written and
- 1:06:14say, you know what the instruction of user was to
- 1:06:18summarize this document, but convey this emotion.
- 1:06:23Did we do it or not? And it says now this emotion is
- 1:06:27not really properly conveyed, so we need to do another step.
- 1:06:31So is this is in fact internal critic, but you can call it also
- 1:06:37reflect step. Yeah, but it's a reflect within
- 1:06:41execution. And then you've got another
- 1:06:43example which is reflect at the end of execution on outside and
- 1:06:48you can mix it obviously. Yeah, there's a diagram
- 1:06:51somewhere in there that maybe we'll have to create where it
- 1:06:54shows these loops that you're going through, especially with
- 1:06:57the way that you're thinking about it with, you know, the
- 1:07:01observe and then the thing and the other one was act and then
- 1:07:07reflect. And maybe reflect is at the
- 1:07:09beginning, maybe it's at the end, maybe it is at the
- 1:07:12beginning and the end and it's continuously reflecting after
- 1:07:16each step. It does sound like that can get
- 1:07:20expensive or. It does, it does.
- 1:07:22And and This is why. So in principle this reflect at
- 1:07:27the end, you can, you don't need to do it at the end.
- 1:07:30You can do it on every step as well.
- 1:07:32It's just extremely expensive, right?
- 1:07:34So many solutions that I've seen so far and many solutions that
- 1:07:39we've built are actually doing it at the end.
- 1:07:41And it's simply because it adds delays, it adds cost.
- 1:07:46But yeah, the more you can reflect, the better one.
- 1:07:50You just need to make sure that eventually you converge and not
- 1:07:53reflect, reflect, reflect. And again, better is worse of
- 1:07:56enemy of good. One thing that I wanted to say
- 1:08:00just based on your question, because you referred to what
- 1:08:04Paul says, learning from previous execution.
- 1:08:07So one of the things that you can do with the memory is
- 1:08:11actually optimise your execution path.
- 1:08:13So not only go for trivial things like the one I mentioned
- 1:08:17where you say OK to avoid this mistake like this is a good
- 1:08:21sequence of step or whatever, but to actually optimise
- 1:08:25execution path altogether. An example of this could be you
- 1:08:31spoke to Flores, right? So he at one point was working
- 1:08:34on an agent that uses web to browse websites.
- 1:08:41And essentially the way that we implemented it is if you got a
- 1:08:47task, your execution is to go website and start basically
- 1:08:52browsing it. So finding out what is
- 1:08:54clickable, what the fields are, that you can fill information
- 1:08:59and so on. And then you basically said, OK,
- 1:09:02so I need to click on the menu. I need to look for restaurant,
- 1:09:05for example, in food or ordering case.
- 1:09:09And then I need to click here to add to a basket and I need to
- 1:09:12clear. So all the steps.
- 1:09:15But of course, once it's done and it's successful, it looks at
- 1:09:19the whole execution and says, you know what, I actually don't
- 1:09:22need to wait. And at this step, I don't need
- 1:09:26to wait until the whole web page is loaded.
- 1:09:29I can just put a trigger saying, OK, once this element loaded, I
- 1:09:34can activate it and then I can do it next, next text.
- 1:09:39And suddenly instead of spending two minutes browsing, you can do
- 1:09:43it in under 40 seconds. Not wasting the resources of
- 1:09:46website, also not wasting the resources of yours.
- 1:09:49So we're moved from slow execution to fast execution.
- 1:09:53And then another thing that happened, it looks at this slow
- 1:09:56execution, say you know what, actually if we do this sequence
- 1:10:00of steps, we can predict what where we'll end up on this
- 1:10:05website. Because actually website is a
- 1:10:08limited amount of pages of use essentially.
- 1:10:12And this place where we end up has a specifically formed URL
- 1:10:19that I can form already at the beginning knowing where I need
- 1:10:23to go. And this is what we call reflex.
- 1:10:26So next time I've got a task, when again I'm going to say in
- 1:10:30order me usual, it says, OK, I just go there.
- 1:10:35And in parallel I'm also trying to do this fast.
- 1:10:39And in parallel I'm also trying to do this slow.
- 1:10:42If I'm good with reflex execution, I'm good.
- 1:10:47If not, I fall back on the fast. If files fail, I fall back on
- 1:10:52the slow. So slow.
- 1:10:53An example of this would be website changed, element
- 1:10:57changed, right? But this is also an example
- 1:11:01where reflect is very important. It's not critical in the sense
- 1:11:05that your application will not work without reflect, but it's
- 1:11:08very important in terms of optimization of performance and
- 1:11:14This is why, again, memory with in relation to execution is
- 1:11:17important. Yeah, there's so many things
- 1:11:20that I want to comment on there, especially because if you think
- 1:11:23about the way that that happens, if it gets done with reflex,
- 1:11:31then you'd how do you call off the rest of the actions?
- 1:11:37Like how do you call off slow and fast or?
- 1:11:40It's to be honest, this is this depends on application and it's
- 1:11:45just implementational detail. So the concept itself is
- 1:11:49actually not new. I saw it many years ago.
- 1:11:54I believe Siri was working on Apple this way.
- 1:12:00When you you remember the early version of Siri, you would say
- 1:12:03like call mom and it would call mom.
- 1:12:05Yeah. So what would happen?
- 1:12:07As opposed to now, it doesn't do that for some reason.
- 1:12:09It's been five years and it got worse.
- 1:12:12Yeah, model change errors don't. Yeah.
- 1:12:17But essentially if I understand what happened is it would take
- 1:12:22your voice and it would start processing it locally on the
- 1:12:25phone and at the same time it would send it to the server
- 1:12:29where you've got much more powerful processing.
- 1:12:33And then if the phone says OK, a process I actually understand
- 1:12:37what needs to be done, it just communicate back to the server
- 1:12:40saying OK, I don't need your support, stop.
- 1:12:44Yeah. And it's a bit of waste of
- 1:12:46resources, but it's significant optimization in terms of how
- 1:12:50quickly you can get result. And the accuracy of that result,
- 1:12:54yeah. Now Speaking of wasting
- 1:12:58resources or budgeting, I wanted to touch on the idea of how you
- 1:13:06think about budgeting every action.
- 1:13:07And I'll bring this up because I spoke with Zach probably 3-4
- 1:13:13months ago and he was putting together different agents and an
- 1:13:17agent builder at his company. And when folks build agents at
- 1:13:22his company in staging, they then have this little number
- 1:13:27that says if you are to push this to prod, we estimate it
- 1:13:31costing this much money because of the scale and the amount of
- 1:13:36LLM calls that we're going to be making and the resources needed.
- 1:13:40You were looking at budgeting in a different way with long
- 1:13:44running tasks and being able to say if you exceed a $2.00 budget
- 1:13:49then just stop because I don't want this all of a sudden to get
- 1:13:54racked up to a $10,000 open AI bill.
- 1:13:57Yeah, yeah. So I think budgeting is
- 1:14:03extremely complex question to be honest, because one thing is to
- 1:14:11say you know what, we just want to keep limit the cost of
- 1:14:15execution. And I think it's it's not
- 1:14:21particularly difficult. You can estimate cost of
- 1:14:24execution again, as you just said based on number for lamp
- 1:14:28calls or maybe some other things that it does.
- 1:14:30We actually did it again, going back to one of the things with a
- 1:14:35food ordering agent, we actually can very precisely say, OK, so
- 1:14:41it did this food ordering, it looks for options, it reached
- 1:14:45out to restaurant, It looks whether it's easier to deliver,
- 1:14:50order it via platform or via restaurant directly.
- 1:14:54And it selected the best option cost wise.
- 1:14:57And this is the order that was made for this amount.
- 1:15:02And from there we can also say, OK, but it runs so many calls,
- 1:15:06we know on average what infrastructure costs.
- 1:15:09So we say, OK, it's actually saved user like $8 and it cost
- 1:15:151.5 to run. So and you can put a very easy
- 1:15:21caps. And you know what, on average we
- 1:15:24are bringing this value for user.
- 1:15:27So if you exceeding this value, please stop.
- 1:15:30It's, it's a business discussion.
- 1:15:32It's not technical discussion. This is one thing where
- 1:15:36budgeting becomes extremely difficult in my opinion is when
- 1:15:40it becomes a part of trade off discussion and unfortunately
- 1:15:44this is where I do not see a lot of interesting solution and
- 1:15:51please tell me if I just miss it.
- 1:15:53So if you remember, agents have tools and if you look at most of
- 1:16:01the cases now in the market, these tools are not overlapping.
- 1:16:07So you cannot replace one tool with another.
- 1:16:12What happened? If you can, very simple example,
- 1:16:16you can have three image generations, each takes
- 1:16:20different execution time, each slightly difference in the
- 1:16:25quality of delivered results and each cost very different.
- 1:16:30Did you actually see a good solution that is able to
- 1:16:35navigate this trade off? Now what is a task at hand?
- 1:16:40Which tool is the best option in terms of speeds of answering
- 1:16:46quality, of answering the cost? So this is where I think
- 1:16:50budgeting will be extremely important moving forward because
- 1:16:53we built again, we built agents with more and more tools.
- 1:16:58And internally I've already see a couple of use cases where
- 1:17:01we've got like 2 tools doing more or less the same.
- 1:17:05So how do you let tool choose? How do you communicate what is
- 1:17:10important? What if the importance changes
- 1:17:13of execution of of of your task at one point, you know, again go
- 1:17:20into human example, how do you explain to the agent to an
- 1:17:24agent? Sorry the concept that it's
- 1:17:28better to have an answer now than a good answer later.
- 1:17:32Tomorrow or next week? Exactly.
- 1:17:35So this is where I think budgeting will be important.
- 1:17:39And this is yeah, where I still see a lot of opportunities for
- 1:17:44development. It's almost like you want an
- 1:17:46urgency knob that you can dial and you can say I'm cool with
- 1:17:49this one going as long as you want, or I need this as soon as
- 1:17:53possible, or somewhere in between.
- 1:17:55Yeah, so if it cost me less, it takes me a week and it's not
- 1:17:59critical task, Fine if I need an answer now, how urgent is my now
- 1:18:06you see how it's very difficult. Also if you think about human,
- 1:18:12you work in a team, how easy it is to convey and also understand
- 1:18:19the sense of urgency. And people say, oh, I pay
- 1:18:23whatever if it's done. But then whatever is whatever is
- 1:18:28if it's done. And then you realize, well, it's
- 1:18:30actually not whatever. And it's not really done.
- 1:18:34Yeah, and whatever is different for different people and
- 1:18:37definition of done exactly. It also reminds me of the paper
- 1:18:42that I read back in the day called Frugal ML.
- 1:18:45And there were a few different ways that they were exploring
- 1:18:49how to bring down the LLM cost. And some of that was by throwing
- 1:18:55in two questions in a context window to similar questions and
- 1:18:59getting the output. And then another one was being
- 1:19:04able to have a dynamic router. And so if the question was
- 1:19:08simple, it would go to a simple open source model that was a
- 1:19:11smaller one, hosted, self hosted.
- 1:19:13If the question was more complex, it would kick it off to
- 1:19:17back in those days, it wasn't a reasoning model, but it was
- 1:19:19something of the sort, the bigger model.
- 1:19:21Now what you're saying though is imagine if tools had that same
- 1:19:27kind of router or it just was a capability that an agent could
- 1:19:32understand. These are my options and
- 1:19:37considering I need X amount of urgency versus Y amount of
- 1:19:41budget, I'm going to choose this tool.
- 1:19:43Yeah, exactly. It's exactly that.
- 1:19:46And I'm really eager to see a solution there that actually
- 1:19:51address it. But yeah, we're still in the
- 1:19:54face when we've got just a handful of tools.
- 1:19:57And again, as you you, you don't really have this options where
- 1:20:02you can trade 1 characteristics for another.
- 1:20:06That's all we've got for today, but the good news is there are
- 1:20:0910 other episodes in this series that I'm doing with Process deep
- 1:20:13diving into how they are approaching building AI
- 1:20:19products. You can check it out in the show
- 1:20:22notes. I leave a link.