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
into it.
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.

このビデオでは、自律型AIまたは自律型AIエージェントの一形態について見ていきます。
AIエージェントを紹介します。これはオンラインで発表された「Task-Driven Autonomous Agent using, GPT-4, Pinecone, LangChain for diverse applications」という論文からのものです。
GPT-4、Pinecone、LangChainを使った自律型エージェントを多様なアプリケーションに応用する。
Twitterで発表されました。
私は先週、中島丈平が発表したのを見ました。
それを見ていくと、なるほどと思うことがあります。このアイデアは、私たちが大規模な言語モデルを使用してアイデアを生成しているということです。
大規模な言語モデルを使ってアイデアを生み出し、そのアイデアに対して批評を行い、最終的にツールを実行する。
そして、最終的にはツールを実行する。
この論文に関連する他の重要な論文もここにあります、
そのうちのひとつが、「Toolformer」を彷彿とさせる要素を持っています。
この中に、この仕組みと重要なポイントが示されています。
つまり、ユーザーは基本的に目的とタスクを提供し、それがタスクキューにセットされると、[00:00:00] [00:00:00
それがタスクキューにセットされると、大規模言語モデルがその実行方法を決定します、
そして、開発したものをメモリに保存し、そのメモリは様々なものからアクセスできるようになります。
そして、そのメモリは、さまざまなものを通してアクセスすることができます。それから、これらのループを遡ります。
優先順位付けエージェントがあり、次のタスクを決定します。タスクが次に来るか、何が優先されるかを決める優先順位付けを行います。
優先順位を決定します。そして、基本的には、このようなループを経て、時間が経過していきます。だから、ここを見ると
ここに、別の図があります。
基本的には、このタスク・キューがあり、実行エージェントがあります。
そして、実行エージェントがあります。これらの部品は、実は同じ言語を使っているのです。
プロンプトの使い方が違うだけで、同じ言語を使っています。出力を操作する方法が違うだけです。
出力を操作する方法が違うだけです。そして、メモリですが、今回はPineconeを使用しています、
これはベクトルストア・データベースです。
基本的にルックアップなども可能です。
つまり、「Pinecone」です。論文ではGPT-4 Pine Coneの使用について多く語られています。
Cone [00:02:00] とLangChainフレームワークを使って、基本的にこれを実現する。
いくつかのコードを公開した。そのコードは、「ベイビーAGI」というニックネームがついています。私は、これがAGIに近づいているとは思っていません。
AGIに近づいているわけではありませんが、かわいい名前です。
そして、このコードは、オリジナルのものをかなり縮小したものだと思われます。ですから
オリジナルのものがどれほどのものだったかは、実はわからないんです。私の知る限りでは、まだ発売されていません。
私の知る限りでは、発売されていないし、試用したビデオなどもない。
ベビーG I、これがそうです。
このコードは間違いなくリリースされています。私たちはこれで遊ぶことができます。実際、私は
セットしています。CoLabを設置しましたので、みなさんにも遊んでいただくことができます。それで、私たちはただ見てみることができます、
このようなエージェントを使って何ができるのか、その背後にあるアイデアや、将来的に何ができるのか、
将来的には、このようなエージェントで何ができるかを考えてみましょう。これを動かすには、かなりの数のAPIキーが必要です。
もちろん、基本的にはGPT-4を使うように設定することができます、
この場合はGPT3.5ターボを使用しています。[00:03:00]プリント文があるのはいいことです。
GPT-4を使用している場合、これは高価になる可能性があることを言うプリントステートメントを持つことは十分に良いです。
PineconeのAPIキーが必要で、Pineconeの環境を構築する必要があります。
これは、設定する場所によって変わってきます。ただ、これを入れておくことで
何を入れたらいいのかがわかるようにしました。というのも、何を入れたらいいのかが、必ずしも
テーブル名を入れる必要があります。
このテーブル名には、アンダースコアも何も使ってはいけません。
そして、目的と最初のタスクを設定する必要があります。つまり、ここでは基本的にこう言っています、
今週の金曜日の夜、セントラル・シンガポールで妻のためにロマンチックなディナーを計画する。
最初のタスクは、タスクのリストを作成することです、
ツールや何かで設定されているわけではありませんが、必要な思考プロセスを経て
必要な思考プロセスを見事にクリアしています。
この中には、ツールを追加する予定があるようです、
コードベースを見てみると、ツールが追加されているようです。
を追加する予定なのか、あるいは追加しているのか、興味深いです。
ローカルで動作するllamaの4ビット版だと思います。
だから、それは興味深いことです。どの程度うまくいくか、見てみましょう。
多くのセットアップコードがあり、これを実行するための、そしてPineconeのためのセットアップコードもあります。
セットアップコード、これらの背後にある主要なロジックは、過度に複雑ではありません。そこで、次のことがわかります。
タスク作成エージェントがあります。
これは基本的に独自のプロンプトを持ち、sringが基本的に代用しています、
LangChainのプロンプトと同じようなことをやっています。
優先順位をつけるということですが、これも同じコンセプトで、プロンプトを変えています。
プロンプトが違います。つまり、同じことをするのに違うプロンプトを使っているのです。
you can see here you’re a task prioritization, AI tasked with cleaning, the formatting and
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 idea, I think is the key thing here. the idea of developing these, agents that have
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
below.
if you found this useful, please click, like can subscribe. I will see you in the next
ここでは、タスクの優先順位付け、AIによるクリーニング、フォーマット、次のタスクの再優先順位付けが行われていることがわかります。
次のタスクの再優先化を行います。そして、タスクの中のタスク。最終的な目的も考慮する
あなたのチームの最終的な目的も考慮に入れてください。つまり、これは、いくつかのエージェントに非常に似ています。
LangChainに見られるエージェントとよく似ています。
また、同じコンセプトで、異なるプロンプトが表示されます。あなたは、実行エージェントです。
次の目的に基づいて1つのタスクを実行するAIです。以前に完了したタスクを考慮し
完了したタスク、コンテキストを渡す、あなたのタスク、そして応答です。
ここで興味深いのは、温度をかなり高めに設定していることです。
通常、チェンでは温度をかなり低く設定します。
だから、それが出力に影響したのかもしれません、
そうすると、基本的には、このように大きく飛躍することになりますね。それは
それを通り抜けていく。
では、その出力を見てみましょう。まず最初に、タスクのリストを作成します。
シンガポール中心部のロマンチックなレストランを選ぶという、なかなかいい仕事をしているのがわかると思います。
シンガポール中心部のロマンチックなレストランを選ぶ。選んだレストランに2人分の予約を入れる。
奥さんを驚かせるための花束を選ぶ。
これは間違いなく私が頼んだものではありませんが、まあいいでしょう。でも、まあいいか。
しかし、将来的には、エージェントが実際にあなたに提案をしてくれることを望むでしょう。
そして、その提案に対してイエスかノーを言うのです。
妻へのロマンチックなプレゼントを選ぶ。
シンガポールの中心部にあるお店で選んだプレゼントを購入しました。
このディナーのために。そして、最後にディナーの確認をする、エトセトラ。なるほど、では、リサーチ
ディナーにふさわしいロマンチックなアクティビティーをリサーチして選んでください。
“エージェントは冗長だ
そして、これはすべて、あなたが望むようなプロンプトの操作によるものでしょう。
このようなものです。このプロンプトは、あるタスクには最適だが、別のタスクには適していないということも想像できる、
別のタスクには向かないということも考えられます。なるほど。このプロンプトは、次のような提案をしています。
マリーナベイ沿いのプライベートなサンセットヨットクルーズを提案します。
これは、場所を特定している点で、非常に優れていますね。そして
というようなことです。これは予想されたことですが、私たちが使っているのは、大規模なオープンAIモデルですから。
ロマンティックな服を選び、高級車を借り、高級レストランを予約する、
ロマンティックな服を選んだり、高級車を借りたり、多くのことを提案してくれますが、それは理想的な提案ではないかもしれません。
シンガポールでロマンチックなデートをするための理想的な提案ではないかもしれません。
その中で、面白かったのは、こう書いてあることです、
有効な運転免許証の提示が必要な場合がありますので、ご注意ください。
将来的には、このようなものからさまざまな情報を得ることができるようになるのでしょう。
を持つようになる。例えば、運転免許証やクレジットカードの知識ベースがあれば、それを利用することができます。
運転免許証やクレジットカードの番号など、いろいろな情報を得ることができます。
確かに、私のクレジットカード番号は渡さないでしょう、大金を使いたいようですから。
このように、宝石店を選んでいるのがわかります。実際に選んでいるんです、
3つの本物の宝石店を選び出し、その場所を正確に把握しているようです。かなり印象的です。
それから、素敵なレストランも選んでいます。
面白いのは、その選んだレストランが高級レストランであることです。確か
シンガポールのミシュラン三ツ星レストランだと思います。
[00:08:00]繰り返しますが、これはすべてオープンAIモデルから生まれたもので、何もありません、
ベイビー・アジから来たもので、ユニークなものはありません。
オープンAIのAPIをうまく操作しているだけで、どんどん進んでいきます。時間がかかる、
最終的に私はそれを止めた、
APIにかなりpingを打って、いろいろなことを返してもらうことができる。
もう1つ、試してみました。
パーティーを企画する。これもまた、基本的なことはよくできました、
ここに欠けているのは、あなたに戻ってくる機能と、あなたに戻ってくるべき内容を知る機能です。
そして、これが今後の多くのものにとって、重要なことの1つになると思います。
レストランに連絡し、予約を入れたと主張しています。
外からキャンドルを持ち込むことについてのポリシーについては、とても奇妙なことです。これもまた
この手のものは、細部にまでこだわるといいますか。とにかく、ここにあります。あなたは
自分で遊んでみてください。私は結局、延々と続いているように見えたので止めました。
を止めました。[00:09:00]わかりました。このアイデアは、ここで重要なことだと思います。
様々なタスクを実行する能力を持ち、様々なツールと組み合わされるエージェントを開発することです。
さまざまなツールに組み込むことができます。将来的には、このようなものがたくさん出てくるでしょう。
チャットGPTプラグインやオープンAIプラグインフォーマットもそうですね。
LangChainの一部ではすでにこのようなことが行われています。
このようなアイデアをまとめ、将来的にどのようになるかを示す良い方法です。
将来的にどのようになるのかがわかるようになりました。いつものように、何か質問があれば、コメント欄に書き込んでください。
コメント欄にご記入ください。
もし、この記事が役に立ったら、「クリック」「いいね」「購読」をお願いします。それでは、また次回の