WEBVTT

00:00:00.120 --> 00:00:04.059
Okay, so I'm in a brand-new project
and now I wanna

00:00:04.140 --> 00:00:06.180
write some code with help of Agency here.

00:00:06.400 --> 00:00:09.680
Specifically,
what I wanna build in this section here

00:00:10.160 --> 00:00:14.120
AI-powered utility tool which can take

00:00:14.200 --> 00:00:18.020
some blog post file in Markdown format as

00:00:18.100 --> 00:00:21.680
input and produce an optimized tweet, a

00:00:21.700 --> 00:00:24.690
post for the X platform based on that.

00:00:24.720 --> 00:00:28.570
To do that,
I'll start by initializing a new Python

00:00:28.600 --> 00:00:32.589
this folder and I'm doing
that using the UV tool, which is

00:00:32.759 --> 00:00:36.540
a modern Python project manager. You can,
of course, create a Python project

00:00:36.580 --> 00:00:39.490
in any way you want
if you want to follow along.

00:00:39.490 --> 00:00:43.180
And with that created,
I got a main.py file in

00:00:43.220 --> 00:00:47.100
Python code. As you see,
I'm already starting with some code here.

00:00:47.160 --> 00:00:50.960
Now, as mentioned,
I wanna build a program here that

00:00:51.020 --> 00:00:54.920
loads a Markdown file,
reads a Markdown file, and then uses AI

00:00:54.980 --> 00:00:58.860
to generate a post.
So let's say those Markdown files should

00:00:58.940 --> 00:01:02.840
inputs folder. And in there, I'll add a

00:01:02.880 --> 00:01:06.780
post.md file, a simple Markdown file,
and in there

00:01:06.860 --> 00:01:10.130
I'll store some dummy Markdown post,
which I actually took from my

00:01:10.160 --> 00:01:12.940
website, maximilianschwarzmuller.com.

00:01:13.020 --> 00:01:16.990
In there, I got this article,
"AI-powered development:

00:01:17.020 --> 00:01:19.880
in the end it's the Markdown for this post
which is stored in there.

00:01:19.900 --> 00:01:22.760
You'll find that attached in case you
wanna follow along, but of course,

00:01:22.800 --> 00:01:26.400
need to. So, I want to read

00:01:27.700 --> 00:01:31.600
all files that can be found in this inputs
folder and

00:01:31.660 --> 00:01:35.520
then I wanna generate posts based on those
files with help of AI.

00:01:36.360 --> 00:01:39.920
Now using Agency mode,
we could of course tell

00:01:39.980 --> 00:01:43.440
Cursor generate an app that reads

00:01:43.520 --> 00:01:47.240
Markdown files and uses AI to produce X

00:01:47.260 --> 00:01:50.500
posts. But that would be a horrible

00:01:50.560 --> 00:01:54.080
instruction.
Let's instead embrace the features Cursor

00:01:54.140 --> 00:01:57.410
Agents offer us to increase our chances of
getting a good

00:01:57.480 --> 00:02:00.840
result.
So how do you efficiently use Cursor

00:02:01.100 --> 00:02:04.600
Agents? Well,
general instructions like this one

00:02:04.680 --> 00:02:07.150
here are not something you should do.

00:02:07.180 --> 00:02:11.160
Instead,
you wanna be as specific as possible

00:02:11.300 --> 00:02:14.460
complex tasks into multiple smaller tasks.

00:02:14.500 --> 00:02:17.690
When working with Cursor Agents, being

00:02:17.740 --> 00:02:21.090
precise and having clear instructions is

00:02:21.580 --> 00:02:25.320
the most important thing. You wanna be as

00:02:25.360 --> 00:02:29.140
precise as possible.
So instead of having a very generic

00:02:29.180 --> 00:02:33.040
instruction like this one,
you instead might wanna write an

00:02:33.100 --> 00:02:36.920
like this one here.
And just to be very clear,

