HomeVideos

AI Agents Full Course 2026: Master Agentic AI (2 Hours)

Now Playing

AI Agents Full Course 2026: Master Agentic AI (2 Hours)

Transcript

4226 segments

0:00

Hey, this is the definitive course on AI

0:02

agents. I currently teach over 2,000

0:04

people how to use AI agents in both

0:05

their personal and business lives and

0:07

run a business that does over $4 million

0:09

a year using AI agents. So, you don't

0:11

need any programming or pre-existing

0:13

computer experience in order to make

0:14

this course work for you. I myself don't

0:16

have a formal computer science degree.

0:18

I've learned everything that I know

0:19

watching free resources like you doing

0:21

now. This is also a general AI agents

0:23

course, so you don't need to know any

0:25

specific platform. This isn't just on

0:27

Codex or Claude Code or Anti-Gravity,

0:29

but rather on all of them. So, wherever

0:31

you guys are starting, you'll end up at

0:33

the same place. No fluff, here's what

0:34

you're going to learn in this course.

0:35

First, I'll show you guys a demo where

0:37

I'm controlling five AI agents, each

0:39

with their own Chrome browsers as they

0:41

interact with the web and perform

0:42

economically valuable activities for me.

0:44

I wanted to front-load this course with

0:46

a demo so you guys could see what we're

0:47

working up to. And just a few months

0:48

ago, what I'm doing here would have been

0:50

considered absurd. Then, I'm going to

0:51

cover the core AI agent workflow loop,

0:53

which works independent of which

0:54

platform you're using. After that, I'm

0:56

actually going to talk about and then

0:57

sign up to the three major AI agent

0:59

platforms right now. So, I'll sign up to

1:00

Codex, to Anti-Gravity, and then Claude

1:02

Code. And then after I'll cover what

1:04

each platform is at the moment the best

1:06

or the worst at. Then, we're going to

1:07

dive into foundational AI agent

1:09

prompting techniques. So, self-modifying

1:11

agent instructions where the agent will

1:13

rewrite its own rules to minimize the

1:14

number of errors made. Multi-agent MCP

1:17

orchestration, which is where we'll

1:18

register Codex, Gemini, and Claude as

1:20

MCP servers so you can manage multiple

1:22

agents within a single conversation

1:24

thread. Video-to-action pipelines where

1:26

we'll teach agents to learn from YouTube

1:28

videos instead of plain text alone.

1:30

Stochastic multi-agent consensus where

1:31

we'll spawn agents with the same prompt

1:34

and then use their statistical spread in

1:36

order to ideate and improve things

1:37

about. Agent chat rooms where you'll

1:39

build centralized places for agents to

1:41

debate ideas, pushing them to much

1:43

higher quality answers than before.

1:45

Sub-agent verification loops where your

1:47

agents will actually review each other's

1:48

work in real time to catch things that

1:50

one of them might have missed.

1:52

We'll talk prompt contracts. I'll show

1:53

you guys reverse prompting and a bunch

1:55

of other techniques as well. And

1:57

finally, we'll chat about context

1:58

management and improving the agent

2:00

output quality before closing out by

2:02

discussing how to optimize AI agent and

2:05

then token pricing. So far, I haven't

2:06

seen anybody on YouTube discuss most of

2:08

what I cover in this course. So for all

2:09

intents and purposes, you guys consider

2:11

this the sauce. Please bookmark this

2:13

video, subscribe to the channel, and

2:14

let's get into it. First, I want to show

2:16

you how powerful these agents can be

2:18

when you learn how to distribute work

2:20

across multiple Chrome instances and

2:22

give each sub-agent their own workspace.

2:24

What I have here is a simple list of

2:27

leads from, let's just say, a

2:29

conference. Now, we have fields like

2:31

their websites, their LinkedIn

2:33

description, their first name, their

2:34

last name, but one thing is missing:

2:37

their email address. Now, just a year

2:39

ago or so, that would have invalidated

2:42

my ability to reach out to these leads.

2:44

But now, because I possess their

2:46

websites, I can actually spawn a bunch

2:48

of Claude code agents, have them go to

2:50

the websites, then have them

2:51

interactively and dynamically fill out

2:53

their contact forms.

2:55

So what just happened as I was talking

2:57

was Claude went ahead and then opened up

2:59

a bunch of different Chrome browsers for

3:00

me.

3:01

I'm going to rearrange these to make it

3:02

really easy to see. And so, this might

3:04

be a little bit tough to see, but what

3:06

these agents are all doing is they're

3:07

independently navigating over to the

3:10

contact fields of each of these

3:11

websites. They're then dynamically

3:13

filling out fields like the first name,

3:16

the last name, the email address, and so

3:18

on and so forth. And then they're

3:19

putting in a little bit of outreach

3:22

that's templated, but then changes

3:23

depending on who they're reaching out

3:25

to. These agents, through a combination

3:26

of both research and then communication

3:28

between each other in a shared chat

3:30

room, are capable of doing things that

3:32

any one agent might have taken many,

3:34

many hours to do before. This is what

3:35

I'm going to work up to with you guys

3:37

over the course of the rest of the next

3:39

couple of hours. The main strength of AI

3:41

agents is really their ability to

3:43

parallelize, which is to run multiple

3:46

instances of each of them simultaneously

3:48

while they accomplish a task. Now, right

3:51

now, I would say most AI agents aren't

3:53

as intelligent or as capable as a human

3:55

being for any given need. But, what they

3:58

are much better at us than is being

4:00

fast. And so, despite the fact that

4:03

their accuracy might be a little bit

4:04

lower than a human, their ability to

4:06

one-shot stuff is worse than ours at the

4:09

moment, they can run multiple instances

4:11

of themselves simultaneously and try

4:13

multiple approaches over and over and

4:15

over and over again in order to

4:17

ultimately achieve much better results

4:19

than we can. The key is you need to know

4:21

a little bit about how they work under

4:23

the hood. Then, you need to be able to

4:24

combine them using elaborate prompt

4:26

architecture like I'm going to show you

4:28

in this course. So, why don't we start

4:29

with one of the simplest, most

4:30

foundational concepts before I actually

4:32

guide you guys through signing up and

4:34

setting up these different agents. And I

4:36

call this the core agent loop.

4:39

To make a long story short, I think most

4:41

of you probably have intuition about how

4:43

agents do things, but really what

4:45

they're doing at the end of the day is

4:48

they're going through a loop over and

4:50

over and over again. And this loop is

4:52

composed of three major functions.

4:55

The first is the observation step. And

4:58

so, here the agent is basically reading

5:00

through all of its context. We're going

5:02

to chat a little bit more about how to

5:04

optimize and manage that later. That

5:06

includes things like its files, its

5:08

previous tool calls, it includes all of

5:11

the system prompts, the Claude, Gemini,

5:13

and agents.mds that you provide. If it

5:16

does research in a previous step, it'll

5:18

include the research from the internet.

5:20

Uh if you're feeding in multimodal data

5:22

like vision data, camera data,

5:24

uh you know, audio files, and so on and

5:26

so forth, it'll include all of that. And

5:28

so, this agent, okay, is just in an

5:30

environment and it's just always

5:32

observing what's going around it, at

5:34

least to start, in the observation step.

5:37

From there, it'll reason. And so, this

5:39

is the think step. Here, it'll consider,

5:42

based off of all of this context and

5:44

based off of, you know, the user's

5:45

high-level goal, what do I do next? How

5:47

should I plan my approach? And nowadays,

5:50

most agentic coding platforms make use

5:52

of like a dedicated reasoning step that

5:55

you can actually click into and see,

5:57

which I'll show you guys a little bit

5:58

more of. And this provides a tremendous

6:00

amount of interpretability,

6:01

accountability, and then steerability,

6:03

which is really important that I think

6:04

most people sleep on.

6:06

After it's thought about things and

6:07

basically wrote its own mini plan, it's

6:09

time to actually act, right? And so

6:12

here's where it'll call tools. It'll

6:14

edit the files that it decided to uh do

6:16

so earlier in the plan. Or maybe it'll

6:18

run a command using command line

6:20

interfaces, CLIs.

6:23

After the action step is done, what it

6:25

does is it gets the result of the tool

6:28

call, and then it feeds all of that

6:30

stuff back in to the observe step. So

6:32

now we're basically running through that

6:34

loop again, just with a little bit more

6:36

context. And so what occurs essentially

6:39

is we just tend to grow bigger and

6:41

bigger and bigger and bigger. If our

6:43

initial context was a certain size, our

6:46

you know, second loop, it's a little bit

6:48

bigger. Our third loop, it's a little

6:49

bit bigger. And fourth loop and so on

6:51

and so forth. And what this is doing is

6:53

this is basically stacking uh more and

6:55

more tokens into the context that the

6:58

model can then use to plan its next

6:59

step.

7:01

What occurs after you go through this

7:02

loop, you know, usually three or four

7:04

times, is eventually the model reaches a

7:06

point called the definition of done.

7:11

And what the definition of done is,

7:13

which I think a lot of people leave out

7:15

of their agent prompts, which is

7:16

probably why they're always underwhelmed

7:17

by what happens, is it's the series of

7:19

constraints and technical specifications

7:22

required for the model to conclude that

7:26

it no longer needs to do this loop.

7:29

Once it reaches this definition of done,

7:31

okay, over and over and over and over

7:32

again,

7:33

it notices and then it changes routes.

7:36

So now it goes to the task complete

7:38

route, where it generates a quick little

7:40

final response for the user. Usually

7:42

involves a nicely formatted answer, as

7:44

I'm sure you guys know. Hey Nick, just

7:46

finished your new thumbnail app build.

7:50

And before outputting it in a window,

7:52

either in antigravity or Codex or maybe

7:55

Claude code, in a packaged way that you

7:57

guys are familiar with.

7:59

And so, obviously, if you have any

8:01

intuition about how AI works at this

8:04

point, if you've ever communicated with

8:06

ChatGPT or, you know, Claude or some

8:09

other sort of desktop AI that's nestled

8:11

into another application that you guys

8:12

use, you'll probably know some of this

8:14

stuff um just as like the foundation.

8:16

But I wanted to make it really explicit

8:18

at the beginning of this course because

8:20

we're going to return to each of these

8:21

steps over and over and over again. And

8:23

it turns out that you can heavily

8:25

optimize all three of these. You can

8:27

optimize the hell out of the observe

8:28

step. You can optimize the hell out of

8:31

the think step. And understandably, you

8:33

can optimize the hell out of the act

8:34

step as well. That's what we're going to

8:36

learn. Another point I'm going to make

8:37

in this course is that AI agents aren't

8:40

just the large language models

8:41

themselves. You know, I think neural

8:43

networks and transformers are obviously

8:46

super inherently interesting because

8:48

they're these massive statistical things

8:50

and these beings that can that can do

8:52

things. They can reason. They're very

8:54

far removed from traditional computer

8:55

programs just 5 or 10 years ago. So a

8:58

lot of interest goes to the LLM. But I

9:00

want you guys to know that the LLM

9:02

really is just a very small part of what

9:04

most people consider AI agents these

9:06

days.

9:06

The LLM is of course your reasoning

9:08

engine, right? Of course it understands

9:11

language and of course it makes

9:12

decisions. But it's kind of like a human

9:14

being from like 20,000 years ago with

9:17

like a spear in its hands, right?

9:19

Without all of the infrastructure around

9:21

human beings, without like your your

9:23

house and your fireplace and your hearth

9:25

and a place to sleep at the end of the

9:26

night and a a society where people farm

9:29

and produce resources and you have cars

9:32

that you can get in and traverse a lot

9:33

of distance. Without all the tools and

9:34

the architecture around the

9:36

intelligence, the intelligence is

9:37

actually quite limited in what it can

9:39

do.

9:40

And that's where the rest of these

9:41

sections come into play. So, tools, much

9:44

like human beings, have the ability to

9:46

read files, run code, search the web,

9:49

call APIs, and edit files, okay? So,

9:52

too, does this AI agent. Much like human

9:54

beings have the ability to set a

9:56

high-level goal and keep going until

9:59

that task or goal is reached, you know,

10:01

so, too, can agents. And much like human

10:03

beings have some sort of persistent

10:05

memory where we can keep track of things

10:07

that we've done and then realize that

10:09

some of those things didn't work, so we

10:11

got to take a slightly different tack

10:12

the next time, so, too, agents have

10:14

things like agents.md, claw.md,

10:16

gemini.md, access to their conversation

10:19

history, access to auto memory files,

10:21

and skills. And so, it's not actually

10:23

just the LLM, for instance, that makes

10:26

an agent work. It's really all of these

10:28

things multiplied by the fact that, you

10:30

know, the LLM provides us like the

10:32

ability to be a little bit flexible. And

10:33

that's the really big different from

10:35

just, you know, a chatbot and then an AI

10:37

agent. A chatbot might just be the LLM,

10:40

okay? But, an agent takes that that LLM

10:43

and then it adds on tools, a reasoning

10:45

loop, memory, and so on, and so on, and

10:47

so forth. So, as a brief example, I'll

10:49

use an agent coding platform called

10:51

Codex. And down here, I have a simple

10:54

prompt where basically, I just want this

10:56

to do a bunch of research for me on

10:57

creatine supplementation in men.

11:00

And what I'm doing is I'm giving it a

11:01

brief definition of done where I'm

11:03

saying it once you've compiled 10 plus

11:05

empirical sources, return a structured

11:07

report. And I'm doing this cuz I want to

11:08

demonstrate this loop to you. And so,

11:10

there are a bunch of other things that

11:11

are popping up here. We have the actual

11:14

chat window up at the top, we have its

11:15

response, but you'll notice that in

11:17

between, we have this sort of like

11:18

grayed-out section here. Okay, in this

11:20

grayed-out section is the thinking that

11:22

the model is doing before it gets back

11:24

to us. And so, basically, you know, if

11:27

this was ChatGPT back from 2022 or so,

11:30

all we would have gotten is this. But

11:32

because I'm telling it to take actions

11:34

in the real world, it's capable of one,

11:37

observing. And so, it observes all of

11:40

this text and all of its reply as

11:42

context.

11:44

Two, thinking. So, it's capable of doing

11:46

a bunch of thinking on what to do next.

11:49

And then three, acting. And so then it's

11:51

capable of saying, "Hmm, the user

11:52

probably wants me to do some research. I

11:54

have access to a few tools available.

11:56

One of the tools lets me search the web.

11:58

Let me pump in a search term." It then

12:00

compiled all of this information, and

12:02

then it just repeated the same thing. It

12:04

then with all this context said, "Okay,

12:06

I'm observing. Not only do I have these

12:07

messages, but I also now have a bunch of

12:09

research. Let me think about what to do

12:10

next. Have I achieved the goal of the

12:13

user compiling 10 plus empirical

12:14

sources?" And you know, after it's made

12:16

its sort of observation and thought on

12:18

the reasoned about it, then it's

12:20

deciding to act. And what it's ended up

12:21

doing after 58 seconds is giving me this

12:23

structured evidence report. So, this is

12:25

an example of something that might have

12:26

looped two times, three times, but the

12:28

more intelligent and capable these

12:30

models are getting, um the longer that

12:32

they're running autonomously without us.

12:34

Hopefully, this isn't rocket science to

12:35

anybody here, but in a nutshell, this is

12:37

more or less what's always occurring

12:39

non-stop every time you talk to a model.

12:41

With all that being said, let's really

12:43

quickly cover how to set these different

12:44

models up. I'm going to be using Codex,

12:47

Claude Code, and Antigravity. You don't

12:50

need to know anything about any of these

12:52

platforms in order to run these

12:53

examples. And if you're already very

12:55

familiar with, let's say, I don't know,

12:56

Claude Code, and you've chosen to use

12:58

that as your main agentic coding

12:59

platform moving forward, you can skip

13:01

over to the next section of the video.

13:03

But I want to make sure that we all have

13:04

an equal playing ground here, and we all

13:06

understand how each of these platforms

13:07

work under the hood. So, there are three

13:09

major platforms. The first is Codex,

13:11

which is owned, managed, and run by

13:13

OpenAI. The second is Claude Code, which

13:16

is owned, managed, and run by Anthropic.

13:18

And the third is Google's Antigravity,

13:20

which as I'm sure you can imagine is

13:22

owned, managed, and run by Google. In

13:24

order to start with Codex, what you

13:26

first have to do is sign up to an Open

13:28

AI account. The way you do so is just

13:30

look up Open AI on Google, get to a page

13:33

that looks anything like this, and then

13:35

just go to the top right-hand corner

13:36

where it says try Chat GPT. After that,

13:38

you'll be taken to a page that looks

13:39

something like this. You can continue

13:41

with Google, your phone, or whatever you

13:43

want. And if you choose to chat with the

13:45

model and then come back at any point in

13:47

time, just head to the top right-hand

13:48

corner for that model again. So, I'm

13:50

going to pretend that I haven't made an

13:52

account before and I'll continue with

13:53

Google. After some brief onboarding

13:55

instructions, you'll have access to a

13:56

page like this. But, this is just Chat

13:59

GPT, which is more akin to a chatbot

14:01

than anything else. We want to take this

14:03

to the AI agent world. And so, in order

14:05

to do that, we need to use their

14:07

dedicated AI agentic coding platform

14:09

Codex. So, Googling Open AI's Codex or

14:12

something like that will take you to a

14:13

page that looks like this, and then you

14:15

can just click download for macOS. By

14:17

the way, I'm on a Mac, so that button's

14:19

automatically going to pop up for me.

14:21

But, the Codex app is now also available

14:23

on Windows starting March 2024th and

14:25

beyond. The way you install things on a

14:27

Mac is you just take this window, drag

14:29

Codex over to applications, and then

14:31

you're done. Once you're inside, if you

14:32

wanted to build a website or something,

14:34

just head over to this middle, create a

14:36

new folder, call it whatever you want.

14:38

So, I'll just go to downloads and then

14:39

go a new folder, example.

14:42

Open it within it, and now you're inside

14:44

of this folder. Here, you can ask the

14:45

model to do whatever you want. And so,

14:47

what I'm going to say is make a brief

14:48

portfolio site about Nick Surive. Keep

14:51

it super simple and minimal.

14:53

It'll now do some thinking.

14:55

In our case, I actually have a design

14:56

taste front-end skill, which improves

14:58

its ability to create like sleek,

15:00

high-quality looking designs.

15:02

And now, it's looking through my own

15:04

workspace to put together this cool,

15:05

sexy site for me. I'm also going to ask

15:08

it to open it.

15:09

Uh and the way that all AI agent

15:11

platforms work now is you have the

15:13

ability to put a

15:15

queued message in, which you can also

15:17

choose to send immediately via steer. In

15:20

In case, I'll just wait until it's done.

15:21

It'll consume this open it message and

15:23

then it'll just open it for me in a new

15:25

tab. Once it's done, the open it message

15:27

will be fed in and it's just going to

15:28

open this for me in a new tab. Now, I'm

15:31

kind of zoomed in here, so if I zoom in

15:33

a little bit more, you'll see that this

15:34

is just a a simple one-page site that

15:36

says Nick Sarif builds clear modern

15:38

digital work. Here's some information

15:40

about me and here's a contact page. Not

15:42

rocket science, but this is how easy it

15:43

is to like build web stuff. Claude is

15:45

pretty similar. Just Google Claude sign

15:47

up or something like that and you'll be

15:49

taken to a page that looks like this.

15:51

Here, you just enter your email address

15:52

or in my case, continue with Google. In

15:54

Claude's case, in order to use Claude

15:56

code, you do have to pay for it. And so,

15:58

there is a pro plan here that's $17 per

16:01

month with an annual subscription or 20

16:03

bucks if billed monthly.

16:05

I'm not working for Claude or anything

16:07

like that. I don't have any sort of

16:09

affiliation with Anthropic in that way,

16:11

but I will say that I received probably

16:14

a 100 to 200 x return on my investment

16:17

with an agent coding platform, whether

16:19

it's Claude or whether it's Gemini or

16:21

whether it's Codex. So, my

16:23

recommendation for you, if this seems a

16:24

little bit steep, is bite the bullet,

16:26

pay it and learn whatever you can to

16:29

make a return on investment with that

16:30

money in the first month because this

16:32

stuff is really quite powerful. Assuming

16:34

you're done, just type Claude code

16:36

desktop download or something like that.

16:38

You'll be taken to a page that looks

16:39

like this, which allow you to download

16:41

it for Mac OS, Windows or even Windows

16:43

ARM 64. So, I'm going to give my Mac OS

16:46

thing a quick click. Then I'll go to the

16:48

top right-hand corner. I'll just open

