WEBVTT

00:00.120 --> 00:01.200
All right, we're nearly there.

00:01.200 --> 00:02.040
We're nearly there.

00:02.040 --> 00:07.240
I've just got one more thing to show you, which is world pie, which is quite short, which is the

00:07.240 --> 00:08.240
overall thing.

00:08.280 --> 00:09.240
Creator pie.

00:09.280 --> 00:10.160
You have to send it.

00:10.200 --> 00:15.160
It's an agent, and you have to send creator a message like agent one, agent two, agent three, and

00:15.160 --> 00:16.200
it will create them.

00:16.200 --> 00:17.720
So this is where it all comes together.

00:17.720 --> 00:19.440
World pie is not an agent.

00:19.440 --> 00:21.280
This is this is just a Python script.

00:21.280 --> 00:23.040
Everything else you've seen has been agents.

00:23.080 --> 00:27.440
This is just a Python script, but it uses async Python in quite an interesting way.

00:27.960 --> 00:35.720
So there is this async function, this coroutine create and message which takes a worker uh, and a

00:35.720 --> 00:42.720
creator id and an I, which is going to be the agent number going 12345.

00:43.040 --> 00:46.880
Um, this how many agents up here is a pretty important one to look at.

00:46.880 --> 00:49.920
This is how many of these it's going to kick off at the same time.

00:49.960 --> 00:54.680
And the other thing that's unsafe about this, of course, is cost that this is going to hit, uh,

00:54.720 --> 00:56.080
the real API's.

00:56.320 --> 01:02.190
And for me it's cost like a couple of cents when I run this for 20 agents, which is pretty cheap,

01:02.190 --> 01:03.190
all things considered.

01:03.190 --> 01:05.630
And obviously if you do it for like three agents, it costs nothing.

01:05.630 --> 01:14.110
But there's a risk there that we are allowing in theory, the, the this, um, the agent creator could

01:14.110 --> 01:16.230
change the model requirements.

01:16.230 --> 01:21.150
It could, it could decide to use, uh, an expensive model instead of GPT four or many.

01:21.190 --> 01:22.830
And so that's that's just something to watch for.

01:22.870 --> 01:24.190
It's very unlikely.

01:24.390 --> 01:26.950
Uh, but it's not like it's not impossible.

01:27.230 --> 01:35.310
Anyways, we've got 20 agents here, so we've got this async method creator and and message it, uh,

01:35.590 --> 01:43.990
it says it takes this worker and it sends a message, uh, to the agent number, whatever dot dot pi.

01:44.510 --> 01:49.270
Um, and then it writes the results to idea whatever dot markdown.

01:49.670 --> 01:52.870
Um, that's, that's what all this, this thing here does.

01:52.990 --> 01:53.470
Okay.

01:53.630 --> 02:00.460
So now we go to our main async method and, our main async function, our coroutine.

02:00.660 --> 02:08.580
So it creates a host a gRPC worker agent runtime host as we did in the notebook before.

02:08.620 --> 02:13.700
It starts the host, it creates a worker and it starts the worker.

02:14.340 --> 02:17.180
It then registers the creator.

02:17.460 --> 02:21.860
So it registers the creator from creator dot pi that was imported here.

02:22.020 --> 02:24.780
So that will launch a creator.

02:25.420 --> 02:28.540
And this is its id creator default.

02:29.500 --> 02:31.900
Then this is the async thing.

02:32.100 --> 02:38.060
So I don't want to have a loop and call this creating worker after worker.

02:38.340 --> 02:43.780
Sorry creating agent after agent because then it will be serial or will happen one after another.

02:43.780 --> 02:48.900
If I do like a wait and then I call this this this coroutine, then we'll be waiting there.

02:48.900 --> 02:50.340
It will create one file.

02:50.340 --> 02:51.780
It will send it a message.

02:51.780 --> 02:52.940
Back will come the answer.

02:52.940 --> 02:55.660
Maybe it'll send it somewhere else, and then it will go on to the next.

02:55.660 --> 02:58.540
And we'll be sitting here waiting and it won't be exciting.

02:58.900 --> 03:03.420
But what you can do with coroutines, as you hopefully remember from we briefly talked about this,

