Okay, in this video we’re gonna be looking at a form of autonomous AI or an autonomous
AI agent. And this is actually from a paper that was released online called Task-Driven
Autonomous Agent using,GPT-4, Pinecone, LangChain for diverse applications. it was actually
announced on Twitter.
I saw this,last week, by Johei Nakajima. and he had a nice sort of, tweet post announcing
it and if we go through it, we can see that, okay. The idea here is that we are using a
large language model to generate ideas, do some sort of critique on those ideas
and thenideally execute tools So this has elements of throwbacks to Toolformer, some
of the other key papers around this, that have been here. one of these things shows,
it’s got some nice diagrams in here, showing like how this works and some of the key points
So the user basically provides an objective and a task and then once that is set into
a task queue, [00:01:00] the large language model basically decides how to execute that,
and then as it, develops stuff, it saves it to a memory. and that memory then can be accessed
through different things. it then, goes back a, around these loops.
it’s got a prioritization agent to decide what. Task comes next and what you know is
priority, et cetera. And it basically goes, through this, over time. So if we look in
here, there, there’s, they’ve got another diagram in here, just going through it as
well, of basically you’ve got this task queue.
we’ve got the execution agent. And each of these things,for these parts is actually just
the same language. you’re just using different prompts. You’re using different ways to, manipulate
the output. And then you’ve got the memory, which in this case they’re using Pinecone,
which is a vector store database, so that they can store things in there and that you
can basically do lookups on them and stuff like that as well.
So the. The idea here I think is really good. the paper talks a lot about using, GPT-4 Pine
Cone [00:02:00] and the LangChain Framework,to basically do this. along with this, he also
released, some, code. So the code, has got the nickname, baby AGI. I don’t think this
is approaching AGI in any way, but it’s cute name.
And you know what, this is supposedly a very paired down version of the original one. So
we don’t actually know how good the original one was. As far as I understand, we hasn’t
been released or we haven’t, got, videos of trying it and stuff like that. looking at
the baby g i, that’s here.
this is de this code has definitely been released. We can play around with it. In fact, I’ve
set. A CoLab so that you can also have a play with it. And so we can just have a look at,
how it works, some of the ideas behind it, and what you could do with an agent like this,
in the future. So you need quite a number of API keys to get this going.
you’ll need an opening AI key. of course you can basically set it up to use either GPT-4,
or in this case I’m using GPT 3.5 turbo. [00:03:00] It’s nice enough to have a print statement
that does say if you’re using GPT-4, that, you know, this could get expensive. we also
need Pinecone API key and you need to set up the Pinecone environment.
So this will change based on your, where you’re setting it up. I just left this in so that
you could get an idea of what you should be putting in there. Cause I think it’s not always
totally clear. you need to put in a table name. you can’t use underscores or anything
in this table name, here.
And then you need to set up an objective and initial task. So here I’ve basically said,
okay, plan a romantic dinner for my wife this Friday night in Central Singapore. and the
initial task is make a list of the tasks, and you’ll see That while this particular,
one is not set up with any tools or anything, it does a nice job at going through, the thinking
processes that it would need to do.
Now in here it does seem like they’re planning on adding tools. to, to this, looking at the,
at the code base there are, tools being added. it’s also interesting that looks like they’re
planning to add, or they’ve added,the [00:04:00] llama, I’m guessing this is the four bit version
of llama that runs locally, to do this thing.
So that, that would be interesting to. See how well that does. if we go through, we can
look and see, okay, after it’s got a lot of setup code, for doing this and for Pinecone
setup code,the main logic behind these things, is not, overly complex. So we can see that
we’ve got the task creation agent.
So this is basically got its own prompt here and we’ve just got nice sring basically substituting,
doing kind of what LangChain does, with its prompts. and it’s then able to, basically
call that it’s got a prioritization, agent again, same concept, but with a different
prompt. So you are using a different prompt to do the same thing.
reprioritizing the following tasks. And the tasks in tasks. Consider the ultimate objective
of your team passes in that as well. So this is very similar to some of the agents that
we see in LangChain and that we’ve,looked at as well.[00:05:00]
We’ve then got at the execution agent, again, same concept, different prompt. You are an
AI who performs one task based on the following objective. Take into account these previously
completed tasks, passing into context, your task, and then the response. so it’s interesting
here that they’re setting the temperature quite high, for.
whereas normally in Chen you would actually set the temperature pretty low, like close
to zero or zero, for this kind of thing. so that may have also of affected its output,
for doing this. alright, so then you basically just go,you’ve just got this huge leap. It
goes through it.
Does it, let’s look at some of the output that we are getting from. So first off, make
a list of tasks. so you can see that it does a pretty nice job of choose a romantic restaurant
in central Singapore. Make a reservation for two at the chosen restaurant. select a bouquet
of flowers to surprise your wife with.
This is definitely not something I asked for, but okay. Maybe it’s something that it, decided.
you could imagine in the [00:06:00] future though, you would want the agent to actually
come back to you with suggestions and then you would say yes or no to these suggestions.
choose a romantic gift for your wife.
purchased a selected gift from the store in central Singapore. it’s really going all out
on this dinner. And then, finally confirm the dinner, et cetera. Okay. So, research
and choose a romantic activity to compliment the dinner experience. if anything, I would
say that the agent is very verbose.
and again, this would all be down to the manipulation of the prompt, that you would want for something
like this. And you could imagine that this prompt might be really good for one task,
but not great for another task. All right. It goes through, it comes up with su suggesting
a private Sunset yacht cruise, along the Marina Bay.
Now, this, it is, it’s very good in that it’s getting,locations, right? And it’s getting
things like that. Again, this is to be expected, because we’re using, one of the large, open
AI models, for doing this. it’s [00:07:00] quite funny how it’s, choose a romantic outfit,
hire, rent a luxury car,a lot of things that it, it’s making suggestions, but they may
not be, Ideal sort of suggestions for, a romantic date in Singapore.
one of the things I did find out was interesting was, and it’s funny how it goes on to say,
please note that you may need to provide a valid driver’s license and stuff like that.
I, you could imagine in the future that these things will have a variety of information
on you. And then be able to use that, like if it’s got a knowledge base on you of your
driver’s license, your credit card number, all those sorts of things.
I certainly wouldn’t give this one my credit card number cuz it seems to want to spend
a lot of money. so you can see here it’s picked out, a jewelry store. It actually picks out,
three real jewelry stores and it get, seems to get their location correct. Uh, pretty
impressive. it then also picks out a nice, restaurant.
and it’s interesting that, the restaurant that it picks is a luxury restaurant. I think
it’s a Michelin, I’m pretty sure it’s a three star Michelin restaurant, in Singapore. and
[00:08:00] so again, this is all coming from the open AI model. there, there’s nothing,
unique about this that’s coming from Baby agi.
It’s just nice manipulation of the open AI APIs, in this, it goes on and on. It takes,
a bit of time to run, through these. in the end I just of stopped it. cuz it certainly,
can ping the API quite a bit and get a lot of things back. it is interesting to, you
know, I tried another one.
Planning a party. And that also, did the basic stuff quite well. what we are lacking here,
is the ability for it to come back to you and to know what it should come back to you
about. and this is gonna be one of the key things, I think for a lot of these things
going forward. it claims that it’s contacted the restaurant and it’s made,a booking.
It’s very strange that, about their policy on bringing outside candles. Again, this is
I would say, dying in the details, o of this kind of thing. Anyway, it’s here. You can
have a play with it yourself. I ended up stopping it, just cuz it seemed to be going on and
on. [00:09:00] Alright.
the ability to run a variety of different tasks and are incorporated with a variety
of different tools. That’s what we’re gonna see a lot of in the future. we’re gonna see
this with the, chatGPT plugins or the open AI plugins format that’s coming along.
We’re already seeing this with some of the things in LangChain, so this sort of just.
Is a nice way of wrapping up some of these ideas and giving you some idea of how they
could be in the future. As always, if you’ve got, any questions, put them in the comments
if you found this useful, please click, like can subscribe. I will see you in the next