16:49

Claude up just like I did with Codex.

16:51

That'll take me to a page like this and

16:53

then I just drag this over to the right.

16:54

And then once you're done, you'll be

16:55

taken to a chat page that looks

16:57

something like this. What we really want

16:59

is we want this code button, so I'm

17:00

going to give that a click. Then here,

17:02

all we need to do is just choose a

17:04

folder to work in and then we can put in

17:06

a quick request. So, I'm just going to

17:07

choose a general folder Nick Sarif. Then

17:10

I'm going to say bypass permissions,

17:12

which might seem a little bit scary to

17:13

you, but it just makes the model act

17:15

independently. Then finally, I'm going

17:17

to say, "Hey, make a brief portfolio

17:19

site about Nick Sheraif. Super simple

17:21

and minimal."

17:22

And so, just like Codex designed it a

17:24

moment ago with its various UX uh

17:27

features, we have the same thing here

17:28

with Claude Code. It's going to ask to

17:30

access some files in my folder.

17:33

And in addition to having the message

17:35

box, we also have this sort of grayed

17:36

out shining uh decal here, which is sort

17:39

of it's like sinking, if you think about

17:41

it, as well as its tool calls.

17:43

And what it's going to do now is

17:44

actually build me a brief little site.

17:46

And then just like I did before, I'll

17:48

just say, "Open it."

17:50

That's going to queue it, and now I can

17:52

have a conversation with Claude. And now

17:54

we have the actual portfolio, which as

17:55

you guys can see here is done in

17:57

significantly more minimal fashion,

17:59

okay? So, this is Nick Sheraif, builder

18:01

automation expert software engineer.

18:02

Now, unlike with ChatGPT and then Claude

18:06

for Anti-Gravity, odds are you probably

18:08

already have like a Google or a Gmail

18:10

account set up. So, all you have to do

18:11

is just look up Google Anti-Gravity

18:13

download, then click download for Mac

18:15

OS. In my case, I have Apple silicon on

18:18

Mac. If you guys don't know what you

18:20

have, just type about this Mac, and then

18:22

if it says Intel up here and chip,

18:23

you're an Intel. If it's a M something,

18:26

then you're Apple silicon. And you can

18:27

do something similar for Windows and

18:29

Linux, as well. And once I give that a

18:30

click, we'll be taken to a very

18:32

similar-looking page here, and then I

18:33

can just drag Anti-Gravity over to

18:35

applications. The very first time you

18:36

open up Anti-Gravity, it'll look

18:38

something like this. In your case, maybe

18:39

it'll be dark mode, or maybe it'll be

18:41

entirely light. I just have some styling

18:43

settings, which is why mine might look a

18:45

little different from yours. You may

18:46

also have to log in, unless Google

18:48

logged you in automatically. In my case,

18:50

it logged me in automatically because

18:51

I've used it before. Assuming that

18:53

you've done that though, on the

18:54

right-hand side, you'll see an agent

18:56

model. And this agent model is very

18:58

similar to what we saw with Codex and

18:59

then Claude Code. All we have to do is

19:01

just ask it to make a brief portfolio

19:03

site about Nick Sheraif. You'll see here

19:04

that the UX is just a little bit

19:06

different, right? We have a little

19:07

generating tab down here. Obviously, we

19:09

have uh multiple settings with fast and

19:12

Gemini 3.1 Pro. We have this little

19:14

thinking tab. Uh it tells you how long

19:16

it's been doing it. If it has to do any

19:18

web searches, it does so over here.

19:20

Hopefully you guys are seeing these are

19:22

all just flavors that are slightly

19:24

different, but ultimately are the same

19:26

thing. I'm just going to write open it.

19:27

That'll be added as a pending message,

19:29

and then it'll open this up in a browser

19:31

tab. As you see here, Gemini produced

19:33

what I would probably consider to be the

19:34

sexiest of all websites, which makes

19:36

sense. Uh one thing I'll talk about in a

19:38

moment is how much better it is at

19:40

front-end design and so on and so forth.

19:42

And yeah, we have a very simple and and

19:43

straightforward site here. So, um this

19:45

links to all of my resources, left

19:47

click, YouTube, and so on and so forth.

19:49

I probably like this one the best. From

19:51

here on out, most of the conversations

19:53

and the user experiences are going to be

19:55

really similar between the agent coding

19:57

platforms. So, while I am going to use

19:59

multiple just to show you guys how some

20:01

of their quirks interact, uh for the

20:03

most part, I want you guys to know that

20:04

the UXs are are very very similar these

20:07

days. Like the thinking tabs, they're

20:08

going to be the same. Some people will

20:10

probably say that there are slight

20:11

differences between them and so on and

20:13

so forth. For instance, I'm a big fan of

20:15

the little Space Invader icon in that

20:16

Claude Code has. Uh but for all intents

20:18

and purposes, I'm just going to assume

20:20

that you're picking up the UX here as

20:22

you use these models, and focus less on

20:24

like the tiny little stuff and more on

20:26

how to orchestrate and then prompt these

20:28

for higher quality responses. If you

20:29

guys want to see like step-by-step

20:31

walk-throughs of these platforms, I'm

20:33

going to put some little links up above

20:35

my left shoulder here, and you can uh

20:37

click on them anytime to go learn that

20:38

sort of stuff. Next up, I want to talk

20:40

about what makes these AI coding

20:41

platforms different from one another.

20:44

Not on a user experience um angle, but

20:47

from an intelligence angle, from a what

20:49

they could do angle as well. So, as you

20:51

saw there, there were three different

20:53

models. There was Claude, which was

20:55

wrapped around Claude Code, Gemini,

20:58

which was wrapped around antigravity,

21:00

and then GPT, in my case 5.4, which is

21:03

wrapped around Codex.

21:05

And I think that each of these models

21:07

are really similar at this point in

21:08

intelligence-wise, but there are some

21:10

pros and cons to each that basically

21:13

like improve how they perform by a few

21:15

percentage points. So, Claude might be,

21:17

you know, 2% better at these, you know,

21:19

Gemini might be 5% better at these, GPT

21:22

might be 1% better than these. I'm just

21:24

pulling out numbers out of my butt. But,

21:26

I'm making them really small because I

21:27

do want to really drive home the point

21:29

that these models are so gosh darn

21:31

intelligent these days that these minor

21:33

differences only make sense at the

21:34

bleeding edge and at the frontier. For

21:36

most purposes, either of these are going

21:39

to be sufficient. So, Claude has the

21:41

most interpretable reasoning. You

21:43

remember how I could click open that

21:45

little reasoning tab a moment ago? Well,

21:47

at least as of the time of this

21:48

recording, Claude is incredible at

21:50

making that reasoning tab really, really

21:52

interpretable. You know exactly what

21:54

Claude is doing at basically every step

21:55

of the process when you use Claude code

21:58

to visualize that reasoning. And that

21:59

makes it really good for orchestration

22:02

and then agentic workflows because you

22:05

can see the decisions of the model is

22:06

making in real time. And in doing so,

22:08

you can also steer the model, stop the

22:10

model, pause it, or give it new

22:12

resources halfway through. I can't say

22:14

the same about both Gemini and GPT. I

22:16

think they're a lot less interpretable

22:17

and it's a lot less accountable. You

22:19

know, Claude is sort of a partner that

22:21

you build things with along the way,

22:23

whereas Gemini and GPT are almost just

22:24

like, I don't know, they're missiles.

22:26

You set your target, you click the

22:27

button, and then they go. Now, there are

22:29

some cons. Claude is a little bit slower

22:31

unless you use fast mode, which is what

22:34

I tend to use, although keep in mind

22:35

that'll burn a ton of credits. And then

22:37

I find that it's weaker at front end or

22:39

design than a model like Gemini.

22:41

Gemini is really good at design and

22:43

front ends. As you guys just saw a

22:45

moment ago, Claude picked a really

22:46

minimalistic sleek theme. Gemini did

22:49

some upscale stuff that still looked

22:51

sleek, clean, but had like that

22:53

isomorphic glass. And then GPT, maybe

22:56

because of my design taste scale or

22:57

something else, was kind of like more

22:59

complex and had uh a little bit clunkier

23:01

of a design. Well, in general, I find

23:03

that this pattern remains the same.

23:05

Anytime I want to design a really clean

23:07

front end, I'm going to use Gemini for

23:08

that. It's also got superior multimodal

23:10

abilities. That just means there's

23:12

actual like endpoints using the Gemini

23:14

API um where it can understand video.

23:17

Right now, Claude and GPT both really

23:18

struggle with this, although you can

23:20

build custom pipelines to do that, which

23:21

I should have showed you guys about. It

23:22

also has the ability to use a fast

23:24

output, which means it writes really,

23:26

really quickly if need be, um but they

23:27

don't have access to a dedicated fast

23:30

mode where you could pay more money to

23:31

use them really quick. I think it's the

23:33

least interpretable of the models, and

23:34

personally I find the quality is quite

23:36

inconsistent. There's some days when

23:38

I'll prompt it and it'll do quite

23:39

incredible, then other days where I'll

23:40

prompt it and it will just absolutely

23:42

crap the bed.

23:43

You know, at least Claude's quite

23:44

consistent in that way, despite the fact

23:46

that maybe it's a little bit worse at a

23:47

few things.

23:48

Finally, there's GPT. There's the Codex

23:51

series of models, the 5.4 series of

23:53

models now. These are the best at

23:54

back-end programming. I think they're

23:56

also the best at like um absolute

23:58

mathematics, which probably feeds into

24:00

that. They're really great at

24:01

test-driven development, and you know

24:03

how I mentioned earlier Gemini and GPT

24:05

are more like rockets that you point at

24:06

a at a at a place and then they go. Um

24:08

well, these test-driven development

24:11

approaches essentially mean you just

24:12

outline that definition of done, and

24:14

then it fires and just goes autonomously

24:16

until it reaches that. There's also

24:18

quite a big ecosystem of different apps,

24:19

and you know, there's a lot of um

24:21

documentation online about how to use

24:23

various GPT workflows and stuff like

24:25

that, because this was the first major

24:27

player to the AI agent market. I'd give

24:30

it sort of like a uh you know, two out

24:32

of three on the rest of these. I think

24:33

Claude is much better at its

24:35

interpretability, it's much better at

24:36

orchestration and stuff like that. But

24:38

GPT, being a model that just came out

24:40

quite recently, a 5.4 anyway, is

24:43

obviously sort of like topping the

24:44

charts right now on a lot of stuff. Just

24:45

some caveats there, a lot of people

24:47

treat this as like

24:49

>> [snorts]

24:49

>> anathema for you to claim that, you

24:51

know, Claude is better than GPT at this

24:53

thing, and Gemini is better than than

24:55

Claude at that thing. The reality is, as

24:57

I mentioned and alluded to at the

24:59

beginning, there are very minor

25:00

differences between these models at this

25:02

point. All of them are basically trained

25:03

on the entirety of the internet as is.

25:05

And so because of this, the slight

25:08

differences in capabilities in the model

25:10

tend to have more to do with like when

25:11

they were trained and how recent it is

25:14

versus, you know, some inherent like

25:15

cool new design technique. Really,

25:17

they're just training these galaxy-sized

25:19

brains on the entire internet at this

25:21

point. So because we're talking about

25:22

the LLM intelligences, you know, if like

25:24

GPT was trained after Claude, GPT's

25:26

probably going to be a little bit better

25:27

in certain circumstances. If Gemini's

25:29

trained after GPT, it'll be better. But

25:32

all that stuff resets with the next

25:33

generation. So though I am going to be

25:35

showing you guys some cool multi-MCP

25:37

orchestration uh techniques later on, I

25:39

want you to know that you don't have to

25:40

treat all this super seriously. You can

25:41

also just pick one model and then use

25:43

that. Okay, next up I want to chat

25:45

agents.md and then how to build a

25:47

self-modifying and self-correcting

25:49

system prompt that significantly

25:51

minimizes the number of errors that you

25:53

get as you build things with these AI

25:55

agents. So for the purposes of this

25:57

demonstration, I'm going to be using

25:58

antigravity and through it the Gemini

26:00

series of models. When you open up

26:02

antigravity, you have a little window

26:03

that looks like this. Generally, I

26:05

divide this into three panes. You have

26:07

your explorer on the left-hand side,

26:08

your file editor in the middle, and then

26:10

you have your agent on the right. What

26:12

I'm going to do for the purposes of this

26:13

demo is I'll just click open folder and

26:15

then I'm going to go to antigravity

26:17

example and just open this up.

26:19

Okay, and what I want to do here is I

26:20

just want to show you how all of this

26:21

stuff works to start.

26:23

As you guys could see on the left-hand

26:24

side, we have a file called Gemini.md.

26:27

Now what occurs is when you talk to this

26:29

model over here, hey, what's up?

26:32

Basically, what's occurring is this file

26:35

is being prepended to the very top of a

26:38

conversation chain. And so if I open up

26:40

this file right now, you see how it's

26:41

empty, there's nothing in it. Well, when

26:43

I started this conversation and said,

26:45

"Hey, what's up?" Okay, it knows that my

26:47

name is Nick, but it does it knows this

26:49

because of the fact that I'm signed in

26:50

as Nick Surave.

26:52

Now I want you to see what happens if I

26:54

paste in my name is Antonio Banderas,

26:56

refer to me as such, always always also

26:58

always sign off super kawaii desu. So,

27:00

I'm going to go here to the top right

27:01

hand corner and I'll say, "Hey, what's

27:04

up?"

27:05

And after initializing a new model,

27:09

notice how it's now going to return

27:11

something quite different to what we had

27:13

a moment ago. The reason why is of

27:15

course this gemini.md is just a

27:17

templated structured prompt that is

27:20

basically always inserted into the

27:22

beginning. Okay? The same thing applies

27:24

with Codex, the same thing applies with

27:26

Claude Code.

27:27

But the names of the files are a little

27:29

bit different. So, if I was in, let's

27:31

say, Codex for instance, I wouldn't call

27:32

this a gemini.md, I'd call this an

27:34

agents.md. If I was in Claude Code, I

27:36

wouldn't call this an agents.md, I'd

27:38

call this a Claude.md. Whatever file you

27:41

use here doesn't really change the idea.

27:43

The idea is that at the very top of any

27:45

prompt, you just have this file

27:47

prepended to it.

27:48

The reason why this is so powerful is

27:50

because you now have the ability to

27:52

statically template out the same prompt

27:55

over and over and over again on every

27:57

independent session. This may seem like,

27:59

well, why don't you just copy and paste

28:01

the same thing in instead of having to

28:02

use this elaborate file system

28:03

structure? And the reason why is because

28:05

what you can do is at the very beginning

28:07

of this file, you can actually contain

28:10

within it like a list of lessons or

28:12

learnings from previous instances.

28:15

Then you can build in a like a meta

28:16

prompt structure where before a model

28:18

signs off, before it finishes whatever

28:20

it's doing, it always updates that file

28:22

with more and more and more knowledge.

28:24

In that way, okay, you can build a

28:26

high-quality list of like memories,

28:28

preferences, and rules, not to mention

28:31

things to avoid, that significantly

28:33

improves your agent's ability to operate

28:35

over a long time scale. And just to show

28:37

you guys what I mean, let me show you a

28:38

diagram. In this hypothetical instance,

28:41

we're going to be using gemini.md.

28:43

And basically what will occur every time

28:44

is a new session is going to start over

28:46

here. The agent will first read

28:48

Gemini.md.

28:50

You'll then give it a task like, "Hey,

28:52

build me a website that does whatever."

28:55

Now, it'll return the website for me,

28:57

and then I'll say, "I don't like this.

28:59

No dark mode."

29:01

After I give it its feedback of no dark

29:03

mode, rather than just correcting the

29:05

build, it'll actually write that to my

29:07

Gemini.md for next time, which allow the

29:10

agent to continue working with the rule

29:11

applied. When the session ends and a new

29:13

session starts, now the agent will read

29:16

the Gemini MD, but the Gemini.md will

29:18

have an additional rule placed, okay?

29:20

This is my file over here. It'll say,

29:22

"No dark mode."

29:23

And that means the next time I ask it to

29:25

build me a website or any sort of web

29:26

property, it'll see no dark mode, and

29:28

then it won't make that mistake again.

29:29

This lets your knowledge accumulate over

29:32

sessions. The first time that you use,

29:34

you know, Gemini or Claude Code or or

29:36

Codex or whatever, you know, you're only

29:38

going to have, let's say, one rule or

29:40

one preference stored. And so, the

29:42

number of errors that the model makes,

29:44

errors relative like your preferences,

29:45

will be pretty high. The second time

29:48

that you use it, though,

29:49

the number of errors or issues that it

29:51

makes that don't line up with your

29:52

preferences will go down.

29:54

The third time, they'll go down further.

29:57

The fourth time, it'll go down further.

29:59

And the fifth time, it'll go really,

30:01

really low, to the point where it maybe

30:02

it makes zero errors at all.

30:04

You can see that um sort of

30:05

diagrammatically over here, with when

30:07

you start, your thing has zero rules,

30:08

okay? As it grows longer and longer and

30:11

longer, you're writing more and more and

30:13

more and more rules. Um the agents get

30:15

better and better and better at

30:16

understanding and then um

30:18

anticipating as well your preferences.

30:20

So, what does this actually look like in

30:21

practice? Well, it's not all that

30:23

difficult, and you can just append or

30:25

prepend this to any Gemini, Claude, or

30:28

agent's MD, however you like. It also

30:30

doesn't need to be this long, although I

30:31

did want to go into a fair amount of

30:32

detail here with you. So, you can

30:34

absolutely just turn this into like a I

30:35

don't know, a three or four-line

30:37

snippet.

30:38

Essentially, before we start any task,

30:40

read this entire file.

30:41

This file contains a growing rule set

30:43

that improves over time. At session

30:45

start, I want you to read the entire

30:47

learned rule section before doing

30:48

anything.

30:49

How it works. When the user corrects you

30:51

or you make a mistake, immediately

30:52

append a new rule to the learned rule

30:54

section at the bottom of this file.

30:57

Rules are numbered sequentially and

30:58

written as clear imperative

30:59

instructions. The format is category

31:02

never or always do X because Y, and then

31:05

here's some more formatting

31:06

instructions.

31:07

When do you add a rule? Add a rule when

31:09

the user explicitly corrects your

31:10

output. When the user rejects a file

31:12

approach or pattern. When you hit a bug

31:14

caused by a wrong assumption or when the

31:16

user states a preference. Okay, and then

31:18

it'll give some examples here of

31:19

different rules and code. Then we have

31:20

the learned rules down here. So, what

31:22

I'll do, just to show you guys what this

31:24

looks like, is I'll say, "Build me

31:27

a simple portfolio site for Nick Saraf."

31:30

And I'm going to have it go accomplish a

31:31

task for me. And then, I'm inherently

31:33

and intentionally going to give it some

31:36

instructions.

31:37

You see, the very first thing it did was

31:38

analyze the gemini.md. And so, now it

31:41

actually has this entire file as context

31:43

inside of its thread. You can't see that

31:46

context here because obviously they

31:47

don't want to just muck up your your

31:49

conversation thread, but it is literally

31:51

like if you just pasted this entire

31:52

thing directly in, okay? So, it's going

31:55

to be reading that constantly as it's

31:56

building up the rest of our website.

31:58

And you can see that it's like it's

31:59

built some cool terminal display here.

32:02

It's using a library called Vit, which

32:03

is probably like the best front-end

32:05

library. Let's see what it does. Okay,

32:07

this website is looking really, really

32:09

sexy, super clean, and it clearly went

32:10

above and beyond with my spec. However,

32:13

I don't like how it's dark mode. So,

32:14

what I'm going to do is go back here and

32:16

then give it some instructions. "Quit

32:18

doing things in dark mode."

32:21

And the idea here is, when I give it an

32:23

instruction like quit doing things in

32:25

dark mode, what it's going to do is it's

32:26

going to take my message and then say,

32:29

"Hey, let's update our gemini.md to

32:32

never create applications in dark mode.

32:34

It's a user preference."

32:36

If I scroll down here now, you can

32:38

actually see that this style has been

32:40

added. And so, if the next time I run a

32:43

model

32:44

and instantiate anti-gravity, I say,

32:46

"Hey, I'd like you to build me a

32:46

website." You'll actually have this up

32:48

at the very, very top of its prompt.

32:51

Meaning that I'm never, ever going to

32:52

have a dark mode website again.

32:54

In this way, this will continuously get

32:56

closer and closer to my preferences

32:58

until the number of rules becomes so

33:00