03:03.620 --> 03:06.860
is that you can get a whole stash of coroutines together.

03:06.860 --> 03:10.900
So I haven't got the word await here, which you need if this is actually going to run.

03:10.900 --> 03:20.180
I'm just gathering a whole list of coroutines and then I await them using Asyncio gather and Asyncio

03:20.340 --> 03:23.300
gather runs them all in parallel.

03:23.740 --> 03:26.980
And as hopefully you remember, it's not like multithreading.

03:26.980 --> 03:31.820
They're not going to be actually running on different threads, like with the CPU chopping between them,

03:31.820 --> 03:34.660
but rather they're running in the event loop.

03:34.660 --> 03:37.020
That's how Asyncio Python works.

03:37.020 --> 03:41.300
They run an event loop so that every time it's waiting on OpenAI, which means it's waiting on a network

03:41.300 --> 03:45.700
connection, another one can be running, and that means they all get to run at the same time.

03:45.700 --> 03:52.100
And as long as I stay within my my rate limits with OpenAI, we'll be able to run plenty in parallel.

03:52.580 --> 03:53.740
And so it does all of that.

03:53.740 --> 03:59.410
And then at the end it stops and any exceptions it will, it will print them and that's it.

03:59.410 --> 04:04.930
This is, by the way, how you run async Python from the command line or from a from a Python module.

04:04.930 --> 04:12.450
Your main file needs to do this, which uh, brings which initiates an async IO event loop and then

04:12.450 --> 04:15.930
runs your async method, your coroutine.

04:15.930 --> 04:18.010
So that is how it hangs together.

04:18.210 --> 04:20.370
And I do believe this is it.

04:20.570 --> 04:22.250
I don't think I've got anything else to show you.

04:22.250 --> 04:23.250
I think you've seen everything.

04:23.250 --> 04:29.530
You've seen agent, which is the prototype, the thing that gets cloned creator which does the cloning

04:29.570 --> 04:30.610
agent by agent.

04:30.610 --> 04:32.010
It's called one by one.

04:32.370 --> 04:34.610
And, uh, world Pi is.

04:34.610 --> 04:36.130
This is not an agent.

04:36.130 --> 04:41.650
It's just Python code which will orchestrate, uh, which will launch the whole process running.

04:41.770 --> 04:42.130
Okay.

04:42.170 --> 04:44.650
All that remains to do is to actually show you this thing working.

04:44.690 --> 04:45.810
Let's see if it does work.

04:45.850 --> 04:46.650
See you in a sec.

04:46.690 --> 04:48.290
Okay, let's give this a whirl.

04:48.290 --> 04:50.970
So we'll bring up a command line.

04:50.970 --> 04:52.250
We'll make it nice and big.

04:52.250 --> 04:53.530
So we see what's going on.

04:53.880 --> 05:00.440
We will go into the fifth directory and now we don't say Python and then a module, but rather we say

05:00.480 --> 05:08.480
you've run and then world.py is our script that will call creator 20 times for 20 different creations.

05:08.480 --> 05:13.880
You're expecting to see Python modules appearing over time as it builds the Python agents.

05:14.000 --> 05:17.680
And then you should see ideas starting to appear as well.

05:17.960 --> 05:20.920
After the conversations have happened, it might take a bit of time.

05:20.920 --> 05:21.720
We'll see what happens.

05:21.720 --> 05:22.800
Do you think it's going to work?

05:23.320 --> 05:26.480
Some problems, some some messages about threads and gRPC.

05:26.480 --> 05:28.800
I don't know what that's about, but it doesn't seem to stop it.

05:28.840 --> 05:33.760
And then off it goes and you will see that it's that it says agent 16 is live.

05:33.760 --> 05:36.400
Agent 17 is live, agent nine is live.

05:36.600 --> 05:38.040
Lots of things going on.

05:38.040 --> 05:43.520
And now you'll see messages going between agents and lots, lots of stuff here.

05:43.680 --> 05:45.560
Let's take a look at some of these agents.

05:45.560 --> 05:48.120
You'll also start to see ideas are appearing here.

05:48.320 --> 05:49.720
We look at these agents.

