DAPPCON 2024: Building The Autonomous AI Agent Economy - Evan Griffiths
DappCon 2024 · May 2024 · 24:32
Evan Griffiths speaks at DappCon 2024 under the title Building The Autonomous AI Agent Economy. An AI agent in this context is software capable of taking actions, including on-chain transactions, without step-by-step human direction. The talk's title frames a broader economy forming around that kind of autonomous, agent-driven activity.
Speakers
Topics
From DappCon 2024, hosted by Dappcon Berlin.
Transcript
hey guys so I'm Evan I'm an llm engineer at nosis and this is presentation on building the autonomous AI agent economy on nosis chain so uh yeah nosis towards the end of last year started the AI effort was a team of llm Engineers and with the remit of that being to build proval concept use cases for the agent economy on nois chain so agents being users of decentralized applications competing for finite resources and then the kind of emergent um result of that being what we call the agent economy and the kind of
goal of this apart from being kind of a research effort um is to uh on board more users to nois chain where users are agents with the strong belief being that agents can be a large proportion of the user base of noce chain going forward so just for some context um where does this sit in the kind of AI web3 intersection so you've got kind of two a division between these two things as far as I see it um first being an augmentation of the traditional AI stack with web 3 Technologies so things like zkl decentralized compute and then on the other side of the coin um you add adding AI to web three applications and
that can be to help humans interact with blockchain by using uh natural language instead of calling smart contracts or having AI as a player in the game in itself and this area is the kind of thing that we're focusing on uh in the team and that's what we're going to be talking about here next slide uh so yeah first question where will autonomous agents transacting on chain um don't know about you guys in my Twitter in boox I'm getting daily messages about all these easy ways you can make money on chain so as a as a high level uh agents we making uh acting wherever they can make money um lots of opportunities I'm sure uh but
generally there are kind of two areas where we see um them being particularly well suited and these are where um having general intelligence beats out the uh kind of use cases where you can um uh achieve the same kind of goal by ruthless scripting techniques and the second is where um the human uh general intelligence intelligence isn't being applied uh because the incentives aren't there for humans because they have finite time uh agents don't kind of have those same kind of constraints so with those kind of things in mind the first um proof of concept uh the first use
case that we took was uh prediction Market you if you were here for David to talk you'll see some overlap between these presentations but here we have kind of more of a engineered practical uh guide so um prediction markets for those of you who don't know there's an example of a prediction Market there on the screen um AI the URL for for this platform is there AI omen uh where any user can go and po post a question uh a question about a future event and so there's an example one here with the yes or no outcome and then other users of this prediction Market can purchase uh tokens in in the outcomes and placing a bet essentially
um the market Creator provides liquidity to incentivize this because they want to there's value to them in knowing the answer of that question and users will want to um bet because if if they do a good job of it then they have an incentive because their tokens um end up having some value the people who fail uh their tokens become worth nothing so this the net effect of this is kind of incentivization structure for the truth seeking um so this was the use case we chose uh let's go through some uh additional so this use case satisfies the constraint rints we saw on the earlier slide but if you think about
what you need to be a good participant in prediction markets this is another a set of things here which again mean that uh agents are very well suited to this task so modern llms have very broad but also deep um knowledge base they're good at uh if you want to make a prediction on some future event you need to have access to realtime information llms can uh do this research and we equipped the right tools uh do this research and then are good at kind of aggregating this unstructured data to make a prediction and then that final Point uh we addressed already the
uh lots of times in prediction markets humans don't have a sufficient incentive because the liquidity might not be very large but agents uh don't have such a strong preference on that and they can work for cheaper Okay cool so we picked our use case let's build our agent to act in this economy so what do we mean by an agent uh if you're uh familiar with the the old kind of term of agent this was something where uh used in reinforcement learning where you have some parameterized model acting in some environment it would receive some reward as a feedback which
would use to update its uh parameters accordingly this is kind of not not what we mean really when we talk about agents these days we're talking about some system built on top of llms um and you have uh these kind of P lots of python libraries a plethora of python libraries that you can use these days to build these kind of systems with which have which build on top of llms with some additional features so let's go over these features so llm is the kind of core component of an agent um and that's used for the kind of general intelligence aspect but then additionally if it's going to be agentic
it needs to have tools that allow it to act in the real world so for our prediction Market it's going to be doing some offchain actions like web search and scrape and then doing some onchain actions so this is our decentralized application which is interacting with via with three Library functions um next it's got some memory component so our agent is stateful it's going to be acting over a long period of time it's going to remember I didn't do so well when I bet on this Market three weeks ago maybe I should consider uh how I research this topic in the future and additionally memory for overcoming context limitations of
llms and finally for control logic um so you start with some kind of overall goal I want to make money in this prediction Market um breaking that down into sub goals managing the progress through a kind of run of the agent and that's kind of what we call control control logic okay um so let's illustrate this with a simple example so um here's just a snippet from uh uh from Lang chain where we just in our llm uh with the question will it rain in Berlin tomorrow uh if you do this you run this you'll get some response uh I'm sorry as an AI I don't have real time
data access so this is no use for our uh prediction Market use case it doesn't have any agency so let's add some agency so another snippet where we're using the Lang chain agent library now and you'll see we're initializing an agent and we're passing in some arguments which look just like those features that we identified on the earlier slide so we're adding a Search tool which allows it to go and script the web and we're adding some control logic to say kind of have this back and forth conversation like you do with chat GPT except both sides of the conversation are managed by the agent so now when you run it you get much more useful information it goes and
recognizes it can't access it doesn't know this in the answer so it goes and searches the web and then you get an answer there is a significant chance of raining Bing tomorrow um all right so sorry to be the rare of bad news bring an umbrella don't say I didn't tell you so okay um right so we've got our agent uh the the rough components we want to give it and now there's a kind of big design consideration um as Engineers that we need to consider when building this agent which is how much autonomy we want to to give it and this is a spectrum it's not um so it's a yeah a design decision for the
engineer um so take this top example this code snippet you've got a kind of set of functions which you need to be able to run to be a participant in the uh prediction market so you're picking a market you're doing some research you're making the prediction um these things can each involve calls to the language model but in this top example this kind of uh execution uh logic is is hardcoded um there there's limited autonomy in this case then you can look at the second example uh where you're now giving these functions um as tools to the agent and you're giving it you're handing over the
decision of how to call them what order how frequently to the model um and then you can even imagine another case where in instead of hardcoding these tools and kind of statically giving this list to the the model um you kind of give it the ability to search a Marketplace of tools um and so this kind of in adds a new degree of freedom to the agent but with this kind of extra autonomy that the a agent now has there are trade-offs and the main one being main two being reliability and price because um the more the kind of agent has to think in the sense of generating
tokens and reflecting on its choices uh the more more expensive that is and then the more chance there is the agent will go off course do some make some mistakes and so on so that's something to consider um but we' we we'll pick some point on that Spectrum uh We've now built our agent and now the next kind of consideration that I want to talk talk about is observability and metrics so this is a new kind of consideration when uh for building agents that we didn't have to really think about building other applications um because there's now this
kind of fuzzy world of when you have a a program previously it kind of either works or it doesn't and now there's a bit more kind of yeah fuzziness in the ability to evaluate the model where it's more of a question of like how how well does it work um and there's like your kind of degree of uncertainty or like degree of non-determinism that's been spoken about before um so we kind of look for uh lower level metrics that we can um evaluate our model on and produce kind of benchmarks to before we deploy our our agent to kind of see how it's doing so in the uh prediction Market use case specifically the kind of metrics that we're interested in uh how good is our prediction
relative to the correct answer or how good um and that kind of that's kind of measured after the fact like after the you know that once the markets closed uh but maybe a proxy that we can use to kind of uh make benchmarking easier a prior is to compare our agents prediction with some uh crowd prediction on existing popular prediction markets like manifold or poly rrap um some other considerations more General uh observability and metrics considerations this is the kind of final thing I'd like to talk about
is um logging and debugging of the agent as I said this this kind of fuzziness for deployed agents where the where the kind of output is natural language as opposed to like uh easy to pinpoint right or wrong results and a great way to handle that is to use some kind of um dashboard there are these libraries which kind of uh really help with that by just adding a call back to your open AI API call and then you kind of get nice execution traces of your uh of your agent where you can see kind of which tools it called how frequently um the kind of uh length of each step and
the the number of tokens required um and that's great for yeah debugging and optimization um then as because our agent is we're kind of uh sending it away with some resources in terms of a a crypto wallet and we're expecting it to do some work for us uh there's a cost associated with it in terms of tokens and perhaps other API calls um and then the key metric is really is it kind of self- sustaining in the sense that the profit that it's generating is sum of those two costs plus some extra um and then the final thing is also
another kind of fuzzy concept but if we've set our agent up with sufficient or degree of autonomy then it has the capacity to learn over time and that's by managing its context window to uh kind of prompt itself in better ways to produce better outcomes and also to select uh better tools a way that again produce better outcomes and so that's another thing that you can look for in no agent okay great that's pretty much everything I wanted to talk about um lastly where to find us so we have some uh we have a June dashboard for all of our deployed agents that are working
on the um prediction markets use case full of lots of dense information you can check it out there um we have a couple streamlet apps associated with our code bases which are all open that are kind of fun to play around with uh and to kind of test out uh how our agent runs through a kind of prediction and the kind of uh function calling aspect and uh kind of play yeah playing around with with kind of agents that are currently deployed and we have a couple GitHub repos which again are all open which feel free to take a look at and build your own prediction Market agent if you'd like from our tooling repo
we've got some examples as well okay I think that's everything from me thank you very much um I've been told that John has been pulled off for uh some other engagements so I'm going to manage the Q&A so I guess any questions please hands up I've got a question question over here thank you um I want to ask about the alignment of this agents with uh humans goal like let's say you start off this agents with a $10 and let's say the agent becomes a millionaire you know and they just keep making money uh and what
is the benefit for Humanity of is that goal align is it like making the predictions more efficient to help Humanity to gain benefit from it or what what other sense other than consuming energy can it have yeah sure so uh I guess the uh the agent is kind of given some is deployed by some owner so it doesn't kind of appear thin air someone's going to deploy the agent on on their cloud or something like that uh or in some kind of decentralized manner and uh they're going to fund that agent with uh some crypto and the agent is kind of being put to
work on behalf of that owner um so it's aligned in the sense that the the creator of the agent is giving it some uh goal to kind of set it going um the yeah kind of as I was talking about in the presentation uh with the kind of sufficient uh autonomy then I guess there's an element of to what extent does it uh stay Within These kind of guard rails set by the creator of the agent uh but yeah in terms of benefit to humanity well it benefits the owner if it um is a sustainable uh entity um not essentially costing the the deplo the deployment isn't kind
of having a net loss um if that answers your question throw throw send it up and throw the key I mean uh uh yeah I suppose the uh kind of yeah key management is a kind of separate topic but in this example we're uh deploying the agents with a key and monitoring the Performance Based on that key so thanks hi hey um I think we are always considering that this future with a lot of agents are going to be the end game and then everyone will will have an agent then everything will be you know
based on on agents actions um but I I'm also considering that they might fail um maybe uh a few times and uh I'm just thinking like what are the possible risks on that and what could make an agent um fail sure uh I guess I can speak from personal experience of of our work that we've done so far in the team uh yes they uh at the moment aren't very good and therefore in their current form aren't anything to be scared about they're something that to be developed to the point where they're useful um so I guess for the time being uh it's hard to say how long for
uh failure is kind of inevitable and there's uh I guess anyone who's developing an agent project is like just eating the cost of open AI credits or whichever prior they're using uh in the hope that it becomes at least an order of magnitude like cheaper to run their agent uh and that the agent's capabilities improve a lot more to the point where they're being useful like they're actually kind of making money or writing good code you know doing good PRS uh that kind of thing cool thanks hi so I think you answered the question because I wanted to ask if it works and does it produce profit but
maybe so how what's your expectations when it's going to to be working better than humans yeah sure so um yeah to uh to answer that question I guess our deployed agents are currently um profiting in the sense that they're uh like just taking the prediction Market scenario of placing a bet getting some returns on it and making more correct bets than incorrect bets so they're kind of doing the forecasting okay but then considering the cost of the kind of uh llm cools and um the kind of additional apis that they're having to kind of pay for to be
able to operate uh like there's significant net loss um and I think it's yeah going to be kind of a gradual uh improvement with like small step changes when uh new new models are released so I guess everyone who's running an agent depending on gp4 is going to wait for GPT 5 and then switch the flag in the the agent and then then there's a kind of moment of to what extent do that alone kind of yeah sure I mean so this this prediction Market use case is kind of constrained uh or slightly artificial in the sense that uh like there's not a organic user base kind of creating the
markets and uh and like other users placing bets so there's a kind of artificial environment that a lot of the like the market creation is being managed by agents the market resolution is being managed by agents so uh we're not we're not doing this as a kind of like side project to make to profit from prediction markets it's like a pro of concept uh kind of a research application that sense right okay let's we'll double the bets and we'll and we'll retire from our day jobs yeah okay thanks another question uh great talk um actually uh
have you thought about the paperclip problem for pushing this to the Limit like the agent predict the market at some point the agent will try to decide Market yeah sure so um in the in the prediction Market case uh the the the kind of in incentives are set up so that uh if you if I get your question correctly if the the agents are kind of placing like non-true seeking bets to try and influence the result of the market so that the market so it says ah yes Trump is 100% going to win the next election then people go oh wow and that's going to influence other people's behavior that kind of malicious intent
even more than that for example um let's say Uh something's going to happen and it's going to do some terrorist attack or some crazy thing that like changes right the outcome yeah sure so um I suppose in this example your agent has been built such that it has uh capabilities of prediction of participating in prediction markets and capabilities in uh Warfare um and I guess it's maybe up up to this let me do an example like Co yeah sure I mean the market if you knew that the market was if if you knew that covid was happening you could have Ted the market and the
outcome from that could be higher uh the incentive could be to actually do that yeah I wonder if an agent could do something like that push into the paper clip yeah right extreme um I guess that's like a consideration maybe beyond the scope beyond the scope of this presentation in terms of like uh yeah Power being gained by super intelligent AI uh for the moment luckily we haven't got that problem so uh thank you very much