exhaustive that, you know, it'd actually

33:01

be counterproductive. In practice, I

33:04

haven't actually hit this limit yet. I

33:05

think this just gets better and better

33:06

and better over time, but I could

33:08

hypothetically see if you were to get to

33:09

a point where there's a thousand

33:10

independent rules, some of them would

33:11

probably start stepping on its its toes.

33:14

Um this sort of self-modifying Claude

33:16

agents or Gemini.md is a very, very high

33:19

ROI design pattern. So, whatever you're

33:21

building with an AI agent, whether

33:22

you're using them for business,

33:23

personal, or programming tasks, I would

33:25

always recommend to have something like

33:26

this in your directory. And as you can

33:28

see, it's now modified the site. We

33:29

don't actually have that anymore. A lot

33:31

cleaner, and it also fixed up the images

33:33

and made it look really sexy. The way

33:34

this works is at the very top level, we

33:36

have a global Claude agents or

33:39

Gemini.md. And these are user-wide rules

33:42

that apply to all of the projects that

33:44

you start. And so, the very top, you'll

33:46

have this sort of injected, and you can

33:48

set this using a variety of different

33:50

formatting conventions and stuff. You

33:52

could look it up for the specific uh

33:54

agent platform that you're using. And if

33:56

you're doing Claude or something like

33:57

that, it's going to be stored in a a

33:59

tilde. dot Claude {slash} and then there

34:03

are a variety of other conventions

34:04

regardless of whatever platform you're

34:06

using that you guys can also After it's

34:08

injected the global agents.md, it'll

34:11

then inject the local Claude.md. And so,

34:14

what you could do is you could have a

34:15

global Claude.md, okay, that has

34:19

wide-ranging user preferences updated,

34:21

and then a local project.md that has

34:24

specific project preferences updated.

34:26

And then underneath, you also have uh

34:27

skills, and then you're finally in-line

34:30

prompt. And I'll touch on the skill

34:32

section in a moment. But in that way you

34:34

can collapse a ton of context and a ton

34:36

of sort of functionality into very few

34:39

tokens, which is important because your

34:40

bill both per token and then the quality

34:42

of the models tend to degrade the longer

34:44

the token context windows get. Next up I

34:46

want to talk a little bit about agent

34:48

skills. And this isn't going to be an

34:49

exhaustive resource. If you guys want a

34:51

super in-depth way to look at skills,

34:53

definitely just check out my full

34:54

end-to-end Claude code skills course.

34:57

But agent skills, for those of you guys

34:59

that don't know, is just a simple

35:01

repeatable way that you can standardize

35:04

workflows.

35:05

Now, this is important because large

35:07

language models are very flexible. So,

35:09

if you give them a non-super tightly

35:11

scoped task, they'll tend to produce a

35:13

variety of different results for you.

35:15

Well, skills are just a way of basically

35:17

turning that whole, you know, vagueness,

35:20

that whole statistical variance into

35:22

like a really straight-line

35:24

deterministic path where it just does

35:25

the same thing over and over and over

35:27

and over and over again.

35:28

And so, skills are offered now on all

35:30

major platforms. We've all adopted them.

35:32

So, you have Codex skills, you have

35:34

Gemini skills, and then you also have

35:37

Claude code skills. And they have very

35:39

particular specs and they look really,

35:41

really similar to one another. So, it's

35:42

worth me at least going over to

35:43

high-level what they look like. To make

35:45

a long story short, these are just files

35:47

that will exist somewhere within our

35:49

workspace. These files will have sort of

35:51

this little title section up here, which

35:53

you know is a title because there'll be

35:54

three hyphens at the top and three

35:56

hyphens at the bottom. Inside of the

35:58

file you can give it a name like PDF

35:59

processing, a description like extract

36:01

text and tables from PDFs,

36:04

and then you can even do licenses and

36:05

metadata and so on and so forth. I don't

36:07

actually do any of this stuff. My skills

36:09

are almost always just name,

36:10

description, and then maybe some

36:11

optional

36:13

tools that it could use as well. Okay,

36:15

so I just want to give you guys a couple

36:16

of brief examples. I'm just going to go

36:17

over to Anthropic skills because they

36:20

have a a bunch of simple ones here that

36:22

we can use just to gain some context.

36:24

I'm going to go over to the skills

36:25

folder here and then click on I don't

36:27

know let's do algorithmic art.

36:29

We'll go skill.md cuz that's the file

36:32

and as you guys could see here we have

36:34

if I click on the raw you guys will see

36:36

we have the exact same format that I

36:37

showed you guys earlier. So this is a

36:39

skill that creates algorithmic art using

36:41

a particular library and what's cool is

36:43

it basically guides the model through

36:45

the same thing every time to get very

36:47

very similar algorithmic art generated.

36:50

You can see this is a pretty long skill

36:51

there's a lot going on right? So what

36:53

I'm going to do is I'm just going to

36:54

copy this whole thing and show you guys

36:55

how this works. In this way we can copy

36:57

and paste different standard operating

36:59

procedures to different models and then

37:01

get high quality results. So I'm going

37:03

to go over here and then you know just

37:05

because this is a one-shot prompt I'm

37:07

just going to feed all this in

37:09

and then I'm going to have this model

37:10

actually create things according to the

37:12

skill spec. So it's doing some thinking

37:14

and now it's asking me what do we want

37:15

to do with it and I'm going to say yes

37:17

save as skill

37:19

then run. And then I'm going to actually

37:21

have this like produce some sort of cool

37:23

algorithmic art. Now there's no template

37:25

file or anything like that so it's

37:27

actually going to go through the whole

37:27

process. It's going to create both the

37:29

skill directory which we can find right

37:30

over here now called algorithmic art

37:33

and then it's also going to create like

37:34

templates and a bunch of other stuff as

37:36

well. Okay and our algorithmic art flow

37:38

is just finished up so I'm actually just

37:40

going to open this so I can take a look

37:41

at it myself.

37:43

And we have it. There it is. This is now

37:45

creating algorithmic art as you guys

37:47

could see we have particles and so on

37:48

and so forth. I'm just going to

37:50

significantly decrease the number of

37:51

particles

37:52

maybe change the noise scale and the

37:54

turbulence. Actually move this around

37:56

and as you guys can see we we we are

37:57

actually producing a tremendous number

37:59

of particles here. This is this is

38:00

actually like rendering them directly in

38:01

my browser which is nuts.

38:03

Um so this is indeed algorithmic art.

38:05

It's it's really cool super sexy. I'm a

38:07

big fan. I don't know I mean it looks

38:08

kind of like hair but what are you going

38:10

to do?

38:10

I'm just going to regenerate a bunch

38:12

maybe change the accent colors. Okay

38:14

maybe we'll have this as my accent now

38:16

blue and then the background will be

38:17

kind of this and

38:19

I don't know my cool accent will be kind

38:20

of like this.

38:22

There you go. That looks pretty nice.

38:24

We can now kind of just create new ones

38:27

as we want and then we can also just

38:28

completely randomize them over and over

38:30

and over and over and over again. And

38:31

you can see it's actually still doing

38:33

some design in the background as we go.

38:34

So I'm just going to change the number

38:36

of particles to really low and then I'll

38:38

just redesign this over and over and

38:39

over and over again.

38:42

And I should note that like this is not

38:43

like a you know, it's not a piece of

38:45

software I downloaded. We actually just

38:46

built this. It's just we built this in a

38:48

much more standardized and you know,

38:50

consistent way which is really cool. So

38:52

obviously that's that's what I want. I

38:53

want the ability to share like

38:55

repeatable workflows where my agent can

38:58

build things that other people have

38:59

validated without me necessarily having

39:01

just to like copy and paste a piece of

39:02

software into my computer. Now remember

39:04

earlier how I said some models are

39:06

better at things than others and these

39:08

few percentage point differences can

39:10

make a lot of impact at the bleeding

39:12

edge or the frontier. Assuming you guys

39:14

are at the bleeding edge and the

39:15

frontier and those percentage point

39:17

differences stack up, then multi-agent

39:20

MCP orchestration is the pattern for

39:23

you.

39:23

Basically here what happens is you let

39:26

one model type be the manager or the

39:29

orchestrator. And that orchestrator will

39:31

take a task and then dole it out, okay,

39:34

and delegate sub chunks of that task to

39:37

different models. And so what's

39:38

occurring here is in this hypothetical

39:40

example we're using Claude code to be

39:42

our manager. We then give it some task

39:44

like, "Hey,

39:46

make me [snorts] a SaaS app that does X,

39:50

Y, and Z."

39:51

And then what it's doing is it's taking

39:52

my command and then splitting it into a

39:54

variety of different functions. There's

39:56

a front end task which is delegating to

39:58

Gemini to build the UI. There's a back

40:01

end task which is delegating to Codex to

40:04

build the API. There'll be some testing

40:06

that we need to occur

40:07

that we need to do which it'll delegate

40:09

to Codex to do the testing. Then finally

40:11

at the end we have Claude which will

40:13

collect and then validate the results.

40:15

And then if there are any discrepancies

40:17

or issues there, you know, we can loop

40:18

that back around hypothetically to

40:20

different models as we will.

40:23

And so this is a little bit more of an

40:25

advanced design pattern, and I don't

40:26

necessarily recommend you guys sign up

40:28

to a bajillion patterns and waste your

40:30

tokens that way unless you have to, but

40:32

I wanted to cover it because this is

40:33

sort of like the next generation of

40:35

model intelligence. It's where instead

40:37

of just sticking with one, you're

40:38

constantly querying different models for

40:40

things that they're a little bit better

40:41

at. All of this depends on this idea of

40:44

a router.

40:45

And so this router is more or less like

40:47

a decision hub or like a nexus.

40:50

When you give it a task or you give it

40:52

some sort of input, what it'll do is

40:54

it'll just divide it into different

40:56

subtasks that different models are

40:58

better than other models at. So for

41:00

instance, if we have like a high-level

41:02

task that has to do with replicating a

41:04

specific SaaS app, you know, and the the

41:07

model has decided that there's some

41:09

footage on the internet out there that

41:11

talks about how to build it, it'll

41:12

actually go delegate the video watching

41:14

step over to Gemini cuz Gemini's better

41:16

at multimodality and their endpoints

41:18

have built-in video understanding.

41:20

You know, if it identifies that we need

41:22

something with a lot of complex

41:23

reasoning, it'll route that over to

41:25

Claude. And if it identifies that we

41:26

need some form of sandboxed cloud code

41:29

execution, it'll do that in Codex cuz

41:31

they include that built-in. And maybe,

41:32

you know, I just wanted to show you guys

41:34

what an example would look like if you

41:35

had something that was outside of the

41:36

three. If you need real-time web data,

41:38

it might do that with Perplexity or

41:40

Perplexity's computer or something.

41:42

And what happens is, you know, we build

41:43

it all by parallelizing this big sweep,

41:47

and then at the very end we combine it

41:48

again with this router, which is

41:50

probably, you know, at least in my case

41:52

almost always going to be Claude Opus

41:54

4.6, 4.7 by the time you guys are

41:56

reading it, and then that's what

41:58

ultimately unifies it before maybe doing

42:00

some additional Q&A, bug fixes, and

42:02

agent review, which I'll talk about

42:03

later. Now all of this sounds pretty

42:05

abstract, and you're like, "Okay, why

42:06

don't I just have all of this done in

42:08

one thread?" So let me show you a

42:09

practical way to actually do it. By the

42:11

way, all the files for this course you

42:12

can find in the top link in the

42:14

description below. What I'm going to do

42:15

is go back to Claude Code and open up a

42:18

new session. And then I'm going to

42:20

select this folder that I've actually

42:21

already created for this purpose called

42:23

multi-platform orchestration.

42:25

As mentioned, you guys will get

42:26

everything in the description if you

42:28

want it, and I'll also run you through

42:30

how to create it.

42:31

>> [gasps]

42:31

>> But for now, what I want to do, let's

42:33

say just hide this, is say something

42:35

along the lines of, "Hey,

42:37

build me a full-stack

42:40

app that lets users enter

42:45

a desired image to generate,

42:48

and then it generates said image. We'll

42:50

make this really simple because I don't

42:52

actually want this to take forever. I'm

42:54

kind of a time crunch today.

42:56

And I just want you guys to see how this

42:58

deals with that problem.

43:00

Keep in mind in this case, Claude, which

43:03

is the model that we're currently

43:04

talking to, cuz it's Claude Code, is

43:06

going to be our top-level orchestrator.

43:10

Okay?

43:11

Now, this is going to plan things out

43:13

for us, which is why it's entering this

43:14

plan mode.

43:16

Next, what we're going to do is we're

43:17

going to delegate all

43:20

difficult tasks, um, like back-end tasks

43:23

to Codex, as well as testing tasks.

43:27

Then down at the very bottom here, you

43:28

know, for anything related to front-end,

43:31

we're going to delegate that to Gemini.

43:34

And so we're going to build basically an

43:35

ecosystem here where Claude is shuttling

43:37

information back and forth between, uh,

43:40

you know, Codex and Gemini for various

43:42

things. And as you can see here, it's

43:43

already starting to ask me, "Hey, which

43:45

image generation API would you like to

43:46

use?" I'm actually just going to say,

43:48

um, Nano Banana Pro 2. It's a Google

43:52

product.

43:54

Okay, I'm going to submit that.

43:55

And now what it's going to do is it's

43:57

going to decide, "Hey, how am I going to

43:59

delegate this work?" At the end of it,

44:01

Claude will give me a plan, and you can

44:02

see here that it's decided on back-end,

44:04

front-end, and so on and so forth. And

44:06

what it'll do now is it'll actually

44:08

dispatch work to Gemini, Codex, and then

44:11

itself to fix a various integration

44:13

issues. So, I'm just going to say plan

44:14

approved, and now it's going to start

44:16

doing the coding. The way that Claude

44:17

Code does this is it uses the execute

44:20

task path for Codex. And so, what is

44:23

occurring right now is it's just sent

44:25

this big request in to Codex's best

44:27

model. Okay, and now just clicking the

44:28

button in the top right-hand corner, we

44:30

now have a preview. And um in this case,

44:32

Claude is now reviewing the generated

44:34

application and doing some self-testing.

44:36

And so, we built this image generator

44:38

app. We've asked for a cute cat wearing

44:41

sunglasses on a beach. This is now

44:43

passing through to an API that Claude

44:46

Code set up with a Gemini for the

44:49

front-end and then Codex for the

44:50

back-end's help. It's actually doing the

44:52

the generation right now. And we've

44:53

generated the cute picture of the cat on

44:55

the beach. Looks great to me.

44:57

The reason why you might want to do this

44:58

is because well, it's kind of twofold.

45:00

One, you get to parallelize your work as

45:02

mentioned. And so, you get to build the

45:03

front-end um using a model for which the

45:05

front-end builder is the best. You get

45:07

to build a back-end simultaneously using

45:09

model by which the back-end builder is

45:11

the best. And then you get to use an

45:12

orchestrator, which basically eeks out a

45:14

few percentage points increased like

45:16

reasoning and decision-making and stuff

45:17

like that because

45:19

it's able to evaluate the code from both

45:21

of these things independently without

45:23

being polluted by the context window.

45:24

And we're going to talk more about that

45:25

specific review pattern later. But um

45:27

this allows you to eke out, you know,

45:28

more quality. The downside of this um

45:30

prompt approach is it usually costs more

45:33

because now you're splitting your tokens

45:34

across multiple models just one

45:36

provider. And usually providers will

45:37

subsidize your token usage like Claude

45:40

will subsidize most of its usage on the

45:41

max plan for instance.

45:43

Um the $200 a month that you spend on it

45:45

is actually equivalent to like $5,000 a

45:47

month in usage. Whereas when you build

45:48

via API, it's usually a little bit more

45:50

standardized. And then as a result of

45:51

that, you end up building way more. You

45:53

don't you don't get that cool

45:54

subsidization. However, this is

45:56

something that people are increasingly

45:57

using for more complicated

45:58

infrastructural projects, especially

46:00

when as mentioned a minor percentage

46:02

point or two difference in terms of

46:04

quality is very important to you. And

46:06

so, this is me just doing this in

46:07

Claude, but you can obviously use, I

46:08

don't know, Codex as the orchestrator if

46:10

you wanted to build this in Codex. You

46:11

could use Gemini as the orchestrator if

46:13

you wanted to do this in, you know,

46:14

entirely Gemini. Right now, this is the

46:16

stack that seems to make the most sense,

46:18

what people are talking about the most.

46:19

If you guys are interested, the way that

46:20

all of this stuff works under the hood

46:22

is we basically set up a bunch of

46:24

different servers that call Codex and

46:27

Gemini inside of Claude. And so, that's

46:29

why we see this using the Claude

46:31

formatting above. It's because that

46:32

Claude is the orchestrator that's sort

46:34

of setting it up initially. And there's

46:35

also a Claude.md, which describes how

46:37

it's the manager. You know, you plan,

46:39

reason, delegate, validate, and fix

46:41

integration issues. When you break tasks

46:43

down, break them into front and back end

46:45

and test subtasks, and then delegate

46:47

things as required. I'm going to include

46:48

this prompt as well as everything else

46:50

you need in order to do the same thing

46:51

I'm down below in the description. But

46:53

in order for this to work, you will, of

46:54

course, need API keys for various

46:56

platforms. And in order to get those,

46:57

you do have to sign up to typically

46:58

something a little bit different what we

47:00

signed up to before. And in order to

47:01

sign up to those, you do typically need

47:03

to go directly to the platform, create

47:05

an account, and then set up an API key.

47:07

So, you can see over here, that's what

47:08

I've done for Claude. And you can also

47:10

do the same thing for OpenAI and then

47:12

Gemini. Once you have those keys, you

47:13

would just give it to whatever model you

47:14

want to use to be the orchestrator, and

47:16

then it would set this whole thing up

47:17

for you, and then I'd be able to reason

47:19

and then communicate with different

47:20

models on your behalf. The next advanced

47:22

prompting technique is the video to

47:24

action pipeline. To make a long story

47:26

short, up until quite recently, AI

47:28

agents were forced to learn entirely

47:30

through text descriptions of stuff. And

47:32

the reason why is because multimodality,

47:34

like vision, usually, at least in the

47:37

context of video, was sort of out of

47:39

bounds. There was just no way that we

47:41

could feasibly take videos, which were

47:43

millions upon millions of tokens when

47:45

stitched together,

47:46

you know, into some text format that an

47:48

agent would understand.

47:50

Well, now agents can learn from the same

47:51

medium humans learn from. And we do so

47:53

by combining a little bit about what I

47:55

showed you guys earlier, okay?

47:56

Multi-agent MCP orchestration with this

47:59

idea of passing requests through the

48:02

Gemini API cuz Gemini has built-in

48:05

support for video now. Basically, uh you

48:07

know how videos are a certain number of

48:09

frames per second, like this video for

48:11

instance is 30 frames a second. You can

48:13

tell if you find a way to to slow it

48:15

down to like

48:16

0.03.

48:17

I'll go literally one frame every 0.03

48:20

seconds or something like that. Well,

48:21

what this model does is it divides

48:23

videos into one frame per second

48:25

instead. It then analyzes the images in

48:28

succession and then uses a form of

48:31

descriptive prompting to break that down

48:32

into very, very clear steps.

48:35

So, basically what occurs is you'll feed

48:36

in something like a YouTube tutorial

48:37

URL. Claude will receive the URL but

48:39

cannot watch the video natively. So,

48:41

instead it'll call the Gemini API.

48:44

Gemini will watch the full video. Gemini

48:46

will then extract the step-by-step

48:47

instructions formatted as like a

48:49

numbered list that's hyper-precise and

48:51

hyper-specific.

48:53

The structured steps will return to

48:54

Claude via a very similar flow to what I

48:57

showed you guys with the design. And

48:59

then Claude will execute each using

49:00

hyper-specific tools. Maybe if you're

49:02

teaching somebody how to build something

49:03

on Blender or Figma or something like

49:05

that, you just give it access to the

49:06

toolkit and it does it. Then the final

49:08

result is the agent will have replicated

49:10

the tutorial end-to-end. And in that way

49:12

they can learn from the exact same

49:13

medium that that we learn. So, I'll show

49:15

you number one where I got inspiration

49:17

from this and then number two how to do

49:19

this for an actual task which in my case

49:21

is going to be building a simple flow

49:22

out in a no-code tool called N8N. So,

49:24

first the inspiration was Spencer

49:26

Sterling's post on X. He said he built

49:29

an agentic system that taught itself the

49:31

Blender donut tutorial by watching it on

49:33