05:50.240 --> 05:56.430
Here is a tech savvy innovator in the field of entertainment, gaming, film and virtual reality.

05:56.830 --> 06:02.350
0.3 chance that he speaks to someone else or she and a 0.8 temperature.

06:02.750 --> 06:04.590
Let's try this one here.

06:05.110 --> 06:06.550
It's also another.

06:06.830 --> 06:09.870
This one is futuristic technology solutions.

06:09.870 --> 06:15.510
Very short system message 0.8 0.4 16.

06:15.550 --> 06:17.230
Finance industry this one.

06:17.230 --> 06:19.350
Innovate within the finance industry.

06:19.390 --> 06:22.470
Fintech, e-commerce and digital transformations.

06:22.710 --> 06:23.710
I wonder what this one will be.

06:23.750 --> 06:26.390
Agent 16 we should go and look at idea 16.

06:26.390 --> 06:28.470
It's already finished the 20 ideas.

06:28.470 --> 06:29.510
So it's very fast.

06:29.510 --> 06:31.110
And that's the great thing about this.

06:31.150 --> 06:33.830
We just created 20 agents.

06:33.830 --> 06:35.230
They just came up with ideas.

06:35.230 --> 06:36.990
Many of them will have had conversations.

06:36.990 --> 06:39.630
It all just happened while you were watching.

06:39.630 --> 06:44.470
And I do hope that this was worth your time investment for for this and that.

06:44.470 --> 06:50.230
You see the the as I say, the entertainment value and the educational value of going through this.

06:50.430 --> 06:54.390
Let's take a look at agent 16 and see the financial services ideas.

06:54.750 --> 06:59.150
Uh, let's open a preview and let's get rid of this.

07:00.830 --> 07:02.230
Oh, and the fact that we've got this.

07:02.230 --> 07:04.230
I absolutely love the vision behind fin, buddy.

07:04.230 --> 07:10.150
This thing at the top here tells us that this is the, uh, that this was sent to another agent for

07:10.150 --> 07:10.590
feedback.

07:10.590 --> 07:13.190
At least one agent added feedback to this.

07:13.190 --> 07:15.590
So this this went through a couple of people.

07:15.790 --> 07:18.150
So I absolutely love the vision behind Fin Buddy.

07:18.150 --> 07:22.430
It's a powerful concept, the potential to make significant impact on financial literacy and accessibility

07:22.470 --> 07:24.470
for underserved communities.

07:24.470 --> 07:27.070
Let's refine it and elevate the idea even further.

07:27.230 --> 07:28.510
Refined concepts.

07:28.510 --> 07:29.310
So this is great.

07:29.310 --> 07:35.110
It's an idea for applying Agentic AI to, uh, to financial services that's been refined by another

07:35.110 --> 07:39.830
agent, Fin Buddy, your AI powered financial companion for empowerment and inclusivity.

07:40.270 --> 07:47.710
Uh, so it's, uh, it's basically an education platform for, uh, for people who are under underserved

07:47.710 --> 07:49.070
in financial services.

07:49.340 --> 07:51.140
Contextual financial advisor.

07:51.140 --> 07:53.220
Localised community support hubs.

07:53.500 --> 08:00.100
Micro investment pools users can join collaborative investment pools collectively decide on small scale

08:00.100 --> 08:02.980
investments that is cool and engagement driven.

08:02.980 --> 08:06.620
Gamification with real rewards partner with local businesses.

08:06.820 --> 08:10.020
Very interesting, very interesting.

08:10.220 --> 08:11.380
Well, I might give this a read.

08:11.460 --> 08:11.820
My own.

08:11.860 --> 08:13.220
You might not hear from me again.

08:13.500 --> 08:22.580
Uh, so anyway, the the goal of this is to is to give you a live agentic platform where agents are

08:22.580 --> 08:28.900
created and agents collaborate and interact in an autonomous way in such an autonomous way that they

08:28.900 --> 08:31.700
were even created by another agent.

08:31.940 --> 08:37.060
And I hope you find this as satisfying as I do, and I hope it was worth it.

08:37.060 --> 08:41.740
I hope it was worth the half an hour investment to get here and do take a look through the code.