00:02:36.960 --> 00:02:40.870
more complex programs or
if you're working on programs or

00:02:40.940 --> 00:02:44.860
applications where you wanna add in
individual features, it's a good

00:02:44.920 --> 00:02:48.750
idea to break complex tasks up into
multiple smaller

00:02:48.780 --> 00:02:52.720
tasks. Here,
I actually have the entire task

00:02:52.940 --> 00:02:56.520
of building this utility program in one
instruction, but still

00:02:57.060 --> 00:03:00.560
I added some structure here to make this
easier to

00:03:00.640 --> 00:03:04.560
digest.
I'm explaining what we're building,

00:03:04.580 --> 00:03:08.360
technology we're using,
and then I have this step-by-step

00:03:08.420 --> 00:03:12.220
list here to make it very clear what
should happen at which point and how

00:03:12.420 --> 00:03:15.320
data will flow through this application.

00:03:15.420 --> 00:03:19.360
I'm adding lots of meaningful context here
because

00:03:19.440 --> 00:03:23.140
that is probably the most important skill
when working with

00:03:23.200 --> 00:03:26.880
AI in general, being a good prompt
and context

00:03:26.980 --> 00:03:30.560
engineer. Which simply means
that you need to be good at

00:03:30.620 --> 00:03:34.520
providing the right information to the AI
model to increase

00:03:34.600 --> 00:03:37.940
your chances of getting the model to
produce the right output.

00:03:37.960 --> 00:03:41.380
Because all these models
are just token generators.

00:03:41.440 --> 00:03:45.250
That is what they are.
But you can of course increase

00:03:45.340 --> 00:03:49.020
the likelihood of the right tokens being
generated to

00:03:49.100 --> 00:03:53.060
get some output you want by providing the
right context,

00:03:53.100 --> 00:03:55.280
the right information to the model.

00:03:55.300 --> 00:03:58.810
And in the end, prompt
and context engineering therefore simply

00:03:58.840 --> 00:04:02.420
down to having a clear instruction that's
not too

00:04:02.540 --> 00:04:06.300
complex,
hence you might wanna split complex tasks

00:04:06.400 --> 00:04:09.960
smaller tasks,
and then providing the right

00:04:10.040 --> 00:04:13.520
additional information,
the right context to

00:04:13.680 --> 00:04:17.459
help the model fulfill that instruction
or complete

00:04:17.500 --> 00:04:21.120
that instruction.
And it's the same with coding and Cursor

00:04:21.300 --> 00:04:24.700
Agents. Now, here I actually have just the

00:04:24.760 --> 00:04:27.969
context. I don't have any instruction yet.

00:04:28.000 --> 00:04:31.900
I'll instead add it here after this
instruction, which is what I typically

00:04:31.909 --> 00:04:33.900
like to do but which is not a hard rule.

00:04:33.940 --> 00:04:37.780
It's just important
that you do have a clear instruction

00:04:37.840 --> 00:04:41.380
that's required. So here we go,
and actually now I am

00:04:41.480 --> 00:04:45.120
splitting this overall task up into
multiple smaller tasks

00:04:45.480 --> 00:04:49.460
because my first instruction here is
that as a first step, I want the

00:04:49.520 --> 00:04:52.760
AI to add the logic for finding
and loading those Markdown

00:04:52.800 --> 00:04:56.610
files,
and that I don't want it to parse the

00:04:56.660 --> 00:04:59.760
want it to convert it to HTML
or anything like that.

00:04:59.800 --> 00:05:01.570
It should just read it as plaintext.

00:05:01.600 --> 00:05:05.490
Again,
I'm trying to be as specific as possible

00:05:05.600 --> 00:05:09.260
all the required context.
Then you should choose an

00:05:09.300 --> 00:05:13.120
appropriate model,
whichever model you like,

00:05:13.240 --> 00:05:15.950
and then you can choose a mode, which
is what we'll do

00:05:16.020 --> 00:05:18.560
next.