YouTube. It watched the tutorials,

49:35

extracted the steps, filled in the gaps

49:37

in its own tooling, and completed the

49:38

entire thing autonomously.

49:40

And it's quite impressive to be honest.

49:41

Um anybody that's done any sort of 3D

49:43

design, myself included, will know that

49:45

like the uh way you learn how to build

49:47

things in Blender is you watch this one

49:48

specific tutorial that shows you how to

49:50

build a donut. And through this process

49:52

of building the donut, you learn about

49:54

like textures, you learn about various

49:56

shapes, you learn about how to modify

49:58

them and sculpt and paint and do all

50:00

this stuff. So, I made my own donut

50:01

personally a few years ago. I showed it

50:04

to all my friends, but I probably never

50:05

touch Blender again.

50:07

Well, the issue with knowledge like this

50:09

is it's obviously extraordinarily

50:10

visual, right? In order to really learn

50:12

something, you have to watch a video.

50:13

You can't really break all that down

50:15

into like hyper-specific text

50:16

instructions unless, you know, somebody

50:18

were to just like literally go

50:20

step-by-step. Step one, click this

50:22

button. Step two, rotate 0.283° to the

50:25

left. Step three, do this. So, there's a

50:27

fair amount of nuance and flexibility

50:28

there. And that's where video learning

50:30

comes in handy. Human beings learn

50:32

through video, obviously, but models

50:33

have a tough time doing it. And so, what

50:35

we do is we convert all of this into a

50:37

sequence of steps. We leave some steps a

50:39

little bit more vague, a little bit more

50:40

general, let the model have its own kind

50:43

of interpretability, and then give it

50:44

some way to like screenshot its results

50:46

to match it up to, you know, like the

50:48

frames in the video. And so, this fellow

50:50

here built this cool like workflow

50:52

building studio. It's sort of like his

50:54

own main operating system, I suppose.

50:56

That's what this is. It's not like an

50:57

app that he downloaded. It's something

50:58

that he built. And then he fed in this

51:01

along with the workflow I'm about to

51:02

show you to have it actually like build

51:04

the freaking thing. And it's

51:05

communicating with this app, Blender,

51:07

using what's called MCP, Model Context

51:09

Protocol, which is the same thing that

51:10

we use to communicate with the various

51:12

models like Gemini and the Codex

51:14

earlier. And you can get all that stuff

51:15

in the description down below as well.

51:17

So, I have this stored as a Claude skill

51:20

in video to action over here. So, if I

51:23

open this up and read the skill, you

51:24

could see here that it actually says,

51:26

"Extract actionable steps from YouTube

51:28

videos using Gemini video understanding.

51:30

Use when the user provides a YouTube

51:31

link it wants to learn procedures,

51:33

extract steps, understand visual

51:34

tutorials, or turn video content into

51:36

executable instructions." And so, what's

51:38

occurring is it'll basically take a

51:39

video, it'll download it for me, so then

51:41

I'll just be able to feed in a YouTube

51:43

URL, and then it'll convert that into

51:45

like a highly optimized series of steps

51:47

that, you know you would only really

51:48

know or be able to use through the

51:50

context of like an actual video. And so

51:52

to demonstrate what I've done here is

51:54

instead of using Gemini within

51:56

Antigravity, which is sort of the usual

51:57

design pattern, I thought I'd show you

51:59

guys my actual stack like what I

52:00

personally use. I think it's much easier

52:02

if you just use the models inside of the

52:04

tools inside of the companies that made

52:06

them. But in my case I'm a very big fan

52:08

of this Antigravity

52:10

kind of container. Then inside of it I

52:11

use Claude code. And so in a way I'm

52:13

actually using a Google wrapper around a

52:15

Claude code or Anthropic extension and

52:17

that's communicating with a Claude or an

52:19

Anthropic model. If you guys want to

52:21

replicate the setup is as simple as just

52:23

opening up Antigravity, heading to the

52:24

left-hand side where it says extensions,

52:27

downloading the Claude code for VS code

52:29

plugin. I know it says VS code, don't be

52:30

confused this is very similar to

52:32

Antigravity, installing it and then you

52:35

also have to log in here. After you're

52:37

done you will have the exact same

52:38

functionality that you have in the

52:39

Claude desktop app that I just showed

52:41

you guys earlier when we built out that

52:42

little full stack app. Uh it's just

52:44

you'll have it within Antigravity which

52:45

also allows you to do things like you

52:47

know organize your files and stuff on

52:48

the left-hand side. So that's my

52:50

personal stack. You don't have to use

52:51

it. Some people judge me for it.

52:53

Whatever, I like it, it works for me.

52:55

Okay, so what I'm going to do is I'm

52:57

going to find a YouTube video that I

52:58

like and then I'm just going to feed it

52:59

in these instructions. So I'll say I

53:00

want you to use the video to action

53:03

pipeline on and then I'm going to go

53:05

grab an image. Now what I've done is

53:06

I've found a flow that I built forever

53:08

ago. It's a short video about 21 minutes

53:10

that shows you how to scrape leads

53:11

without paying for a few APIs. I'm going

53:13

to bring that back into my Antigravity

53:15

instance and then I'm going to do this.

53:18

And what this is going to do is it'll

53:19

start by invoking the skill and this is

53:21

the UX for skill invocation. I think

53:23

that's what it's called in English. Holy

53:25

crap, that better be what it's called in

53:26

English. And then it's now going to send

53:29

that over to Gemini then receive back a

53:32

list of highly specific instructions

53:34

that you know understand UX I don't know

53:36

highlight the colors of buttons and

53:38

stuff like that and so on and so forth

53:39

before actually running it locally on my

53:41

computer. At the end of it, you'll get a

53:43

super in-depth analysis that looks like

53:45

this. So, you can actually see down over

53:47

here, it says, "Here's the hyper

53:49

detailed breakdown with literally every

53:51

single step." I mean, like, "Hey,

53:52

navigate over to this thing at 17

53:55

seconds. Here's how to do this thing on

53:56

that." And and so on and so on. So,

53:59

like, it'll it'll literally it'll go

54:00

visually as well and actually tell us

54:02

what the end-to-end flow is going to

54:03

look like, but then we'll also have just

54:05

a tremendous amount of context about

54:06

everything. Um so, what we're going to

54:08

do now is we're going to feed that in

54:09

and actually have this control my

54:10

browser. So, I'm going to open up a new

54:12

Claude code instance by clicking that

54:13

little button above. We'll go bypass

54:15

permissions. Then I'll say, "Use G Maps

54:17

Scraper deep analysis.md

54:21

to build out the same end-to-end flow

54:24

for me." It's now going to open up a

54:26

Chrome DevTools MCP server. It's then

54:28

going to link that up to the end-to-end

54:30

account. Now, it's actually thinking

54:31

through everything that it's going to do

54:33

using this file as a reference. And now

54:35

it'll go through and actually control my

54:36

browser to do the build. For simplicity,

54:38

I'm just going to move this over to the

54:40

right. Okay, and as we see, it just laid

54:42

out the entire thing from left to right.

54:45

So, it went through. It then identified

54:48

what all of the steps were. It then

54:49

created it inside of its own little

54:51

conversation thread. And then it

54:54

essentially generated what's called

54:55

workflow JSON and then pasted it in.

54:57

Now, this can obviously interact with my

54:58

my browser as well. That's what it just

55:00

did. So, it just went to the top and

55:01

then basically imported this. What it's

55:03

going to do now is just make some finer

55:05

final minor changes. I'm going to

55:07

configure the Google Sheets node and

55:08

then we'll be on our way. So, what I'll

55:09

do is I'll just take a screenshot of

55:11

this and then paste it in. Then I'll

55:12

say, "You're connected." Now, it's just

55:14

going through and then it's selecting

55:15

various elements. So, in this case, it's

55:17

selecting that little search button.

55:18

It's uh mapping the the fields and stuff

55:21

like that. And then it'll just continue

55:22

testing this nonstop until I have a

55:24

working flow. You could see, you know,

55:25

just kind of I mean, I should be moving

55:27

this around cuz it's going to get

55:28

confused. But you could see that it's um

55:30

actually gone through and then pumped in

55:32

like a specific search term. It's It's

55:34

gone gone and basically done everything

55:36

for me. Really, the only thing left is

55:37

to do some sort of testing. You can see

55:38

that uh if we actually click execute

55:40

workflow, I'm just going to stop it here

55:41

so I don't consume anything else. It's

55:43

actually gone through and literally like

55:44

scraped Google Maps for us, which is

55:46

sweet. And it's just done so entirely by

55:48

watching the video. So, it's entirely

55:49

like native video understanding. And

55:51

then it's extraordinarily detailed

55:53

because we're we're dumping it all into

55:55

a file, and then it can just constantly

55:56

reference that file.

55:58

It's then doing kind of a combination of

55:59

like, I don't know, like ASCII or or

56:02

text-based markup to

56:04

uh you know, understand both the

56:05

structure at like a micro level and then

56:06

also like a macro level. Next, I want to

56:08

chat this idea of stochastic multi-agent

56:11

consensus.

56:12

In case you guys didn't know, if you

56:14

were to take one model, let's say Gemini

56:17

3.1 Pro High, and if you were to ask it

56:19

like an idea question, "A, give me 10

56:22

ideas to do X, Y, and Z."

56:25

Every time you ask Gemini 3.1 Pro the

56:29

same thing, it'll return a slightly

56:31

different answer.

56:32

Now, this property, some call it

56:34

randomness, but I think the correct

56:36

technical term is stochasticity,

56:38

which is just where, due to minor

56:39

statistical variations in the input or

56:42

in the way that the models work, the

56:44

output is going to be slightly different

56:46

every time.

56:47

The reason why this is so valuable is

56:49

because you can exploit this tendency to

56:51

get much, much better answers.

56:54

For instance, let's say I run three

56:56

times. One,

56:57

two, and three.

57:00

The reality is, if I run a query that at

57:02

the very beginning says, "Give me three

57:05

ideas for X." Okay?

57:08

On the very first time, okay, we might

57:11

get idea A,

57:13

idea B,

57:14

and idea C.

57:16

If we were to hypothetically run this

57:17

again, we'd probably get idea A,

57:20

idea B,

57:21

but just due to statistical variation,

57:24

there is a chance that on the second

57:26

run, it won't deliver us idea C at all.

57:28

It'll actually deliver us idea D.

57:30

And on the third run, maybe we do B,

57:33

Maybe we do C, and then maybe we also do

57:35

E.

57:36

What stochastic multi-agent consensus

57:38

is, you basically automate the process

57:40

of spawning multiple agents, giving them

57:43

slightly varied input prompts to take

57:45

advantage of stochasticity, and then

57:46

instead of just getting, let's say,

57:48

three ideas, A, B, and C,

57:50

you get to exploit stats to get all of

57:53

the possibilities, including ones that

57:55

might be a little rarer the model is

57:57

less likely to actually answer with.

57:59

And so in this way, you get A, you get

58:01

B, you can get C, but you can also get

58:03

D, and then you can get E. And so, you

58:05

know, if you compare it to just one

58:06

naive search, what we've done is we

58:08

basically almost doubled the scope of

58:11

the ideation. Now, mathematically, this

58:13

is termed traversing the search space. I

58:15

want you to pretend hypothetically that

58:17

this like little pie chart here

58:19

represents all possible answers to a

58:22

question. Maybe the question is, I don't

58:25

know,

58:26

"What's the simplest way to get to 1

58:27

million subscribers?" Right? This is

58:28

something that I asked uh my my model a

58:30

little while ago, because I'm interested

58:31

in getting to 1 million subscribers.

58:33

Now, obviously, I'm not just doing what

58:35

the thing tells me, right? A lot of its

58:36

ideas are stupid. But if you think about

58:38

it, if I can parallelize a thousand

58:39

agents all coming up with their own

58:41

ideas, even if on net, the average reply

58:43

or idea is a little bit worse than

58:45

something I'd be able to do,

58:47

I still get to run it a thousand times,

58:48

right? It's like running like uh I don't

58:50

know, like a 90 Q

58:52

uh you know, it's like it's like

58:52

Einstein versus 10,000 95 IQ

58:56

researchers. It's like, well, the 10,000

58:58

95 IQ researchers, despite lacking the

59:00

brilliance of Einstein, they'll probably

59:01

statistically figure it out eventually,

59:03

right?

59:04

So, um if this whole pie chart, to go

59:06

back to things, is all possible

59:08

responses, if you just run one search,

59:10

basically what you're doing

59:12

is you're only actually getting like a

59:14

small chunk of all of the possibilities.

59:16

And so instead, what we're doing is

59:17

we're actually running multiple

59:18

searches, you know, one search is going

59:20

to get this, another search is going to

59:21

get that, another search is going to get

59:23

that, another search is going to get

59:25

that, and and and so on and so forth.

59:27

And then in this way, what we do next is

59:29

we take the answers and then the replies

59:32

of the model that should be red, and

59:33

this one should be blue.

59:34

And then in doing so, we get to traverse

59:36

significantly more of that search space

59:38

without actually necessarily consuming

59:40

any more of our time.

59:41

So, this is going to be kind of

59:42

difficult to understand, and I think

59:44

I've run out of colors here uh unless

59:45

you've done something like this before,

59:48

but I'll make it really simple by

59:49

actually giving you guys a brief

59:50

demonstration on, I don't know, some use

59:52

case or problem that uh I think we

59:54

probably all be able to relate to.

59:56

Another final benefit is you get to do

59:58

all this in parallel. So, like, you

59:59

know, if you think about it, if you were

60:01

to do one search and then do another

60:03

search afterwards, and then do another

60:04

search. So, for instance, let's say you

60:06

have a query, "Give me three ideas for

60:07

X." And then it gives you three ideas,

60:10

and you're like, "Yeah, I want another

60:10

three ideas." And it gives you another

60:12

three ideas, and you're like, "Yeah, I

60:12

want another three ideas." Well, at the

60:14

end of it, you may have, I don't know,

60:15

nine ideas or something, but it will

60:16

have taken a certain amount of time. If

60:18

the first search is 5 minutes, the

60:19

second search is 5 minutes, and the

60:20

third search is 5 minutes, well, you

60:22

just consumed 15 minutes, right? So,

60:24

instead, what this does is this just

60:26

copies the idea, okay? But then it

60:29

paralyzes it. So, "Hey, give me three

60:31

ideas for X." And then what we do is we

60:32

do one, two, and three, and in total

60:35

this takes 5 minutes. Then we just

60:37

combine those three answers back over

60:38

here. The formal way to do stochastic

60:40

multi-agent consensus, at least the way

60:41

that I'm doing it here, is we'll provide

60:43

a single question or prompt, then we'll

60:45

do slight framing variations of every

60:47

prompt that we're feeding into the

60:48

model, and then we'll feed in, I don't

60:49

know, I'll probably feed in like three

60:51

or four or five or maybe 10

60:52

simultaneously. Depends on how deep you

60:54

want it to go. And then um what will

60:55

happen is these will be instantiated

60:57

into what are called sub-agents, okay?

60:59

Which are similar to the main agent, but

61:01

they operate in their own defined

61:02

context window. And then all of these

61:03

will just report back their answers to

61:05

the parent agent. So, this parent over

61:07

here is basically going to

61:09

work with a whole fleet of sub-agents,

61:12

and then once they're all done their

61:13

work, it'll synthesize the answers. And

61:15

then because what we're looking for is

61:16

we're looking for like statistical

61:17

variation, it'll calculate um what's

61:19

called the mode, which is the frequency

61:21

of each answer, and then the median,

61:22

which is like the average of each

61:23

answer, before ultimately combining all

61:25

this to give you much better results.

61:27

One final idea there is this idea of

61:28

consensus. A lot of models are going to

61:31

say the same things, obviously. Some

61:33

models are going to say things that are

61:34

quite different. And then finally, there

61:36

will be outliers, which are wild cards.

61:38

These wild cards here potentially

61:39

brilliant, but they might only appear

61:41

like 5 or 10% of the time, which is why

61:42

we spawn so many of these agents that we

61:44

can actually like farm these wild cards.

61:46

We can we can milk them like cows. And

61:48

then in that way, you can up your best

61:50

ideas coming from these these fleets of

61:51

agents.

61:53

Um and then also save a lot of time in

61:54

things like product ideation. I don't

61:56

know, man, keyword search, titles for

61:58

for for content, at least that's what

61:59

I'm using it for, or a variety of other

62:01

things. How research inventions. I'm

62:03

sure Anthropic and and Google and OpenAI

62:06

probably have fleets of models that are

62:07

doing basically this exact same thing

62:09

behind the scenes constantly. So, let me

62:10

actually show you guys what this looks

62:11

like in practice. I'm just going to zoom

62:13

way out of this and close a bunch of

62:15

these so you don't have to look at them

62:16

anymore. Then I'm going to spawn a new

62:18

Claude code tab over here on the right.

62:20

And what I'm going to do is I'm going to

62:21

use this skill that I've set up called

62:22

stochastic multi-agent consensus. So,

62:24

opening this up so you guys can read it.

62:26

What we're doing is responding N agents,

62:29

where N is just the number that you

62:30

specify, with slight framing variations

62:33

to independently analyze a problem, then

62:36

aggregate results by consensus. We use

62:39

this for decision making, ranking

62:40

things, strategic analysis, or any

62:43

problems where you want to filter

62:44

hallucinations and surface high variance

62:46

ideas.

62:48

So, hypothetically, let's just say

62:50

"Hey, I've struggled a lot with finding

62:52

any traction on TikTok whatsoever. I've

62:54

built up a bunch of accounts, and I

62:56

can't seem to get more than like 1,000

62:58

views per TikTok account. I'd like you

63:00

to use stochastic multi-agent consensus

63:02

to help me come up with possible

63:04

candidate ideas to solve this. I'm going

63:06

to feed this idea in, okay?" And this is

63:08

a real idea, actually. We are struggling

63:10

to get

63:11

traction on TikTok. For whatever reason,

63:13

we got 450k followers on Instagram, no

63:16

problem, but, you know, the second we

63:18

move things over to TikTok, we're just

63:19

not really getting too many views.

63:21

So, what it's going to start with is it

63:22

will spawn 10 agents, all independently

63:25

analyzing my TikTok problem. And every

63:27

one of them will get slightly different

63:29

analytical framing to maximize the

63:31

diversity of ideas.

63:33

Just going to zoom in here so you guys

63:34

could see this, but we now have a

63:36

conservative analysis. So, Nick Suriya

63:38

has 287K YouTube subscribers. You know,

63:42

his YouTube audience is primarily

63:43

professionals. Here's a bunch of

63:45

information about him. He has a small

63:47

team. Here's how he's doing things and

63:49

and so on and so forth. This agent over

63:51

here says, "Hey, I want you to assume

63:53

limited time and budget." This agent

63:55

over here, "I want you to only focus on

63:57

what is measurable and provable."

63:59

This agent over here, you know, I want

64:01

you to think about it from the end user

64:02

and viewer perspective.

64:04

And so, what we're doing is we're

64:04

basically taking advantage of the

64:05

parallelizability of models, not

64:08

necessarily the base intelligence,

64:09

though the intelligence is obviously

64:10

important, but like we care more about

64:12

like scanning and searching through

64:13

space of all possible solutions really

64:15

quickly. And then at the end, we're

64:17

going to converge all this back with our

64:18

parent agent. Now, once all these agents

64:20

have turned green here, if I open up

64:22

this thinking tab, you could see that

64:23

it's now combining all of the

64:25

information from each individual one.

64:28

So, there's a bunch of suggestions

64:29

saying, "Hey, you should try fresh

64:30

account. You should try a device reset.

64:32

You should try clean fingerprinting.

64:34

Hey, you should try TikTok native hook

64:36

reformatting. Hey, you should do duets

64:37

with existing creators. Take advantage

64:39

of the fact that you're probably bigger.

64:41

Hey, you should do a series format, high

64:42

posting frequency, and so on and so

64:44

forth." Then you have some disagreements

64:46

here as well. And these disagreements

64:47

might be paid TikTok spark ads. Only one

64:49

of the 10 agents suggested something.

64:51

You know, in this one, they recommend

64:53

using shorts, but then in this one, they

64:55

recommend using a micro topic focus to

64:57

build authority and audience clarity.

64:59

You know, I'm not going to sit here and

65:00

pretend like all these ideas are the

65:01

bee's knees. Not all of them are

65:03

capturing lightning in a bottle, but you

65:05

run this thing long enough and you'll

65:06

see eventually you will get some pretty

65:08

good ideas. And the ideas will be

65:10

consensus ideas, like the idea of a