08:41.740 --> 08:42.580
If nothing else.

08:42.580 --> 08:49.610
As I say, it's it's definitely got some interesting, uh, Ideas built in there about how to use things

08:49.610 --> 08:53.290
like autogen for this kind of messaging between agents.

08:53.450 --> 08:59.130
And if nothing else, if you give it a run, if you feel bold, you will find a bunch of ideas.

08:59.170 --> 09:02.970
And maybe, maybe you'll be off on your yacht before too long.

09:03.650 --> 09:05.130
All right, I'll see you for the wrap up.

09:05.170 --> 09:09.450
Well, thank you for indulging me for the last half an hour of going through that project.

09:09.450 --> 09:12.290
I do hope that you at least found it somewhat interesting.

09:12.330 --> 09:12.930
Educational.

09:12.930 --> 09:18.650
And, yeah, it's opened your eyes a bit into some of what's possible at the frontier of Agentic AI,

09:18.690 --> 09:20.930
which is very much where Autogen is.

09:20.930 --> 09:28.370
It's very much an experimental and futuristic platform as we've seen ourselves first hand.

09:28.610 --> 09:32.730
So the challenge for you, the end of week challenge is an optional one, because this week has been

09:32.730 --> 09:35.250
experimental and a researchy week.

09:35.490 --> 09:41.890
But should you wish, uh, invest some more time in this, in this idea, uh, see if you can work with

09:41.890 --> 09:47.000
me on on the making it a bit more robust and something that it's safer for people to run, perhaps by

09:47.000 --> 09:51.880
dockerizing it, but in particular, something which I think would be fascinating would be to have it

09:51.880 --> 09:59.720
so that the creator is not only able to write new agents, but it's also able to write a new version

09:59.720 --> 10:00.720
of itself.

10:00.840 --> 10:07.440
It can create a new creator, modeling it off its own template of its own file, which it can also read.

10:07.800 --> 10:11.240
It might be interesting to turn that into a tool, rather than just having it be there in the Python

10:11.240 --> 10:16.960
code, have it be able to run a tool that reads in its own code, and it can then rewrite itself, making

10:16.960 --> 10:21.080
a replica something which itself is able to create new agents.

10:21.080 --> 10:25.520
And perhaps it could change its own logic slightly in some interesting way.

10:25.680 --> 10:27.760
So I think that would be fascinating.

10:27.800 --> 10:28.680
Super meta.

10:28.920 --> 10:31.200
It's something that creates creators.

10:31.640 --> 10:36.320
And then, I mean, if it creates itself, then in theory it can create creators of creators.

10:36.560 --> 10:37.440
Uh, so.

10:37.480 --> 10:37.840
Yeah.

10:38.160 --> 10:39.040
Mind blows.

10:39.280 --> 10:40.240
Uh, interesting.

10:40.240 --> 10:41.400
Interesting project.

10:41.440 --> 10:48.800
A great way importantly to be experimenting with interactions between agents in this kind of idea of

10:48.920 --> 10:54.920
an environment where the where the messaging, the communication and creation of agents is a separate

10:54.920 --> 11:00.880
concern from the implementation of the agents, which is, of course, the fundamental point of Agincourt.

11:01.360 --> 11:01.960
All right.

11:02.000 --> 11:05.960
And with that, finally, I'll stop yammering away about this.

11:06.000 --> 11:11.200
We're with the agent creator is done, and we are on to week six.

11:11.360 --> 11:15.680
The the fantastic, the exciting conclusion.

11:15.680 --> 11:18.320
And it is going to be a legendary week.

11:18.600 --> 11:25.280
Uh, I can't wait to show you everything that MCP is about and can offer, and I can't wait to return

11:25.280 --> 11:27.760
to OpenAI agents SDK.

11:28.000 --> 11:34.560
Still my favorite, even after enjoying all of the others, enjoying Crew and Landgraf a lot, and being

11:34.560 --> 11:39.160
generally, uh, entertained by by autogen and by the its forward thinking ness.

11:39.160 --> 11:42.920
But OpenAI agents SDK is next with MCP.

11:43.120 --> 11:44.080
I'll see you then.