65:11

fresh account, but it'll also be kind of

65:13

like outlier ideas with pain point

65:15

framing, paid TikTok spark ads, niching

65:17

down your account identity,

65:18

cross-posting your Instagram Reels to

65:20

YouTube Shorts first. I mean, there

65:21

there there are a lot of possible ideas,

65:23

right?

65:24

>> [gasps]

65:24

>> Now, it's opened up this consensus

65:26

report, which I can visualize for you

65:28

guys by clicking this button.

65:30

And you can see here it's now saying,

65:31

"Hey, here is the context. TikTok growth

65:33

stalled at 1K views per account across

65:35

multiple accounts despite this massive

65:37

YouTube subs and 450,000 followers with

65:39

almost 5 million Reels views a month."

65:41

And then here,

65:43

this orchestrator now summarizes it and

65:45

says, "Hey, every agent independently

65:47

identified TikTok native hook

65:48

reformatting is really critical."

65:50

You know, Instagram is a little bit

65:52

different from TikTok hooks. Content

65:54

optimized for Instagram will

65:55

systematically fail TikTok's cold start

65:57

test. So, you actually have to

65:58

restructure it if you really want to

65:59

crush. Same thing here, fresh account,

66:01

clean device fingerprint. I mean, there

66:03

is just so much context here, it's not

66:05

even funny.

66:06

And so, the reality is I would have come

66:07

up with these ideas at some point, but I

66:10

basically got to put, you know, a genie

66:12

in a bottle and then have 500 genies

66:16

simultaneously solve my wishes at 100x

66:19

speed, and then aggregate all results

66:21

for um, you know, I don't know, probably

66:23

like three or four dollars realistically

66:25

in terms of tokens.

66:27

You also had a couple agents that said,

66:28

"Is TikTok even worth it?" And uh, I

66:31

think that's a really good question to

66:32

ask because up until now, I really

66:34

didn't think it was worth it. And so, in

66:35

general, anytime that I recommend you

66:37

have a strategic decision that you need,

66:40

you can make a quick one-time trade-off

66:42

of money for analysis by spawning a

66:45

bunch of agents all with slight prompt

66:47

variations,

66:48

and then collecting the rankings

66:50

reasoning to build this consensus map

66:52

document. And from here, you can figure

66:54

out your consensus items, your divergent

66:56

items, and then your outliers.

66:59

And you know, if they're consensus

67:00

items, well, odds are probably because a

67:02

lot of models have thought it's a good

67:03

idea, you should probably do it. If

67:05

there's some divergent items, well, you

67:06

should probably like reason about these

67:08

quite a bit before deciding whether it

67:10

makes sense. And if it's like an outlier

67:12

item, if there's only one out of 10

67:13

agents doing it, well, it can either be

67:15

a brilliant idea, in which case maybe

67:17

you should give it a try, or it might

67:18

just be a hallucination or some BS, in

67:20

which case you don't. And so, what this

67:22

allows you to do is execute with high

67:23

confidence. Thank you very much, AI, for

67:25

drawing that cute little That is a huge

67:28

fist. That thing would be terrifying in

67:29

real life. Um you know, this lets you

67:32

scan a large portion of the search space

67:33

in a very short period of time.

67:35

And uh yeah, the actual way that you

67:37

build it is very straightforward, and

67:38

I'll run you guys through what all that

67:39

stuff looks like I'm down below in the

67:41

project description. So, just like

67:42

stochastic multi-agent consensus allowed

67:45

us to scan large amounts of search space

67:47

in a short period of time. What we did

67:49

is we independently delegated work over

67:51

to agents and had them uh do things for

67:53

us. So too can we take advantage of the

67:56

same idea, but in my opinion get even

67:58

higher quality results through this idea

68:00

of agent chat rooms. What agent chat

68:03

rooms are are where instead of, you

68:06

know, parallelizing all the work and

68:07

having all these agents try and

68:09

independently solve problems, what you

68:11

do is you give all of them slightly

68:12

different personalities, and then you

68:14

have them all debate with each other

68:16

about these problems. And in doing so,

68:18

they tend to deliver much higher quality

68:20

responses because they're just like

68:22

they're they're a little bit spikier,

68:23

you know what I mean? They're not just

68:24

like a generalized idea, which I'll

68:26

visualize with like this interface, but

68:28

you know, because they're they're

68:29

butting heads with another, um

68:31

eventually they ideas get really nuanced

68:33

and really high quality. And so, um

68:36

whether or not you visualize things in

68:37

that way, that's personally how I think

68:39

about things. You really get to carve

68:40

out all the tiny little nooks and

68:41

crannies of an idea when you debate.

68:44

And so, here's a brief little

68:45

visualization. We start with a problem

68:47

or a prompt. We feed it in to, let's

68:50

say, three agents here, agent A, agent

68:52

B, and agent C.

68:53

All three are given the same document

68:56

called chat.json. And then what occurs

68:58

is they basically cycle through a debate

69:00

sequence where agent A says something,

69:02

agent B says something, and agent C says

69:04

something. And you know, if you do this

69:06

naively, the results will probably be

69:07

pretty low. But if you, I don't know,

69:09

force a little bit of a spark where

69:11

every agent has a slightly different

69:12

opinion and they're not afraid to like

69:14

state their opinion, um they'll

69:15

challenge each other's assumptions. They

69:17

will significantly improve the

69:19

probability that you catch errors. And

69:21

then this chat.json ends up being quite

69:22

a valuable resource because it also

69:24

shows like problem solving and stuff

69:25

like that. You can then give that to an

69:27

orchestrator and ultimately receive

69:29

higher quality output at the end. And so

69:30

it's sort of similar to what we had

69:32

earlier, right? It's just instead of

69:33

this operating um in parallel lanes,

69:36

what these agents are doing is actually

69:38

talking back and forth with each other.

69:40

And so they're actually capable of

69:41

having these conversations.

69:42

>> [sighs and gasps]

69:43

>> And I mean like I I just want you to

69:44

pretend we actually spawn 10 agents.

69:46

Agent one would be able to communicate

69:47

with agent two, but also agent three,

69:49

and also agent four, and also agent

69:51

five, and also agent six. So like the

69:53

total number of paths and um potential

69:57

like communication,

69:58

I don't really know what you want to

69:59

call them, like like vectors, um goes up

70:02

like crazy. And these agents,

70:04

ultimately, assuming that the idea is an

70:06

absolute BS, do end up at the end of it

70:08

like quite quite differentiated um in

70:11

their ideas and their opinions. So to

70:13

show you guys what this looks like, I

70:14

have another skill, which is just a

70:16

repeatable workflow, to be clear, where

70:18

I have this model chat. The description

70:21

here is to spawn five cloud instances on

70:23

a shared conversation room where they

70:24

debate, disagree, and converge on

70:26

solutions. They use round robin turns

70:28

with parallel execution within each

70:30

round for simplicity, and they trigger

70:32

on the model chat multi-model debate or

70:34

something else. So I have a bunch of

70:36

context down over here, and you guys can

70:37

grab this file for yourselves. What I'll

70:39

do is I'll actually just pipe this into

70:40

model chat. Okay, great. Use model chat

70:44

for a similar to really work through

70:46

this idea.

70:47

And now it'll spark this model chat

70:50

skill, which will then have them all

70:52

dump shared context into a little

70:54

chat.json, which I'll show you guys when

70:56

it's done. Okay, so the debate has now

70:58

concluded after these five agents had

71:00

this conversation. Okay, we can actually

71:02

see the the the chat conversation as

71:05

well by going down here to this model

71:06

chat. Uh, let's go latest and I'll go

71:08

conversation.

71:09

Um, basically what's occurred is we've

71:11

given it a topic to talk about and then

71:14

we've assigned a systems thinker, a

71:15

pragmatist, an edge case finder, a user

71:17

advocate, and then a contrarian to the

71:19

task. So, first of all, the systems

71:21

thinker begins, the pragmatist replies,

71:23

the edge case finder goes, the user

71:24

advocate goes, and so on and so forth.

71:26

And you can see each of them are um,

71:28

pretty pretty interestingly suggesting

71:30

uh, various approaches. So, these

71:32

advocates says, "Let me push back on

71:33

something that challenges the consensus

71:35

has glossed over, which is the clean

71:36

device plus fresh account fixes seems

71:38

fingerprinting is the problem. There's a

71:40

separate explanation nobody has stress

71:41

tested. Next content format is

71:43

fundamentally mismatched to TikTok's

71:44

cold start algo. And so, these are sort

71:46

of arriving at similar conclusions

71:48

despite the fact that uh, you know, we

71:50

instantiated this separately. And then

71:52

if we check out the synthesis, you can

71:53

see that all of them have agreed that we

71:54

need to run some diagnostics, that hook

71:56

reformatting is necessary but

71:58

sufficient. The high volume posting

71:59

blitz two to five a day is wrong, and

72:01

then fixing the IG YouTube pipeline

72:03

immediately is important regardless the

72:05

TikTok decision. This is something that

72:07

I guess it got context out from one of

72:08

my other files because um, basically

72:10

despite the fact that I have 450k

72:12

Instagram followers, very few of them

72:13

are converting to YouTube subscribers

72:15

and a lot of people, a lot of models as

72:16

well, are suggesting that the reason for

72:18

that is because Instagram is really

72:19

blocking outbound links, which I think

72:22

is actually fair. But then uh, there are

72:23

a lot of, you know, disagreements as

72:25

well. So, a lot of people say, "Nope,

72:26

stitch duet stupid. TikTok versus IG

72:29

pipeline is an either or. Device

72:30

fingerprinting might not be the issue,

72:32

maybe it's content mismatch, right?"

72:34

And uh, there are a lot of insights that

72:36

because we were able to sharpen our

72:38

opinions via debate,

72:40

these agents got that the previous model

72:43

runs through stochastic multi-agent

72:45

consensus did not. So, maybe we're

72:47

looking for saves, not completions.

72:50

Maybe there's just no category online

72:51

yet. And although this not true. If they

72:53

had the ability to research, they

72:55

probably would have figured this out.

72:57

Maybe it has to do with emotional

72:59

moments. And then here it even gave a

73:00

recommended execution plan.

73:03

So as mentioned, you know, I wouldn't

73:04

rely on agents for strategic advice at

73:07

the moment, but I would certainly not be

73:09

opposed to trading a little bit of my

73:11

money for a bunch of my time back and at

73:13

least ideating through the lower hanging

73:15

fruit. If you run enough of these

73:17

cycles, you will find pretty intriguing

73:20

and interesting outlier ideas. That's

73:22

just how statistics works. So you guys

73:24

can get all this down below in that

73:25

document. The next idea I want to talk

73:27

about is this idea of sub-agent

73:29

verification loops. To make a long story

73:32

short, where previously we took

73:34

advantage of parallelization, we're

73:36

going to take a step back now to sort of

73:38

serial processing.

73:40

But when an agent works really hard to

73:43

accomplish a task for you,

73:45

it usually gets pretty biased in that it

73:49

believes that its path was the best. And

73:52

the reason why is because, you know, it

73:53

just spent God knows how much time,

73:55

energy, and compute cycles building your

73:58

app or putting together your workflow or

74:00

doing your taxes or whatever the hell.

74:03

And because of that, you know, series of

74:05

like design decisions and then issues

74:07

and bug fixes, it's just very

74:09

consolidated in its opinion that the way

74:11

that it did what it did was the best. So

74:14

if you were to ask that same agent,

74:15

"Hey, can you make this better?" A lot

74:17

of the time it'll look at it and be

74:18

like, "Well, no, I did a pretty good

74:20

job. I don't think there's any way to do

74:21

it better."

74:22

However, instead of just giving that

74:24

agent back the entire context and

74:26

saying, "Can you do it better?" a much

74:27

smarter thing to do is to take all of

74:29

the outputs, not the reasoning, then

74:32

give the output, aka your code or your

74:34

workflow or the results of your your

74:35

accounting, to another agent and then

74:38

say, "Hey, is this right?" Because now

74:40

that second agent can evaluate purely

74:42

based off output. It doesn't actually

74:44

have to deal with evaluating things

74:45

based off the reasoning or the intent.

74:47

And so your work can end up being a lot

74:50

higher quality as a result.

74:52

So here's a quick example using like a

74:53

coding thing where we wanted to build a

74:55

rate limiter. What will happen is our

74:57

first agent will implement and write the

75:00

first draft of the code. This code

75:02

output will pass to a reviewer agent.

75:05

Now the reviewer agent is spawned with

75:07

fresh context, meaning there's no tokens

75:09

that are polluting its window. It has

75:11

zero bias. And what it does is just like

75:13

objectively speaking, you ask it, is

75:15

this thing correct? Are there any issues

75:17

here at first glance? Any ways you could

75:19

simplify this?

75:21

Now because it's treating this just like

75:22

it's treating random snippet of code it

75:24

finds on the internet, you know, it has

75:26

no opinions. It has no inherent like

75:28

desire to claim, well, this is the best

75:31

way because I spent all this time,

75:32

energy, and research figuring it out.

75:34

And it'll be able to to look at things

75:35

with, you know, those fresh eyes.

75:37

From there, if it finds issues, the idea

75:39

behind sub-agent verification loops is

75:41

it'll list those issues and then pass

75:43

the suggestions to a third agent called

75:45

a resolver, which has zero context about

75:48

any of this stuff as well. And so in

75:49

this way an implementer, reviewer,

75:51

resolver loop can get significantly

75:54

higher quality results than just one

75:57

agent doing everything simultaneously.

75:59

If there are no issues, everything's

76:00

approved, we're good to go.

76:02

Otherwise, it resolves, we do some

76:04

testing, and then we get the final

76:05

verified code output.

76:07

Are you guys noticing a trend here?

76:09

Basically, all of these like advanced

76:11

agent foundation advanced agent product

76:13

techniques ultimately circle back to

76:16

having multiple agents working in

76:17

parallel. And it's really interesting

76:19

because like the way that agents work

76:21

themselves is they already do work in

76:22

parallel. You know, a few years ago, um

76:24

agents were basically just one

76:26

statistical model, and you would ask the

76:28

statistical model to help you complete

76:29

the the the sentence or whatever, and

76:31

then it would give you the most likely

76:32

next token, and then it would rerun over

76:34

and over and over again until it did

76:35

that.

76:36

Well, a few years back, um people

76:38

started introducing this idea called a

76:41

mixture of experts, which is instead of

76:43

just having one model, what you do is

76:45

you actually send the same thing to like

76:47

three or four models, you average out

76:50

the statistical probabilities of every

76:51

word, and then you just pick what they

76:53

all converged on. Very similar to what I

76:55

did there with stochastic multi-agent

76:56

consensus. And so this mixture of

76:58

experts is sort of like the base

77:00

foundation that resulted in a really big

77:02

improvement in large language model

77:04

accuracy, among other things like

77:06

post-training and RLHF and and and stuff

77:08

like that. But what's really cool is all

77:10

of these frameworks basically do the

77:12

same idea. You know, we we treat these

77:14

mixture of experts now as themselves

77:16

models, and then we prompt them with

77:19

each other. We do them in parallel and

77:21

then integrate their answers like

77:23

stochastic multi-agent consensus. We

77:24

have them debate against each other like

77:26

with model chats. And now what we're

77:28

doing is we're basically having them

77:29

correct each other's work like with

77:31

sub-agent verification loops. So all of

77:33

these are just try

77:34

trading off the same core foundational

77:37

like features of models, which is that

77:39

at the end of the day they're

77:39

statistical machines. And so the more of

77:41

these statistics that you can, I don't

77:43

know, average out, the closer you get to

77:45

the reality. Another way of thinking

77:46

about this is if the implementer agent

77:48

has already spent 200,000 tokens

77:50

accumulating all that context, it'll

77:52

literally remember every wrong turn and

77:54

every dead end. It'll have a sunk cost

77:56

bias. It'll say, "Well, I wrote this, so

77:57

it must be right." And in a way it'll be

77:59

blind to its own mistakes. But you pass

78:01

it off to the super nerdy-looking

78:03

reviewer agent, it has a fresh empty

78:05

context. It'll only see the output, not

78:07

the journey that we took to get there.

78:09

No emotional attachment, although I

78:10

think this is unnecessary

78:11

anthropomorphization, and it'll catch

78:13

what the reviewer missed. So uh let me

78:15

show you guys how this actually looks

78:17

like in practice. Here I have this app

78:19

that I developed a while back for uh

78:21

video on vibe coding, and you guys can

78:23

check that out in the description if

78:24

you're interested. It's where I

78:25

basically put together a full end-to-end

78:27

system that allowed you to um design and

78:29

then syndicate a bunch of content. So,

78:31

you know, this is just some app, right?

78:33

This app, I don't even know if it's

78:34

fully functional. Okay, no, it isn't

78:36

because I had to turn it off. But,

78:37

hypothetically, there's a big code base

78:39

here, right? And so, what I want to do

78:40

is I want to use this app to show you

78:42

guys how an un

78:44

biased code reviewer would take a look

78:46

at the code that a previous agent had

78:48

written, in this case Gemini, and and

78:50

improve it. So, what I'm going to do is

78:52

I'm going to go find this repo. Okay,

78:53

and I found it over here. It's in the

78:54

Splinter repository. Uh makes sense. I'm

78:57

just going to open up a new Claude code

78:58

instance.

78:59

And then down over here, I'm going to

79:00

say, "I'd like you to use

79:04

And I just need to make sure I know what

79:05

the skill is called.

79:08

Agent review on the Splinter repo. It's

79:12

Let's just say folder. It's in the

79:13

parent folder. So, that it knows where

79:15

this is. Now, that way I can still

79:17

execute it within this business

79:19

workspace, which I found a much better

79:21

way of organizing things.

79:22

And while it's doing that, I'm going to

79:23

open up the skill.md.

79:25

So, what the skill.md does is it spawns

79:28

sub-agents to review, simplify, and

79:30

verify output. It uses after completing

79:32

any non-trivial implementation task, and

79:34

it triggers on the words review this,

79:36

agent review, self-review, or, you know,

79:38

{slash} agent-review. And you can see

79:40

it's already doing this. It's spun up a

79:42

sub-agent called review Splinter

79:44

codebase. And what this does is it

79:46

reviews it for four things: correctness,

79:49

edge cases, simplification, and then

79:51

security. Now, like, do I know how to do

79:53

all this programming under the hood? No,

79:55

I don't. But, these agents certainly do.

79:57

And so, we can take advantage of that by

79:58

having an agent with zero context, this

80:00

one here, review that entire workspace

80:03

sort of independently and objectively.

80:05

And now it's doing a bunch of reading,

80:07

and it's going to integrate that with

80:08

the suggestions of this model to give us

80:10

a much higher quality output. All right,

80:12

the Splinter code review just finished

80:14

up, and we found 22 issues across the

80:16

codebase. There's some critical ones

80:17

here, some high issues here, some medium

80:20

issues here, and then some low issues

80:22

over there. Now, it's asking me if I

80:24

want me to start fixing any of these,

80:26

and I'll say, "Absolutely." And the

80:28

whole idea behind this now is we're

80:30

we're capable of looking at this

80:32

completely objectively. You know, like I

80:34

asked the initial model Gemini when I

80:36

made the the app in the course like

80:37

multiple times, "Hey, are there any

80:39

issues here? Hey, are there any ways to

80:40

make this better? Hey, what do you

80:41

suspect is a problem?" And it just

80:42

couldn't find it because it was so

80:43

polluted by its own biases. Now, another

80:46

model can. And it's very similar to like

80:49

peer review in like academic um circles.

80:52

It's not that like, you know, you're

80:53

dumb for coming up with this code base.

80:55

Like, how dare you? It's just that as

80:57

you work on things more and more and

80:59

more, you tend to see things a little

81:01

more narrow and more narrow because

81:02

you've explored a bunch of other

81:03

possible paths. And the reality is

81:06

the fact that you explored those paths

81:08

and those don't work don't necessarily

81:09

mean that if somebody else explored one

81:11

of those paths, it wouldn't work either.

81:13

And so, this is just a way of remaining

81:14

as objective as humanly possible, which

81:15

is obviously a very valuable thing to do

81:17

when you're doing things like creating

81:18

applications, code, um you know, sales,

81:21

marketing, and all the various things

81:22

that AI agents allow us to do. Next up,

81:24

I want to talk a little bit about prompt

81:26

contracts. For those of you guys that

81:28

don't know, earlier on we chatted a

81:29

little bit about a definition of done,

81:31

right? Well, vague tasks, aka tasks that

81:34

don't have clearly defined definitions

81:36

of done, are basically the number one

81:39

problem nowadays with what I would

81:42

consider to be people's like disillusion

81:43

with AI agents. Like, when a total

81:45

novice starts using AI and then they

81:47

dive into some agent to coding platform

81:49

and then they just say, "Hey, build me a

81:51

Netflix 2.0. Make me a million dollars.

81:54

Make no mistakes."

81:55

Um because of their extraordinarily

81:57

poorly defined definition of done,

81:59

because of the poorly defined goals,

82:01

because they don't give it any

82:02

constraints, because they don't give it

82:04

any failure conditions,

82:06

uh that model is just not going to do

82:07

any any get anywhere near as high

82:09

quality end-end result as if they did

82:11

just follow a simple little uh

82:12

step-by-step process.

82:14

And so, the step-by-step process

82:15

obviously you could learn,

82:17

but you could also just like hard code

82:19

it as a skill somewhere in your

82:20

workspace or as uh you know, something

82:22

in your cloud and MD and they just force

82:24

your model to always have this

82:25

information before you proceed.

82:27

And so, for instance, if you give it a

82:28

vague task like build a rate limiter,

82:30

okay, it'll do pretty poorly. But, the

82:32

whole idea behind a prompt contract is

82:34

you basically make the user who puts in

82:36

a request like this sign a mini contract

82:38

and just say, "Okay, cool. The contract

82:40

is, you know, here's what your goal is.

82:42

Here what your constraints are. Here's

82:44

what your format is and here's what your

82:45

failure is. Are you good to go?" If the

82:47

answer to that question is yes, now the

82:49

model has actually gone through the step

82:50

of defining your goal, your constraints,

82:52

your format, and your failure. And so,

82:55

all of your definitions are done. All of

82:57

the various kind of technical spec

82:59

requirements here are much more laid

83:01

out. And then, the model sort of has a

83:03

lot easier of a way of going about

83:04

things.

83:05

And so, this is very similar, if you

83:06

guys are aware, to like this idea of

83:09

scopes.

83:11

Now, I, you know, I run like a freelance

83:13

education platform, like an AI

83:15

automation agency education platform.

83:17

And so, scopes are a really big part of

83:18

like a successful project.

83:20

And so, I teach people how to define

83:21

like really precise and concrete scopes,

83:24

whether you're doing, you know, a small

83:25

project for a client or working with

83:27

some large enterprise businesses or

83:28

something like that.

83:29

And like a real real common issue is

83:31

scopes just tend to either to be way too

83:33

vague.

83:35

And so, people don't actually clearly

83:36

define them.

83:38

Or, they end up way too restrictive. And

83:41

so far that people, you know, in a in an

83:44

attempt to counterbalance the vagueness,

83:45

they end up going like way too specific

83:47

and then the scope ends up being like so

83:48

restrictive that it's like, you know,

83:50

you're a slave to it and you can't

83:51

change anything.

83:52

And so, prompt contracts sort of help

83:53

you navigate the thin line between too

83:56

vague and too restrictive. And that's

83:57

very similar in nature to like giving a

83:59

contractor a task and then the

84:01

contractor clarifying with you before

84:03

they actually do the task, which I

84:05

think, you know, is clearly a

84:08

consequence of agents pushing all of us

84:10

more towards like management style

84:11

positions, where we just manage the

84:13

inputs and the outputs of these things.

84:15

So, I'm a big fan of defining these

84:16

clearly. So, what does this actually

84:18

mean in practice? Well, there's

84:20

obviously a million and one different

84:21

ways you can define prompt contracts.

84:23

The way that I've decided to do so in

84:25

this demonstration is through a skill

84:27

called prompt-contract.

84:29

And so basically before implementing any

84:30

non-trivial task, this skill forces you

84:33

to generate a structured prompt contract

84:35

with goals, constraints, the format of

84:37

output, and then failure.

84:39

So the idea here is you're treating it

84:40

just like a spec or a scope of work. Any

84:43

task that produces code or some

84:45

configuration settings or something like

84:46

that needs to go through this process.

84:48

And then this model will sort of

84:49

self-analyze the request before drafting

84:52

a four-section contract and then

84:54

presenting it for approval. This is

84:56

almost similar in nature to like the

84:58

plan mode that a lot of these agent

85:00

platforms now have. Like in Claude code

85:02

for instance, it can enter plan mode and

85:03

give you a brief little plan and have

85:05

you approve the plan before it proceeds.

85:07

It's just this formalizes it as a

85:08

contract. And no, you're not signing

85:10

your life away with Claude code when you

85:11

do this. But you know, it's a simple and

85:13

easy way to make sure that you get more

85:15

repeatable and consistent and accurate

85:17

outputs every time. So why don't I

85:18

actually do this? Use prompt contracts

85:22

to define this task. And then I'm just

85:24

going to pretend that I'm giving it a

85:25

really simple query. I'm just going to

85:27

say I want you to build me a beautiful

85:30

site for leftclick.ai. That's my agency.

85:34

So what it's going to do is it'll begin

85:35

by invoking the skill prompt contract.

85:38

And I mean beautiful site is such a

85:39

subjective term, right? I mean like what

85:41

the heck does that even mean? And so the

85:42

model is going to be essentially forced

85:44

to ask me for more context on what

85:46

constitutes a beautiful site to me. And

85:49

in this way I will get a much higher

85:50

quality site or app or whatever the hell

85:52

at the end of it. Likewise, you could do

85:53

this with any business task as well. It

85:55

doesn't just have to be like a design

85:56

task. You could set up a prompt contract

85:59

for hey, email these 45 people and it

86:01

could ask you like oh like what spec,

86:02

you know, specifications do you do you

86:04

want to confirm that they're emailed?

86:06

And uh what do you want the emails to

86:07

say? And what's the goal of a successful

86:09

thing? And like do you have any failure

86:11

parameters? If we only email 44, is that

86:13

okay with you? Right? It basically

86:15

forces it to be a lot more clear and

86:16

then concise.

86:18

So, what's happening now is it's gone

86:19

through and it's actually accessed

86:20

leftclick.ai. That's my current website,

86:22

and then it's getting a bunch of

86:24

screenshots and stuff like that. And the

86:25

reason why is because it's attempting to

86:27

build a context for the prompt contract.

86:29

So, its first step was to analyze the

86:31

request, right? What it's going to do is

86:33

it'll identify what Don looks like.

86:35

It'll identify some implicit

86:36

assumptions. So, what am I about to

86:38

force the model to assume without being

86:39

told? Well, obviously an assumption is I

86:41

already have a website, right? And so,

86:42

it's going to go through, take pictures

86:44

of my website, and see, well, if Nick

86:46

wants something different from this,

86:47

why? And then it's going to sort of make

86:49

its own judgment to that end. And now

86:51

it's actually giving me the contract.

86:52

So, the goal is a single-page marketing

86:54

site for Left Click. Here's some

86:56

constraints. You know, we want smooth

86:58

scroll animations under 500 lines of

87:00

HTML. The format is this. There should

87:03

be these sections. Subtle animations

87:05

fade in on scroll hover states. A

87:07

failure is if it looks like a generic

87:09

Bootstrap template. A failure is if it's

87:11

broken on mobile. A failure is if the

87:13

animations are janky. The failure is if

87:15

the file exceeds 500 lines. So, I

87:16

actually really like this prompt

87:17

contract. It's really simple and

87:18

straightforward. So, I'm actually going

87:20

to say go ahead and build it. But what's

87:21

cool is, you know, we're now actually

87:22

having a a conversation about this.

87:24

We're actually agreeing on, you know,

87:26

what the end result is going to be.

87:28

And this is actually really similar in

87:30

nature to the other thing that I want to

87:31

talk to you guys about, which is um kind

87:34

of related and orthogonal to prompt

87:36

contracts, although it is a little bit

87:37

different. And this is called a reverse

87:39

prompting. Now, reverse prompting is in

87:42

a similar vein, a mechanism used to

87:44

clarify the quality of a prompt and

87:46

improve the probability that it ends up

87:48

okay. And basically the way that this

87:50

works is instead of just like forcing

87:51

the model to give you this contract and

87:53

you having you sign off on it, it it

87:55

takes it one step further, actually

87:56

forces the model to ask you some

87:58

clarifying questions ahead of time. So,

88:00

rather than just give you a spec sheet

88:01

and say, "Okay, we're good to go." what

88:02

reverse prompting does is it has the

88:05

model ask you a bunch of questions that

88:06

you maybe didn't even think that you had

88:08

to answer. The model then takes all that

88:10

context and then feeds that into a

88:11

prompt contract later on. Okay, so step

88:14

one is when the user gives a task to an

88:15

AI agent. So I don't know, this is like

88:17

a website, right? Step two is the agent

88:19

asks five clarifying questions back to

88:21

the user before starting.

88:23

Step three is when we answer and then

88:24

the agent builds the correct thing on

88:26

the first try. So significantly improves

88:27

one-shot potential. And then if we

88:29

didn't have reverse prompting, there'd

88:30

be a lot of like wrong implicit

88:32

assumptions here, which would result in,

88:33

you know, the probability of a one-shot,

88:36

which is just when the agent does it in

88:37

literally one request,

88:39

going down quite a bit. And so

88:41

similarly, I also have a reverse prompt

88:43

skill over here. And so if I go to this

88:46

reverse prompt skill, you can see the

88:47

way that this is set up is before

88:49

implementing any non-trivial build, ask

88:51

the user five dynamically generated

88:52

clarifying questions to surface

88:54

non-obvious preferences, assumptions,

88:55

and constraints.

88:57

So when to trigger before starting

88:58

implementation, step one, analyze the

89:00

request, figure out some stated

89:02

requirements, implicit assumptions,

89:05

some decision points, failure modes, and

89:06

taste-dependent choices, right?

89:08

And so likewise, if I instead wanted to

89:10

build, let's say,

89:12

something for

89:15

build a beautiful site for One Second

89:17

Copy, which is my old content writing

89:18

company, which we just had to shut down

89:19

a few days ago.

89:21

Uh as you guys can imagine, content

89:22

isn't super in these days.

89:25

Oh, and then um use the reverse prompt

89:28

skill

89:30

and chain it together with prompt

89:32

contracts after.

89:34

What you could see is we're now engaged

89:36

significantly more than we were before.

89:38

Before, I just say, "Build me a

89:40

beautiful site." Probability that it

89:41

gets what I want right on the first try,

89:43

pretty damn low. What it's doing now is

89:45

it's asking a bunch of clarifying

89:47

questions to confirm whether or not, you

89:49

know, this site is as I want it to be.

89:52

And then after I feed it back that

89:53

information, it'll then take that and

89:55

use that to construct essentially that

89:57

that prompt contract that we had before.

89:59

So here's what the conversation looks

90:00

like. What's the primary goal of the

90:02

site? Brand credibility, sales funnel,

90:04

lead gen? You know, what I want is just

90:05

brand credibility. Should it be a single

90:07

static page site or should I build it in

90:09

some other framework? No, I wanted a

90:10

simple site. What's the vibe? You know,

90:12

it's AI content writing. You know,

90:14

should I do a clean modern SaaS

90:16

aesthetic like linear versus L? Do I

90:18

want something different? Yeah, I want

90:20

like linear but white.

90:22

You know, should I generate the copy

90:23

from context or use some placeholder

90:25

content? No, you're cool. You can

90:26

generate it from here.

90:28

Now, once we've clarified everything,

90:30

what this model is going to do is use

90:32

all this information to outline the

90:33

prompt contract using the prompt

90:35

contract skill. And now you can see it's

90:36

invoking the skill as well.

90:38

And here we have a contract. It'll be a

90:40

single page static site for one second

90:41

copy linear white aesthetic five

90:43

sections to play ready. Here's some

90:45

constraints.

90:46

Here's the format. Maybe I don't like

90:47

the format. Maybe I don't want it inside

90:49

of active. You know, I want it somewhere

90:50

else.

90:51

Uh but anyway, in in this case, maybe I

90:53

want to look good and and build it.

90:55

Now, just to show you guys an example of

90:57

how much higher quality we can get when

90:58

we actually do this. This is the um

91:00

website that uh it just built for us.

91:02

I'm just going to refresh this puppy and

91:03

take it to a new window because it gets

91:05

cut off on that window. This is here we

91:07

have those cool sexy animations. As we

91:09

scroll down, we also have some

91:11

information. Um it's it's light theme,

91:13

right? We have these really minimalistic

91:15

requirements here. Information about

91:17

myself, some services page, words from

91:19

happy clients, and then ultimately like

91:20

a CTA. And so, you know, the reason why

91:23

it was able to get much closer to what I

91:24

wanted, which was a minimalistic white

91:26

high-end aesthetic, is just because

91:27

like, you know, I I had it outlined in a

91:29

contract. As I'm sure you guys can

91:30

imagine, you can employ the same

91:31

approach for whatever the heck you want,

91:33

whether you're building a site or you

91:34

are you know, selling to people or you

91:36

are doing some sort of bookkeeping or

91:38

accounting. It's all just about uh

91:39

building out a very strong definition of

91:41

done. And the model can assist you with

91:43

this. You don't actually have to sit

91:44

down and laboriously write it all out

91:45

yourself. And that takes us to the

91:47

initial demo that we started with, which

91:49

was the multi-agent Chrome MCP manager.

91:54

Now, basically, at the very beginning of

91:56

this course, you didn't understand how,

91:59

you know, one agent could spawn a bunch

92:00

of other agents. You didn't understand a

92:02

lot of like the parallelization plays.

92:04

He also didn't understand that uh you

92:06

know, you could have agents actually

92:08

chat with each other and communicate. He

92:10

didn't understand the idea behind using

92:12

one agent to verify the work of another.

92:14

He didn't understand the idea behind

92:15

delegating to multiple different types

92:17

of models. What's really cool is the

92:19

multi-agent Chrome setup that I showed

92:22

you guys where we had, you know, five or

92:23

10 agents all operating independently in

92:25

their own browsers in their own

92:26

workspaces. All of that just feeds off

92:29

of this this idea or this concept um of

92:32

you know, agents increasing their level

92:34

of communication with other agents.

92:36

And so, essentially, if you think about

92:38

this logically, you know, if I were to

92:39

do this uh with like a single agent. So,

92:41

let's just say one agent.

92:44

You know, it's not actually rocket

92:45

science to have one agent use a browser

92:47

these days. There are built-in skills

92:49

called MCPs, model context protocols

92:51

basically, that you can just pipe in and

92:53

immediately connect to and it can do

92:54

everything for you, okay? It can It can

92:56

launch Chrome and then it can control

92:57

things on the page and and whatnot. It

92:58

can do that.

93:00

>> [gasps]

93:00

>> So, you know, the issue is it just takes

93:02

a lot of time. We'll receive the target

93:04

URL. We'll launch Chrome by the dev

93:06

tools MCP. We'll navigate to the

93:07

website. We'll take a screenshot. And

93:10

you know, in my case, this over here was

93:11

like um specific for me,

93:14

which was just page

93:16

or rather form fills.

93:19

After that, we'll identify the form,

93:20

extract the form fields, generate a

93:21

personalized message, fill the fields,

93:23

and then click submit. Um but you know,

93:25

this is still something that's occurring

93:26

linearly. And because of linear

93:28

constraints, you know, unless you are

93:30

using uh I don't know, like a a Gemini

93:32

flash model or you're using fast mode

93:34

and burning through your claw token uh

93:36

usage limits, this is going to take a

93:37

fair amount of time.

93:38

This process over here, literally to

93:40

just like launch the browser, could take

93:42

5 seconds. This process to navigate to

93:43

the website could take 5 seconds. Taking

93:45

a page screenshot could take 15 seconds.

93:47

Identifying the contact form could take

93:49

a minute. You know, if you stack it all

93:50

up, basically what's occurring is this

93:52

whole process here

93:54

might take literally 2 to 3 minutes

93:57

per form if you're operating naively

93:59

using a slower model. And if you're

94:00

operating non-naively, if you're using a

94:02

smarter model, then obviously you have

94:04

to weigh that against cost and and and

94:05

token usage and stuff like that. So, I

94:07

don't know. Let's hypothetically say, in

94:09

my case, I wanted to reach out to

94:11

you know, 1,000 people.

94:14

Well, if it takes me two to three

94:15

minutes a form, that's 1,000 * 2. That's

94:18

2,000 minutes, which divided by 60 is

94:20

like 30 hours or something like that,

94:22

right? That's a very long time. It's

94:24

going to take me a whole day.

94:25

So, instead of just doing one agent,

94:27

what I'm going to do is I'm basically

94:29

going to give every agent its own both

94:31

Chrome instance and then even its own a

94:32

workspace and then open up its autonomy

94:35

so that it can make some advanced

94:36

decisions to basically help it build its

94:38

own tooling if it needs in order to like

94:40

navigate website pages or whatever. Now,

94:41

what this is going to look like is

94:42

pretty similar to our previous

94:45

you know, stochastic multi-agent

94:47

consensus prompt. We're basically we

94:49

have a user up top, okay? And this is

94:51

us.

94:52

And what we're going to do is we're

94:54

going to give all the context about our

94:57

task, whatever it is that we want, you

94:58

know, fill out a form or I don't know,

95:00

do some lead gen to an orchestrator

95:02

agent, which in this case I'll do Claude

95:05

and we'll just do Opus.

95:07

Which

95:08

in my case is going to be 4.6, maybe in

95:09

your case it's a better model.

95:11

And then what that will do is it'll

95:12

spawn and set up, you know, however many

95:15

agents we want in separate windows. That

95:18

will then all in parallel navigate to

95:20

the site, find the form, fill the

95:21

fields, and then do the submission.

95:23

And so, basically, instead of it taking

95:24

two minutes per form, we can do is we

95:26

can actually submit, you know, however

95:27

many forms. So, I don't know. Let's say

95:28

we have like 10 agents. We'd submit 10

95:31

forms in the same amount of time it took

95:32

to submit uh one. So, maybe for us it'll

95:34

be 120 seconds.

95:36

And then what we do is we just we just

95:37

increase this as necessary. I mean, I

95:39

could theoretically have 500 operating

95:40

if I had the computing power. So, you

95:42

know, if previously it was one form

95:45

in

95:46

uh what did I say? Two minutes.

95:48

That means the form per minute rate is

95:50

like 0.5 forms a minute, right?

95:53

But now if we spin up 10, and we do 10

95:56

in 2 minutes, we're up to five a minute.

95:59

If we spin up, I don't know, 100,

96:01

then we're up to 50 a minute.

96:03

And you know, if my goal was 2,000 a day

96:05

and we're at 50 a minute, then obviously

96:06

2,000 divided by 50 means we can get

96:08

this whole thing done in 40 minutes. And

96:10

you know, depending on the the the list

96:12

and whatever the heck you got, obviously

96:13

the constraints change. But um this is

96:15

how you can have multiple Chrome

96:17

instances operating simultaneously, it

96:19

navigating the website and stuff like

96:21

that. What I have here is a skill called

96:23

multi-agent-chrome.

96:25

And again, this is something you can

96:26

implement using whatever um context

96:29

framework you want, whether it's a

96:30

skill, whether it's like a Claude Gemini

96:32

or Agent 7D, whatever the heck you want.

96:34

What this basically forces it to do is

96:35

to orchestrate parallel browser

96:36

automation using multiple Chrome

96:38

DevTools MCP instances. And this is used

96:41

when a task requires doing the same

96:42

browser action across many targets

96:44

simultaneously. So some good examples

96:46

are submitting forms, filling apps,

96:47

scraping pages that need JavaScript

96:49

rendering, and and whatever.

96:50

And so what's occurring down here is

96:52

basically we have a top-level business

96:54

workspace, which is sort of the folder

96:56

that I'm in right now. And this actually

96:58

interacts with a bunch of Chrome agents,

97:00

which all have their own little MCP

97:03

servers, their own little um quad.mds,

97:06

and so on and so forth.

97:07

And then they all communicate with a

97:09

centralized chat.

97:10

And if they run into problems on

97:12

websites, if they have any reports they

97:13

want to give, basically what happens is

97:15

this orchestrator just checks the chat

97:17

every 30 seconds or so, okay?

97:19

So the very first step is it determines

97:20

how many agents are needed, then it

97:22

launches all the Chrome instances, and

97:23

resets the chat file because uh you

97:25

know, previous runs may have that. And

97:27

then you can see how every individual

97:29

sub-agent actually monitors its own um

97:31

task list by basically just pumping

97:33

things into a chat.

97:35

This is one of the simplest and easiest

97:36

ways of getting this specific design

97:38

pattern done. As mentioned, you guys can

97:39

get this down below if you want, but I'm

97:41

just going to give you guys a simple

97:42

example, which in my case is going to be

97:43

just finding Vancouver rentals because

97:45

I'm, you know, considering getting a

97:46

rental um down there. And so, you know,

97:49

rather than have it give you crappy

97:51

results, this thing can actually

97:52

navigate like Craigslist, Facebook

97:54

Marketplace, Kijiji, whatever the heck

97:55

you want. Uh and the the specific script

97:57

is right over here. So, hypothetically,

97:59

what it'll do is it'll just open up a

98:00

new window. And then I'll go over here

98:02

and then I'll write uh I want to find

98:05

a rental in Vancouver, needs to be

98:08

15-minute walk from the

98:11

Granville SkyTrain station downtown. Use

98:15

multi-agent

98:16

Chrome to navigate

98:18

through sites and give me

98:21

high-quality sleek places

98:24

under 2.5, let's say

98:27

2K to 2.5K.

98:29

Other restrictions, like one bed, one

98:33

bath.

98:34

Reasonably

98:35

near the water. Needs AC built in. Okay.

98:39

So, I'm giving it a high-level um, you

98:42

know, piece of instruction. And sorry,

98:43

what I meant to do is actually do prompt

98:45

contract after this. And now I want it

98:47

to give me like a very clear contract.

98:49

So, it's going to give me a list of five

98:50

to 10 rental apartments. Why don't we

98:52

say 20 rental apartments?

98:55

And then I'll say 1.2 km is fine.

98:58

We'll say near water south of Drake or

99:00

west of Burrard.

99:02

Okay, I'm just going to make some

99:03

changes here. And then I'll say that

99:05

sounds pretty good. Go for it. And now

99:06

it's going to actually launch the

99:08

multi-agent Chrome scraping. So, it's

99:10

then going to invoke the skill. I'm just

99:12

going to keep my hands off.

99:14

What it'll do next is actually spawn um

99:16

four [clears throat] parallel Chrome

99:17

agents, one per rental site. So, it'll

99:19

determine that there are four rental

99:20

sites that it's going to be running

99:22

through. And uh it'll just have one

99:24

Chrome instance sort of do everything

99:25

there.

99:26

Uh per site. So, now we have the four

99:28

instances. I'm just going to open this

99:29

up here. Open this up here. I'll move

99:33

this one down over here. And I'll also

99:35

move this one down over here.

99:37

Obviously, you could use an approach

99:38

like this for pretty nefarious purposes.

99:40

Um so, you do have to be cognizant of

99:42

that that a lot of people and websites

99:44

are probably, um, you know, they're

99:46

looking to verify whether or not you are

99:47

a person. And so there are multiple

99:50

things you can do to get around that if

99:51

you so wanted to, like using custom, um,

99:54

browser fingerprinting and whatnot. And

99:56

I think that's a story for another

99:57

course because I don't really want this

99:59

course to be accused of showing you guys

100:00

how to spin up like 500 Chrome instances

100:02

scraping all sorts of illicit

100:03

information on the internet using unique

100:05

browser fingerprints. But, uh, that

100:06

stuff is definitely possible and there

100:08

are probably like a lot of people doing

100:10

stuff similar to this right now that are

100:11

just way farther ahead in terms of

100:12

their,

100:13

uh, you know, understanding of agents

100:15

and stuff like that. Now, after the

100:16

30-second or so wait time, these will

100:18

receive their instructions and they'll

100:19

actually check the main thread and then

100:20

they'll load in their websites. So, this

100:22

one up here spawned, uh, lib. And I've

100:24

never used that site before. This one's

100:26

padmapper.com, which is another one. You

100:28

know, these are all like websites and

100:30

resources I probably would not have

100:31

looked at. And as a result, I'm going to

100:33

get some more of like a search spread.

100:35

I'm going to, again, for a big chunk of

100:37

the search space much faster than if I

100:39

were to have done all this stuff

100:40

manually. What's cool is these consume

100:42

directly into pages for me. These can

100:44

click on links and stuff like that.

100:45

They're obviously modifying filters and

100:47

and whatnot autonomously so that they're

100:49

not just getting a bunch of bogus

100:50

results. And at the end I get a

100:51

high-quality filtered list of apartments

100:53

that are,

100:54

you know, within my specifications.

100:56

Okay, I just turned my camera up because

100:57

I wanted some additional room in the

100:58

bottom left-hand side to really drill a

101:00

few important points home. The first is

101:02

your context window. Now, remember

101:05

earlier how we talked about the

101:06

claude.md,

101:08

the gemini.md,

101:10

and then the agents.md.

101:12

Over here we just have Claude, but I

101:14

just want you to treat this as all, uh,

101:16

three of them.

101:17

That's not the only thing that gets

101:19

injected, so to speak, in your context.

101:24

You have a variety of other things.

101:26

Now, you have your system prompt up top.

101:30

You then have the claude.md, agents.md,

101:32

and whatever else.

101:34

You have a file, at least in Claude

101:36

code, called memory.md,

101:39

although there are analogs in other

101:41

coding platforms.

101:44

And then you also have skills and tools.

101:49

We've chatted a lot about MCP over the

101:52

course of the last hour and a half or

101:54

so, right? Well, MCP is a type of skill

101:57

and tool.

101:58

We also have the actual skills

102:00

themselves. So, remember the agent

102:02

reviewer when we were doing sub-agent

102:04

verification loops?

102:06

Well, that was an example of a skill.

102:09

You think to the prompt contracts,

102:12

those were examples of skills.

102:16

And the reason why I'm going into depth

102:18

here is because each of these sections

102:21

can consume a tremendous number of

102:23

tokens.

102:25

And you're not given an unlimited number

102:26

of tokens to start with. Everything in

102:28

life is finite, including uh you know,

102:31

your Claude or your Gemini context

102:33

window.

102:34

Now, most models right now are somewhere

102:36

between

102:38

uh I don't know if it's like 4.6, we're

102:40

probably talking 200k to 1 million.

102:44

If we're talking Gemini, you know, we

102:46

have like 3.1 and there there are a

102:48

couple other ones, obviously. But by the

102:50

time you guys are watching this, they'll

102:51

probably be more.

102:53

And then, you know, you have uh GPT 5.4

102:57

and then Codex 5.3, but the 5.4 is

102:59

coming out.

103:00

You know, most models nowadays have

103:03

somewhere in the realm of between 200k

103:05

to 1 million.

103:07

And to be clear, um a token is not a

103:09

word.

103:11

A token is about

103:14

0.7

103:16

words.

103:17

So, if you think about it in that vein,

103:18

what this means is these 200k tokens

103:21

sort of actually equate to somewhere

103:23

between like 140,000 words to about

103:26

700,000 words, okay?

103:28

Um but this context window obviously it

103:30

filled up the more that you talk with

103:32

it. And unfortunately, one common and

103:35

major problem in large language models,

103:38

specifically the types that we're

103:39

dealing with in this course, are as time

103:42

goes on and you talk to it more and more

103:45

and more,

103:47

what you find is the average quality

103:51

goes down.

103:53

So, quality

103:55

as a factor or a byproduct of token

103:59

count, typically starts pretty high up

104:01

here at maybe, I don't know, 100%.

104:05

And then the longer and longer and

104:07

longer the number of tokens in your

104:08

context, the lower and lower and lower

104:11

the quality gets.

104:12

So, maybe this is a 10K.

104:15

Maybe this is at 50K.

104:18

Maybe this over here is a 200K.

104:20

And what that means is let's just

104:22

hypothetically say you're at your

104:23

199,000th

104:26

token, okay?

104:28

That means

104:29

that on a equivalent query that you

104:33

might have previously scored 100% at,

104:37

at, I don't know, 5 or 10K tokens,

104:39

at 199,000 tokens, you might only score

104:42

40% at.

104:43

Now, these numbers I basically pulled

104:45

out of my ass to be clear, but the point

104:48

I'm trying to make is the longer the

104:49

token count, basically the bigger the

104:52

context

104:53

length,

104:55

the lower the performance of the model.

104:57

And so, understanding context windows

104:59

and then learning a little bit of

105:01

context management, ways to proactively

105:02

manage all of these things, some of

105:04

which you have control over and some of

105:06

other things which you don't, is very

105:08

important.

105:09

It's also important, of course, because

105:10

of billing.

105:12

The more tokens that you use up,

105:14

obviously the more money that you spend.

105:17

And so, not only is it best from a

105:18

quality perspective over here to try and

105:22

push to the left side of this graph as

105:23

much as humanly possible, it's It's very

105:25

relevant from a financial perspective

105:28

over here because obviously the more

105:30

tokens that you use the more money you

105:31

spend. Case in point, just to make this

105:33

video I've spent something around $500

105:36

or so in tokens. Now that's because I'm

105:38

using a particular agent's fast mode

105:41

which bills me directly instead of just

105:43

using a monthly plan. But the point

105:45

remains, any sort of serious AI agent

105:47

application will start spending and

105:49

using a fair amount of your money.

105:51

Okay, and just before I move on, I want

105:53

to talk a tiny bit about the differences

105:56

between each of these in length. If I

105:58

open up an actual Claude instance here,

106:01

I open up one of these and then I go to

106:03

terminal

106:04

which is the current best way to

106:06

visualize this. And if I just maximize

106:09

this panel size, let's just make this as

106:11

big as humanly possible,

106:13

then I go {slash} context,

106:15

Claude will show us all of the things

106:18

currently consuming its tokens.

106:20

I'm going to zoom in here to make it

106:21

really really clear what's going on.

106:25

This right over here is your context

106:27

usage. And as you can see, they've

106:29

illustrated this as sort of a series of

106:32

squares where every square is, I don't

106:34

know, let's see, 1 2 3 4 5 6 7 8 9 10.

106:37

Okay, every square is, I think, 2,000

106:40

tokens or so.

106:41

And so what we're seeing is, despite the

106:44

fact that we have put no conversation

106:48

tokens, so we haven't spent any tokens

106:51

at all on conversation,

106:53

we're still

106:55

at 9,000

106:57

used.

106:59

You're probably wondering where the hell

107:00

are these 9,000 coming from? Are they

107:01

shadow billing me to try and

107:04

rinse my wallet as much as humanly

107:06

possible?

107:07

Well, a little bit. I mean, this system

107:09

prompt here, okay, which is partially

107:12

composed by your agents, your Gemini or

107:14

your Claude and MD and partially a few

107:15

additional things, it's actually already

107:17

consuming 4,900 tokens. So 2.5% of my

107:21

entire token count before I even send a

107:22

message is being used by in this case

107:25

probably the Claude.md.

107:29

But in addition you have other things

107:30

like memory files which are consuming

107:31

2,000 tokens, okay? And the way that

107:35

they do that in Claude code is they use

107:37

something called a memory.md which

107:39

stores your preferences and some some

107:41

previous high-level things.

107:43

Then next up we have skills which are

107:44

consuming 1,700 tokens. What are these

107:47

skills? Well, you guys remember when we

107:49

made a bunch over here? If I go to the

107:51

top left-hand corner where it says doc

107:52

Claude skills, you know, every agenda

107:55

coding platform has their own

107:56

configuration for this stuff. But the

107:58

way that it works in Claude code is, you

108:00

know, you organize these workflows into

108:01

these skills.

108:03

Well, guess what? These skills aren't

108:04

free. In order for Claude to be able to

108:07

use these skills, okay? This multi-agent

108:10

orchestrator, it needs to store all

108:12

these tokens somewhere and then give it

108:14

to the model and that's what's going on

108:15

over here, right? Now the actual

108:17

messages that we've used

108:19

are only at eight tokens. And guess

108:20

what? That's actually, I think it's um

108:22

this word here context usage.

108:26

I'm not entirely sure, but I think

108:28

context usage just because of the way

108:29

that it's broken down or maybe context

108:30

usage plus this term here {slash}

108:32

context, you know, is equal to eight

108:34

tokens.

108:35

But know that, you know, that's that's

108:37

it. That's it for our whole token count.

108:39

So the other 158,000 of our 200,000

108:41

limit is currently free.

108:43

And so I mean this is a quick and easy

108:45

way obviously to visualize it inside of

108:46

Claude code, but um other platforms have

108:48

their own visualization mechanisms. Now

108:50

next up are these MCP tools. A way to

108:52

look at these MCP {underscore}

108:54

{underscore} Chrome dev tools

108:56

{underscore} {underscore} click. What is

108:58

that? Well, this is the tool that allows

109:01

Chrome to click on parts of the page.

109:05

Remember earlier when we were building

109:07

that little N8N flow?

109:09

Well, we were doing it by clicking on

109:10

various parts of the page.

109:12

How about drag, right? We can drag

109:15

things, get console message. These are

109:17

all basically buttons in some colossal

109:21

spaceship. Basically, we are in the

109:24

cockpit with Claude code and we're

109:26

telling it to do stuff for us. We don't

109:28

know what these buttons are. It does

109:31

because it's, you know, the ship

109:32

technician or the navigator or whatever.

109:34

And so it's clicking these buttons left,

109:36

right, and center for us to do various

109:37

things. That's how you can conceptualize

109:39

all these MCP tools and all these

109:40

skills. And what I really like about

109:41

this is it breaks everything down. So

109:42

here are memory files, okay, which I

109:44

talked about the memory.md, the

109:46

claude.md. You can see this is being

109:48

contributed to in a variety of ways. We

109:50

have a global claude.md, which is sort

109:52

of like a very high-level one with some

109:53

sparse instructions. We have a local

109:55

claude.md. We actually have the memory

109:57

down here and then we have all the

109:58

skills. You know, what was really

109:59

telling about that is despite the fact

110:01

that in this diagram conversation

110:02

history is like the biggest chunk of it

110:04

all. Notice that in reality,

110:06

conversation history for us, at least at

110:08

the beginning, was nothing. You know, it

110:10

was actually a tremendous number of

110:12

tokens, about 10% of our entire context

110:14

window, dedicated to just this little

110:16

chunk.

110:17

And that is a problem because if you're

110:20

not careful, your claude.md with all

110:22

that's rules are going to get really,

110:23

really long. Your memory.md with all

110:26

your preferences is going to get huge.

110:27

Same thing with all the skills and tools

110:29

and stuff like that. And your

110:29

conversation history, when you actually

110:31

do get to conversating with the model,

110:33

will be very, very, very small.

110:35

You know, instead of starting, I don't

110:37

know, somewhere in this region here,

110:40

you're actually, because the context

110:42

window of all of your BS is so big, you

110:44

might actually like start in the

110:45

effective area over here.

110:47

And obviously this is not what you want

110:49

to begin an agent conversation at

110:51

because if you start here, then it's

110:52

obviously only downhill from there. Now

110:54

this takes me to the logical question

110:56

of, you know, hey Nick, what happens

110:58

when you run out of context? Because

111:00

obviously that's going to happen.

111:02

Well, when there are 50,000 tokens,

111:05

let's say, out of 200,000, okay? No

111:07

problem. You are having the full

111:09

conversation history with the model and

111:12

the model basically gets literally every

111:14

message starting from message number

111:15

one, two, three, four, all the way down

111:18

to I don't know, message number 25. And

111:20

then what it does is it takes all of

111:22

this context and then feeds it into its

111:24

big neural network to generate message

111:26

number 26, right?

111:28

However, when we get to a certain

111:29

length, right? I don't know, let's say

111:31

message 50. Obviously, there's no

111:33

there's no tokens left anymore in the

111:34

context window. Maybe we're like 199

111:36

Well, not actually, but probably be like

111:37

155k

111:39

out of 200k.

111:40

Well, what happens is all models now

111:42

have some sort of what's called like

111:44

auto compact limit.

111:46

I mean, basically all of them have

111:47

adopted this convention, where when the

111:50

number of tokens that you're using,

111:52

let's say the

111:54

limit is right over here.

111:57

When the number of tokens that you're

111:58

using gets to this point, okay?

112:01

You know, it fills up,

112:03

then fills up,

112:04

fills up,

112:06

fills up, and fills up.

112:08

What happens is this triggers a

112:10

mechanism called compaction,

112:12

where we take all of the information

112:15

here,

112:18

which is I don't know,

112:19

maybe like 80% or so of the whole

112:21

context, and then we compress it. I want

112:24

you to imagine right now there's like a

112:25

a big hydraulic press type thing over

112:28

here,

112:29

and it's pushing all of this context

112:31

down, it's squishing it. Basically,

112:33

what's going to occur

112:34

is we're going to erase the vast

112:36

majority of this,

112:38

and then, you know, instead of consuming

112:40

80%, we're going to cram all that

112:42

information into maybe, I don't know, 30

112:44

or 40% or so.

112:47

And so that is called compaction,

112:50

and it occurs on a relatively regular

112:52

basis across the model ecosystem.

112:55

The issue with the compaction, or you

112:57

know, compression, or whatever the heck

112:58

you want to call it, it's the same idea,

113:00

is during this summarization and like

113:03

densification process, we are going to

113:05

drop outputs from tools. We are going to

113:08

remove some information and context that

113:11

might actually be useful to you now at,

113:13

you know, message 50 from message four,

113:15

which might actually like eliminate a

113:16

mistake. And so, because of that, you

113:18

know, you are going to lose some of the

113:19

quality.

113:20

Um the benefit is obviously you will

113:22

significantly improve the information

113:24

density. And what do I mean by

113:25

information density? I mean literally

113:26

like if it's like um hello,

113:30

how are

113:32

you doing?

113:35

I mean, let's say somewhere in your

113:36

context you have the term you the

113:38

sentence hello, how are you doing? Well,

113:40

hello is actually two tokens. How is

113:42

one, are is one, you is one, doing is

113:46

three along the question mark. So, in

113:48

total, if you count all the stuff up,

113:50

depending on the uh thing you're using

113:51

to do the embedding, that's uh eight,

113:53

right?

113:54

Well, you know, compaction is literally

113:57

going to take this sentence and then

113:58

it's going to compress it. So, it's

113:59

going to say hi,

114:01

how are you?

114:04

So, now instead of that's one token

114:06

here, one token here, one token here,

114:08

one token here equals four.

114:10

It will literally get all of the context

114:12

that it can and then try and squish it

114:14

so that the same meaning is available in

114:16

fewer tokens and fewer words wherever

114:18

possible. And then it'll just run this

114:20

naively across your entire um context.

114:23

And so, this is going to occur every

114:24

single time. Obviously, it's something

114:25

that we want to avoid occurring if we

114:27

have sensitive and important data, but

114:29

you know, it does allow us to continue

114:31

conversating with models. Before we had

114:33

context compression in some form of auto

114:34

comp action, um basically we would just

114:37

run out of tokens and we'd have to

114:38

restart a totally new session. So, this

114:40

just does sort of that intermediate step

114:41

that most people were doing before where

114:42

they would like like take all of that,

114:44

you know, try and summarize it in some

114:47

other model and then paste it back into

114:48

uh into into another one. Now, that

114:50

takes us to what most model

114:52

practitioners are using nowadays, which

114:54

is a variant of something that uh people

114:57

call the iceberg technique.

114:59

Now, in case you guys have never seen an

115:01

iceberg before, I'm Canadian, so we have

115:03

them everywhere, including literally in

115:05

the river across the street from my

115:07

house.

115:08

Not uh actual icebergs, but little ice

115:10

floats.

115:11

The way that they work is basically you

115:13

have um a section that's visible above,

115:16

which is usually quite massive and quite

115:17

intimidating. And then you're like, "Oh

115:19

my god, that's a really big iceberg."

115:21

And then what you don't realize is

115:22

underneath the iceberg is actually like

115:24

two or three times as big.

115:26

And so above, the stuff that's like

115:28

immediately visible,

115:30

or in our terms for the model,

115:33

accessible immediately,

115:36

is actually only a very small percentage

115:38

of the total iceberg.

115:42

And so in the context of our model, what

115:44

we store above, which is immediately

115:46

accessible, it's the sort of the stuff

115:47

that's like visible to the plain eye, is

115:50

we'll store our memory,

115:52

we'll store our Claude or our agents or

115:54

our Gemini.md,

115:56

we'll store our local memory as well.

115:59

There's different types, there's global,

116:00

local. We'll store all of the current

116:02

task contexts, everything that our tools

116:05

are doing, then maybe any active file

116:07

contents, okay? And so all of this stuff

116:09

here is like basically always accessible

116:11

to us. It's literally just in our

116:12

prompt.

116:13

But then, what people are doing to

116:15

reduce the total number of tokens that

116:16

they require, is they're abstracting

116:18

away everything else. And then they're

116:19

just making it accessible to the model

116:21

if it needs it.

116:22

What I mean by that is instead of

116:24

putting all of the files in your code

116:26

base in a prompt, what it does is it

116:28

gives you a tool called read. What read

116:30

can do is read can at any time read a

116:32

file, okay? But instead of putting the

116:35

entire file in there, for now all it

116:36

does is just puts the titles.

116:38

So if you say, "Hey, I want you to grab

116:40

the um information on the iceberg

116:42

technique." And then in your workspace

116:44

you have a file called iceberg

116:45

technique.md,

116:46

it'll know it doesn't actually have to

116:47

read all of the files in your workspace,

116:49

it only has to read iceberg.md, right?

116:52

Same thing with the full code base. You

116:53

have tools like grep and glob. And these

116:56

tools are sort of analogous. Instead of

116:58

reading a whole file, what this does is

117:00

allows you to hone in on a specific

117:01

segment of text. You know, if this is my

117:03

entire code file, okay, and

117:05

hypothetically, let's just say it's

117:07

really big and, you know, there's

117:09

there's a lot of stuff. But the only

117:11

thing that I actually care about is this

117:13

little segment over here,

117:16

then why would I load all of the, I

117:19

don't know, 10K tokens?

117:21

I don't need to, okay? Realistically,

117:24

what I can do as a smart model is I

117:26

could use grep and glob, these tools, to

117:29

maybe hone in only on this segment over

117:31

here, which is, I don't know, let's just

117:33

say 2K tokens.

117:35

And because it contains some of the text

117:37

before and some of the text after, you

117:39

know, this still usually gives us enough

117:40

context to

117:42

um tell the model what it needs in order

117:44

to to finish its function. Then you also

117:45

have web data via web fetch. Web data's

117:48

pretty cool. You can kind of think of it

117:50

as the same thing. Obviously, it doesn't

117:51

have access to the whole internet, but

117:52

it can make search queries, right? And

117:54

so, because it's able to use some

117:56

general reasoning, when you say, "Hey,

117:57

what's the iceberg technique?" first

117:59

it's going to start by looking for file

118:01

contents called iceberg technique. If it

118:03

can't find any, maybe it'll quickly type

118:05

F iceberg to look through the code base.

118:07

If it can't find that, you know, maybe

118:09

it'll look through some other things

118:10

like uh memory files in the skills

118:12

library. But if it can't find that,

118:14

it'll say, "Okay, cool. So, we don't

118:15

have this in our in our context window

118:17

right now, and we don't even have access

118:19

to it within our space, but it's

118:20

probably somewhere on the internet, so

118:21

I'm just going to Google iceberg

118:22

technique." And then what it'll do is it

118:25

won't even take the entire thing. It'll

118:26

just grab top-level links, and then

118:28

it'll look at the URL, you know, uh and

118:31

the URL is about, guess what, icebergs.

118:33

I'm going off the map here, but

118:35

hopefully you guys understand what I

118:36

mean. Then if there's three URLs, one of

118:38

them's about icebergs, then instead of

118:39

reading all of them, it's only going to

118:40

read this one. And so, it's sort of like

118:42

a successive narrowing of the lens until

118:45

eventually it gets to, you know, what

118:47

you want. And it doesn't load the the

118:50

of all of the context, but it just has

118:53

the opportunity select all of this. You

118:55

know, it starts here, it goes here, goes

118:57

here, goes here, goes here, goes here,

118:58

and then goes here, and then finally

118:59

it's at its goal.

119:01

You can do the same thing in a variety

119:02

of other ways. You can use bash, get

119:03

history, and so on and so forth, but

119:06

um essentially what you want to do is

119:08

instead of storing all of the

119:09

information like the full code base, the

119:11

file contents, the web data, all the get

119:13

history, all the skills, and everything

119:14

like that. What you do is you just store

119:16

the ability to access it on demand.

119:19

And then inside the context, okay, the

119:22

tiny chunk that you do, I mean in this

119:23

diagram it says 10% 90%, you know, I

119:25

think in reality it's probably closer to

119:27

2080 or maybe 3070.

119:30

Um here's where you store stuff that's

119:31

just like

119:32

it it needs to be the same all the time.

119:34

It always needs to be present. There

119:36

always needs to be some sort of patterns

119:38

that are learned, some sort of active

119:39

file contexts or

119:41

contexts or current task context. You

119:43

can think of this as the difference

119:44

between naive versus strategic context

119:48

loading. Now way back in the day, and

119:50

when I say way back in the day, I mean

119:52

like 2023. Good God, I'm getting old.

119:55

You know, when you were working with an

119:56

agent, you would dump in the whole code

119:57

base. You would honestly just copy and

120:00

paste everything and just hope to God

120:01

that it that it knew what it was doing.

120:03

Obviously, because this was

120:05

extraordinarily infeasible, there were

120:08

so many tokens in the context.

120:11

Tons of it was lost, and you routinely

120:13

ran out of context limits.

120:15

Well, nowadays what we've done is we

120:16

basically built in a whole tool stack

120:18

where instead of all of the file, you

120:20

just read selectively and only the

120:22

relevant functions.

120:23

You know, you have a cloud.net which is

120:25

basically a compression a compression

120:27

function which is stores your

120:28

preferences.

120:29

Skills instead of all being read, you

120:31

know, we only read a specific segment of

120:33

them. This is technically called a YAML

120:35

front matter, which is just a tiny

120:37

little section at the beginning of the

120:38

skill. You can actually see this if we

120:40

go back to the skill.net and I make this

120:42

visible, right? Only this section up

120:44

here is actually and know, can actually

120:46

see this up here on the YAML front

120:48

matter is this segment. Only this

120:51

segment is actually loaded into context

120:53

until you ask for, you know, more

120:55

information about create proposal. And

120:57

that's just because this little space

120:58

invader sees you it has the ability to

121:00

call a create proposal skill, but it

121:02

doesn't need to know all the rest of

121:04

this because what's realistically going

121:05

to happen well, 90% of the time you

121:06

won't even ask. There's so many other

121:07

skills that it'll probably be using.

121:09

We're also now doing things like uh

121:10

summarizing tool results. So, instead of

121:13

storing the entire thing in your

121:15

context, you know, we just store like a

121:17

very short summary of basically the

121:18

input output. So, way back in the day I

121:20

used to think that all of an agent was

121:23

really just its intelligence. It was

121:25

just the core model, right? Which in

121:27

this case would be Opus 4.6.

121:30

But what I've come to quickly realize is

121:32

although models themselves are quite

121:34

intelligent, it's really the

121:36

architecture that we've wrapped around

121:37

it. I want you to pretend this little

121:39

space invader is kind of now in I don't

121:42

know a

121:43

house of some kind. The house has a

121:45

little chimney with a fireplace. It has

121:47

a little place where it could I don't

121:48

know, roast a nice turkey. You know, it

121:51

has a nice bed that it can go to sleep

121:52

in every night. You know, this agent by

121:55

itself probably wouldn't last super long

121:57

out there on the savanna, but because

121:58

we've built all this infrastructure

122:00

around it, because we built roads for

122:01

it, we built ways for it to communicate

122:03

and stuff like that, you know, it's it's

122:05

capable of actually doing a lot of very

122:06

economically valuable work for us.

122:09

And so, just like human beings

122:11

way back in the day had to conceptualize

122:13

the idea of

122:14

I don't know, like a like a spear or

122:16

something to hunt um um

122:19

saber-tooth tigers on the plains, you

122:22

know, so too do these agents use tools

122:26

effectively to solve problems in their

122:28

environment and ultimately get us the

122:30

users what we want. Now, obviously

122:32

there's context window management like

122:35

we just talked about. And that's for

122:37

optimizing the usage of a specific

122:40

model, okay, in the choice of a model.

122:43

but there's also the ability to choose

122:44

different models for different purposes.

122:47

Now, throughout most of the course so

122:49

far, what I've done is I've just used

122:51

mostly naive like Opus 4.6 agents in

122:54

order to spawn other Opus 4.6 sub

122:56

agents.

122:57

And that was mostly for capability sake

122:59

because at least in my case cost is not

123:01

a a concern and I really do want to eke

123:03

out the marginal quality um benefits

123:05

wherever possible.

123:06

But there are a lot of cases,

123:08

specifically like enterprise and and big

123:10

infrastructure ones, where, you know,

123:11

people are actually comfortable making a

123:13

minor trade-off for quality. I'm going

123:16

to draw another one of my famous graphs.

123:18

Um people are comfortable making, you

123:20

know, a a a trade-off in terms of, you

123:22

know, cost

123:24

and then quality. Now, in a lot of

123:26

disciplines out there, biology, physics,

123:28

chemistry, and stuff, there's this this

123:30

idea of like this inverted U curve. And

123:33

you can call it whatever the heck you

123:34

want. Um I think the actual name is the

123:37

Yerkes-Dodson curve.

123:40

And what this is is this is basically

123:41

like the the optimal point

123:45

that combines two different factors. And

123:48

so in our case, if we're optimizing for

123:49

both cost and quality, okay,

123:51

simultaneously, not just cost, not just

123:53

quality, you can imagine that the

123:55

optimal place to choose on this graph is

123:57

probably going to be something like over

123:59

here. It's going to be It's going to be

124:00

somewhere around here.

124:01

If you wanted to minimize cost exactly,

124:03

we'd probably go like way over here. But

124:05

obviously we care about quality as well,

124:06

so we're going to push up a little bit,

124:08

right? We don't want this point because

124:11

one, it costs a lot, and then boom, two,

124:13

the quality's pretty low, because

124:15

despite the fact that quality is really,

124:16

really high, um you know, cost is like

124:18

many, many times higher than it was over

124:20

here.

124:21

And so this is sort of like our our

124:23

optimal point. And, you know, a lot of

124:25

large enterprises, since we're dealing

124:26

with hundreds of millions of dollars

124:28

here, um are actually comfortable making

124:30

a little trade-off where, you know, if

124:31

this quality is 85% and then this one

124:34

here is, I don't know, 95%, they're okay

124:36

taking like a like a 10% hit here

124:40

if it means that they also reduce their

124:42

costs by, I don't know, 40% or something

124:44

like that.

124:46

And this is really where all this stuff

124:47

comes in, okay? So, I don't mean to talk

124:48

your ear off here. It's not super

124:49

important, but uh basically uh what a

124:52

lot of people have taken to doing now is

124:53

doing a 60-30-10 rule

124:55

where they'll use some top-level agent

124:58

router, which is sort of like the

125:00

orchestrator in our multi-agent uh

125:02

Chrome window example. And what that

125:05

agent router does is it calls dumber

125:06

models

125:08

and then it assigns different strengths

125:10

to tasks so that, you know, if you're

125:13

giving it a really simple task and you

125:15

say, "Hey, you know, I just want you to

125:16

classify this into one of three

125:18

categories."

125:19

And it's really dumb. It's like, you

125:21

know, red, blue, or green,

125:23

angry, serene, or or healthy, or

125:26

whatever the heck. Um you don't have to

125:28

use like Opus, which is like space-age

125:30

intelligence and costs you a ton more in

125:32

token cost in order to get that done.

125:35

Instead, you know, you can get all the

125:36

way down to like a Haiku or maybe a

125:38

Gemini Flash model or something like

125:39

that. Likewise, if you have some other

125:41

task here, and maybe that task requires

125:43

a lot of um I don't know, research or

125:45

something,

125:46

and you say, "Hey, I want you to go and

125:47

compile 200 million tokens worth of

125:50

stuff and then um give it to me in a big

125:52

report." Well, you know, you probably

125:53

don't want the dumbest model to do that

125:55

for you. But you also don't need the

125:55

most expensive model. So, maybe you'll

125:57

use something like a Saw model or like a

125:59

a lower-level GPT model, which might

126:00

cost two or three million dollars uh two

126:02

or three dollars per million tokens

126:04

instead. And so, you know, this

126:05

allocation where you have 60-30-10, if

126:08

you think about it like sort of a pie

126:09

chart, um what you do is you designate,

126:12

you know, the vast majority of your

126:15

token usage

126:16

to stuff that is in that first category,

126:18

which is kind of, you know, dumber.

126:21

And then what you do is you do the other

126:23

30% or so

126:25

in sort of that mid-tier. And then your

126:27

really, really, really smart models, you

126:29

know, they do the highest-level tasks.

126:32

And basically, what will happen for the

126:33

most part is this would be, you know,

126:34

your Opus 4.6 or your Gemini

126:39

3.1 or your GPT 5.4. It'll be

126:43

responsible for routing decisions and

126:44

obviously you want the smartest model

126:46

possible for that. But all of the heavy

126:47

lifting, all the context and stuff like

126:49

that is um through sub-agents that I

126:51

spawned, either Haiku,

126:53

Sonnet,

126:54

or uh you know, I don't know if if if

126:56

you wanted to do a really smart call,

126:57

then you'd obviously spawn an Opus

126:59

sub-agent like me as well.

127:01

And if you do all this, you could

127:02

significantly reduce the cost. I mean,

127:03

like just just think about it

127:04

mathematically. If previously you were

127:06

doing 100 million tokens times, you

127:09

know, $5 per 1 million tokens,

127:12

>> [gasps]

127:13

>> what's the cost there?

127:14

Well, that's obviously going to cost

127:15

$500. And so that's like your Opus only,

127:18

right? But if you did 10 million times

127:21

$5 plus

127:24

30 million times $3

127:28

plus 60 million times

127:31

$1, what's the total cost going to be

127:33

now? Well, it's going to be 60

127:36

plus 90

127:39

plus 50

127:41

or in total, 200.

127:44

And so, you know, 200 expressed as a

127:45

fraction of 500 is 40%

127:49

of our total cost. And we will have just

127:52

saved, you know, 60% with probably

127:54

minimal impacts on quality because the

127:57

things that we're now spawning, you

127:59

know, dumber agents um to do are things

128:01

that, to be honest, the quality was

128:03

already okay a few generations ago back

128:05

with the Haikus and the Sonnets. So just

128:07

to give you an example from something

128:08

that I do pretty often, okay, which is

128:11

going to be some form of lead scraping,

128:13

what you can do is you can actually

128:14

traverse a very large portion of the

128:17

internet using a relatively dumb model,

128:19

these Haiku models. What these do is

128:22

these um scrape a vast majority a vast

128:25

amount of internet data, okay? All of

128:27

the code of uh I don't know, let's say

128:29

10,000 websites or something. And then

128:32

in doing so, they just like that little

128:33

magnifying glass, use some sort of grep

128:35

or extraction prompt to look for things

128:38

that are formatted like email addresses.

128:40

So, if you have like something and then

128:42

it's an at and then it's a you know, the

128:44

term gmail.com,

128:46

odds are this is a real email address,

128:47

right? So, then you store that to a

128:48

database. And because this is just such

128:50

like a mass data application, use HiQ.

128:52

It drives the cost really, really low.

128:55

Well, then maybe um the actual

128:56

enrichment point, you know, takes

128:58

significantly more intelligence. And so,

129:00

maybe here we'll use Sonnet and it'll

129:01

cost us uh $0.008

129:04

per lead, $0.008 per lead. The actual

129:07

outreach part is mostly templated, so we

129:10

use Sonnet for that as well. And then

129:11

maybe at the end we just have a quality

129:13

review step to make sure things aren't

129:14

absolutely nuts. Well, when you do it

129:16

this way, um you know, the math ends up

129:18

being uh $0.008 + $0.005, so that's

129:21

$0.013 + $0.001, $0.014 + $0.015 is

129:26

$0.029.

129:28

And then if you were to go 100% Opus,

129:30

then it would be I don't know, uh uh

129:32

about 12 cents or so per lead. And so,

129:34

on a list of let's just say a thousand,

129:36

which is approximately how much I'm

129:38

sending a day right now. I'm much

129:39

farther down than uh my maximum, but if

129:42

we multiply all these together, we move

129:43

that one, two, three decimal points over

129:45

to the left, then that um ultimately

129:48

would be $15 a day.

129:51

Or, you know, $450 a month. Well,

129:54

instead I'm doing that literally one

129:57

quarter of this. Or something like, you

129:59

know, $120

130:01

a month instead. Obviously, I'd much

130:03

rather the latter. And if my quality is

130:05

only going down a few percentage points

130:06

because of that Yerkes-Dodson curve, you

130:09

know, I'm okay being over here instead

130:12

of over here because this gap to me is

130:14

fine on tasks that aren't super high

130:16

high quality, then uh this is a very,

130:19

very efficient stack. And you know, the

130:21

bigger and bigger my company gets,

130:23

whoever I'm working with, the more the

130:25

cost per lead is going to be important

130:28

versus the actual quality. I've included

130:30

just a little LLM API pricing cheat

130:33

sheet. I don't expect this to be super

130:35

relevant or useful to you guys. There

130:37

are a lot more models for OpenAI

130:40

and Google, but I am actually using um

130:42

not this model series anymore, but this

130:44

one here for some queries. I'm also

130:46

using the flash model series for some

130:48

queries as well.

130:49

And then what's really cool is a lot of

130:51

them offer uh what's called a batch API

130:53

now, where you can submit a bulk number

130:56

of requests over um simultaneously. And

130:59

then if you're comfortable waiting like

131:01

a day or so, what the companies do is

131:03

they batch it and then they serve your

131:06

requests during periods in which they

131:08

have very low inference or low

131:09

competition. So, maybe in the middle of

131:11

the night or something like that. And in

131:13

doing so, they actually get to load

131:14

balance. Like if you think about it like

131:16

if this is like a day

131:18

and then this is their load like on

131:19

their servers and their neural networks

131:21

and stuff, you know, it'll probably peak

131:22

somewhere around like noon and there's

131:24

probably like a couple things and then

131:25

it's like low during the during the day,

131:27

right? I don't know. This is like 4:00

131:28

a.m. What they'll do

131:31

is they'll actually take all of your

131:32

queries, batch them, and then they'll

131:33

just like run them over here when

131:35

there's very little competition.

131:37

And then later when, you know, the

131:38

things go up and stuff like that again,

131:40

um that's okay. And in doing so, what

131:42

they want to do is they want to shift

131:43

some of the the really top end of all of

131:45

these users

131:47

um to the low end to basically fill this

131:49

so that they have a lot more like

131:50

dependable load instead of these like uh

131:53

jagged peaks and whatnot.

131:55

>> [sighs and gasps]

131:56

>> But anyway, don't worry too much about

131:57

that. I just wanted to cover um some LLM

131:59

pricing principles as well so that you

132:00

guys know not only how to manage your

132:02

context better, but also how to um save

132:06

especially when you get into more

132:07

sophisticated multi-agent setups like

132:09

I've been showing you. And that's it.

132:11

Thank you guys very much for watching

132:12

this video end to end. If you guys have

132:14

made it all the way to this point in the

132:15

course, you're part of like the 2 or 3%

132:18

that actually do. Um I'd really

132:19

appreciate a big solid if you could do

132:21

me a favor and subscribe to the channel.

132:23

Something like 70% of you aren't, which

132:25

significantly hurts my reach. And uh

132:27

despite me hating asking for it, it does

132:29

help the channel grow. So, if I've given

132:30

you guys any value whatsoever, please do

132:32

that. You can also send me over a

132:34

comment down below asking any question

132:36

about any point in the video. Um I'm

132:39

much more engaged than the average

132:40

YouTuber, so the probability that I will

132:41

reply is pretty pretty high up there, I

132:43

would say, statistically.

132:45

Um if you guys have any, you know,

132:47

suggestions for future videos or future

132:48

courses, please drop them down below as

132:50

well. And above all else, keep learning

132:52

and growing with AI agents. This is by

132:55

far the biggest and most impactful of

132:58

economic changes that I think any of us

133:00

will see in our lifetime. It's a blessed

133:02

time to be alive in general. You might

133:03

as well not waste it. Make the most out

133:05

of it. All right. Um thank you very

133:07

much. Feel free to use the chapter

133:08

headings to revisit any section in the

133:10

course. And uh looking forward to seeing

133:11

all y'all in the next one. See you

133:13

later.

Interactive Summary

This video serves as a comprehensive guide to mastering AI agents, designed for individuals without formal computer science backgrounds. The course covers the foundational 'core agent loop'—observation, reasoning, and acting—while exploring advanced techniques such as multi-agent orchestration, self-modifying system prompts, and video-to-action pipelines. The instructor demonstrates practical workflows using major platforms like Codex, Claude Code, and Antigravity, emphasizing that while the LLM is the reasoning engine, the surrounding architecture (tools, memory, and prompt engineering) is what drives high-quality, autonomous performance.

Suggested questions

4 ready-made prompts