WEBVTT

00:02.160 --> 00:07.800
In this tutorial, I'm going to show you how to build a WhatsApp AI agent that can plan everything for

00:07.800 --> 00:08.120
you.

00:08.640 --> 00:12.720
We'll be using Deep Sigrun as the brain for our AI planner agent.

00:13.280 --> 00:19.000
It's an amazing reasoning model that's great for planning, decision making and complex reasoning tasks.

00:19.440 --> 00:27.000
The planner agent will analyze your requests and craft a detailed plan to our second agent, which is

00:27.040 --> 00:28.080
a research agent.

00:29.360 --> 00:30.720
Now let's do a quick demo.

00:30.920 --> 00:37.560
Let's say I wanted to plan a budget friendly one month stay in Thailand as a digital nomad.

00:38.200 --> 00:44.040
I need a cheap place to stay, good wifi, coworking spaces and some great attractions to visit.

00:45.320 --> 00:46.560
Let's test the workflow.

00:46.600 --> 00:53.000
Normally you wouldn't do this if the setup is active, but I wanted to show you the flow.

00:53.640 --> 00:55.920
So I'm going to hit this workflow.

00:58.640 --> 01:00.160
And send the message.

01:00.600 --> 01:08.950
Our agent is now analyzing the request and preparing a plan, passing it to our second agent, which

01:08.950 --> 01:11.270
is research agent.

01:14.150 --> 01:17.150
The research agent uses Serp API to search the web.

01:20.150 --> 01:23.870
We should get a response in WhatsApp in a sec.

01:24.710 --> 01:26.350
So let's just wait a moment.

01:31.990 --> 01:32.390
All right.

01:32.390 --> 01:32.830
Great.

01:32.870 --> 01:37.230
Let's have a look for a budget friendly one month stay in Chiangmai.

01:38.030 --> 01:42.870
So as you can see, our agent recommends Chiang Mai as a city to stay.

01:45.750 --> 01:50.670
It has prepared affordable accommodation options with website links.

01:51.190 --> 01:55.670
It also suggests that negotiation can help lower the price, which is really good point.

01:55.710 --> 02:03.100
Actually, it remembers that we are looking for a place with good wifi, which is great.

02:12.140 --> 02:15.780
It also funds coworking spaces.

02:18.300 --> 02:23.220
And provides website links with addresses.

02:32.060 --> 02:33.180
Top attractions.

02:36.780 --> 02:37.740
Cooking classes.

02:39.780 --> 02:41.300
Transportation options.

02:41.340 --> 02:44.060
It recommends to rent a scooter.

02:47.740 --> 02:47.940
Or.

02:47.940 --> 02:48.900
I really like this.

02:50.220 --> 02:57.700
It even provided a total cost estimate so you know exactly what to expect, which is impressive.

03:00.500 --> 03:02.180
You also have additional tips.

03:07.340 --> 03:07.700
All right.

03:07.700 --> 03:08.020
Great.

03:08.020 --> 03:09.460
So this is just an example.

03:09.700 --> 03:14.340
You can use this agent to plan anything both for personal and business use cases.

03:14.380 --> 03:18.940
For example you can use it for market analysis or competitors research.

03:19.140 --> 03:21.980
You can plan whatever you want with this agent.

03:22.180 --> 03:30.660
So just to quickly show you, when we open our Typekit R1 planner agent, we can see all the reasoning

03:30.660 --> 03:31.300
steps.

03:32.500 --> 03:37.140
So okay, so I need to plan a budget friendly one or stay in Thailand as a digital nomad.

03:41.900 --> 03:43.260
And 3D days.

03:45.220 --> 03:49.580
So you can check exactly the thinking process of this agent.

03:52.100 --> 03:56.220
That I should update a local events or festivals happening during my stay.

03:57.940 --> 04:07.450
So this agent really helps to plan our trip to Thailand And it passed all this information to our research

04:07.450 --> 04:10.690
agent, which has performed the web search.

04:11.810 --> 04:16.570
Okay, now let's jump into A10 and build these agents from scratch.

04:19.930 --> 04:22.770
Now let's start building our agents.

04:23.610 --> 04:27.890
So usually the first thing we need to do is add our trigger node.

04:28.450 --> 04:30.610
In this setup we'll be using WhatsApp.

04:31.170 --> 04:38.890
And some time ago I recorded a video on how to easily connect WhatsApp to your agents in an A10 in just

04:38.890 --> 04:39.690
six minutes.

04:40.050 --> 04:41.610
So I'll play that later.

04:41.810 --> 04:48.610
For now, let's focus on building our agents first, and then we'll integrate WhatsApp as an input and

04:48.610 --> 04:52.570
output for the first and last nodes in our workflow.

04:54.170 --> 04:56.690
So let's search for agent node.

04:58.570 --> 05:00.170
Click on add node button.

05:02.490 --> 05:05.200
Search for Agent.

05:09.440 --> 05:10.640
Let's close it for now.

05:12.320 --> 05:16.360
So as I said, we trigger our workflow, uh, in WhatsApp.

05:16.360 --> 05:18.600
So we need to remove this node.

05:22.320 --> 05:26.640
Now we need to add the chat model.

05:28.040 --> 05:36.120
So as the brain for our planner agent we'll use R1 through grok the host distilled version of this model

05:36.120 --> 05:37.120
which we can use.

05:38.160 --> 05:42.560
So add chat model search for grok.

05:48.120 --> 05:54.160
Now to get started with grok go to console.com.

05:56.840 --> 05:58.520
And you will land on this page.

05:59.600 --> 06:05.870
So it's a super fast AI hosting platform around ten times faster than most services.

06:06.390 --> 06:08.390
They host a lot of models themselves.

06:10.430 --> 06:15.270
So click on the console to access the playground.

06:16.510 --> 06:17.230
Sign up.

06:18.950 --> 06:20.870
Head over to API keys.

06:24.030 --> 06:25.510
Create a new API key.

06:27.230 --> 06:28.070
Give it a name.

06:34.190 --> 06:34.950
Copy it.

06:38.270 --> 06:43.790
Now if you want to learn more about these services and what models they offer.

06:44.550 --> 06:48.590
Under documentation click on models.

06:50.670 --> 06:53.630
And you can see all the models they they host.

06:56.470 --> 06:58.070
So we are interested in this one.

07:02.390 --> 07:07.710
You can even use their API for free for some time on the free plan, which is great.

07:08.550 --> 07:10.030
Now go back to N810.

07:15.110 --> 07:20.350
Create new credential and paste your API key right here.

07:22.150 --> 07:22.790
Hit save.

07:32.750 --> 07:35.110
Now you will have access to all the models.

07:36.110 --> 07:42.990
So just select Dopesick or one distiller llama seven TB.

07:45.430 --> 07:46.550
And you are all set.

07:47.150 --> 07:52.670
We want the planner agents output to be retained and passed to the research agent.

07:53.430 --> 07:56.670
So we need to add some kind of memory.

07:57.710 --> 08:00.230
So let's add the window buffer memory node.

08:00.790 --> 08:02.990
So click on this small plus button.

08:05.670 --> 08:10.860
Select window buffer memory, which is the easiest way to give our agents a memory.

08:14.260 --> 08:23.100
Let's keep the context window length to five, which means our agent will be able to remember the five

08:23.140 --> 08:24.300
last interactions.

08:25.420 --> 08:26.300
Let's close it.

08:32.780 --> 08:35.820
Now let's set up our research agent.

08:37.060 --> 08:40.140
So click this plus button to add nodes.

08:41.420 --> 08:43.740
Search for agent again.

08:46.180 --> 08:47.380
Let's rename it to.

08:50.220 --> 08:51.260
Research agent.

08:59.660 --> 09:00.420
Confirm.

09:02.380 --> 09:03.620
And let's close it for now.

09:08.330 --> 09:11.810
Let's get rid of this friend chat.

09:11.850 --> 09:12.770
Message received.

09:12.810 --> 09:13.650
Trigger note.

09:23.250 --> 09:29.810
Now we also need to decide which large language model we want to use for the brain of our research agent.

09:37.250 --> 09:41.330
I want to use OpenAI's GPT four.

09:45.450 --> 09:50.770
For this tutorial, we'll use GPT four mini because it's fast and cost effective.

09:51.370 --> 09:52.290
Let's close it.

09:56.290 --> 10:01.890
Now we need to give our research agent access to some tools.

10:01.890 --> 10:06.810
In that case, we need to connect it to CEP API.

10:07.720 --> 10:09.400
So click on this plus button.

10:10.920 --> 10:12.800
Search for Serp API.

10:14.520 --> 10:20.200
Serp API basically allows the agent to search the web.

10:23.000 --> 10:24.280
So select this node.

10:26.920 --> 10:34.680
Now we need to create an account and provide credentials to connect our account to this node.

10:35.760 --> 10:39.360
So click on this dropdown Create new credential.

10:40.320 --> 10:42.920
As you can see we need API key.

10:44.040 --> 10:45.840
So go to Serp API.

10:47.960 --> 10:50.000
And you will land on this page.

10:51.520 --> 10:58.360
So this tool allows to scrape search engines using the API service.

10:59.560 --> 11:00.680
Create an account.

11:01.640 --> 11:03.080
Go to API key.

11:07.640 --> 11:12.510
Create your API key, copy it and paste it into an A-10.

11:14.270 --> 11:16.030
So we need to create a credential.

11:19.030 --> 11:20.310
And paste it right here.

11:21.870 --> 11:22.910
Then click save.

11:23.590 --> 11:25.910
And it should show as successful.

11:26.230 --> 11:32.710
Now that we have set up the planner agent and research agent, let's complete the workflow by integrating

11:32.710 --> 11:35.790
WhatsApp so you can communicate with your planner agent.

11:36.310 --> 11:40.110
So now I'm going to play a video on how to do it in a few minutes.

11:40.670 --> 11:46.950
Before we jump into configuration, just quickly to give you some insights, why using WhatsApp as a

11:46.950 --> 11:52.110
communication channel is so important, and why almost every business should use it.

11:52.310 --> 11:56.870
Did you know that WhatsApp is one of the fastest growing communication channels for businesses?

11:57.430 --> 12:04.230
Over 50 million businesses are already using WhatsApp to connect with their customers, and the app

12:04.230 --> 12:06.470
has over 3 billion users globally.

12:07.150 --> 12:18.590
WhatsApp messages have a 98% open rate, compared to just 21% for email, and 68% of users say WhatsApp

12:18.590 --> 12:20.510
is the easiest way to reach a business.

12:21.070 --> 12:26.710
It's less common in the US but is very popular in Europe, South America and Asia.

12:27.270 --> 12:29.270
Now let's move on to the integration part.

12:29.870 --> 12:33.110
First, we need a trigger to activate our workflow.

12:33.630 --> 12:36.830
So we'll start with the WhatsApp business cloud node.

12:37.510 --> 12:39.430
So search for WhatsApp.

12:41.510 --> 12:43.150
Choose WhatsApp Business Cloud.

12:45.230 --> 12:46.750
And choose on messages.

12:48.550 --> 12:56.870
Basically this node acts as a trigger it listens to for incoming messages on your WhatsApp account.

12:57.950 --> 13:02.430
Now we have to set up credentials to connect to our WhatsApp business account.

13:05.710 --> 13:13.700
So we will need our client ID and client Client's secret, so we need to get it from Facebook business

13:13.700 --> 13:14.260
account.

13:14.500 --> 13:17.100
Since WhatsApp business is managed under meta.

13:17.420 --> 13:22.660
So go to business.facebook.com and log in with your Facebook account.

13:23.300 --> 13:28.180
If you are already logged in, it will take you to your Business Manager dashboard.

13:28.860 --> 13:34.100
If you have never used Facebook Business Manager, you will need to create a business portfolio.

13:34.620 --> 13:43.580
So go to business facebook.com slash settings and provide all the required details like your business

13:43.580 --> 13:48.820
name, email and any other information requested and click Create Business.

13:49.620 --> 13:52.700
Now choose the business portfolio you have created.

13:59.220 --> 14:05.580
And in your Business manager, look for the account section on the left hand menu and click apps.

14:09.460 --> 14:13.170
Now click add and create a new app ID.

14:17.050 --> 14:19.210
Here you have to provide an app name.

14:19.610 --> 14:23.370
So let's say an app contact email.

14:28.130 --> 14:28.810
So.

14:31.210 --> 14:32.410
Then click on next.

14:33.250 --> 14:34.130
Scroll down.

14:36.170 --> 14:36.570
Choose.

14:36.610 --> 14:37.050
Other.

14:38.490 --> 14:39.130
Next.

14:45.730 --> 14:46.410
Business.

14:46.610 --> 14:47.170
Next.

14:49.410 --> 14:50.850
And create the app.

14:52.130 --> 14:53.970
Now click on the app you created.

14:55.570 --> 14:56.490
App settings.

14:58.770 --> 14:59.530
Basic.

15:06.650 --> 15:09.970
If you remember, we are looking for an app ID and app Secret.

15:10.810 --> 15:12.440
So this is our app ID.

15:14.160 --> 15:14.840
Copy it.

15:17.120 --> 15:18.240
Go back to Nan.

15:20.800 --> 15:21.560
Paste it here.

15:23.920 --> 15:27.880
Show up secret then copy up secret.

15:30.280 --> 15:33.640
Paste it here and test connection.

15:34.360 --> 15:39.480
So now let's set up WhatsApp node to send replies back to the user.

15:40.520 --> 15:46.160
So this will allow your agent to respond to messages automatically.

15:48.360 --> 15:49.880
Search for WhatsApp.

15:53.360 --> 15:56.320
And choose send message node.

16:00.600 --> 16:04.440
Now you have to provide access token and business account ID.

16:07.720 --> 16:11.480
So let's go back to our Business Manager account.

16:12.440 --> 16:14.200
go through API setup.

16:25.240 --> 16:34.400
And here you have to generate access token and then copy this access token to place it here.

16:35.760 --> 16:38.200
And you can find business account ID.

16:40.920 --> 16:45.520
Right here just copy it and paste it here.

16:50.480 --> 16:53.800
Then hit Test Connection.

16:54.680 --> 16:55.680
Just the last step.

16:55.680 --> 16:59.360
You need to choose your business mobile number.

17:01.920 --> 17:04.880
Or you can use the test number to test the connection.

17:06.600 --> 17:13.790
Now a key part of building AI agents is giving them a clear, well-designed prompt to guide what they

17:13.790 --> 17:15.190
do and how they respond.

17:15.550 --> 17:21.590
I've put together prompts for both agents, and I will share them with a template so you can easily

17:21.590 --> 17:22.830
copy and paste them.

17:23.790 --> 17:26.150
Let me just quickly show you what it looks like.

17:26.750 --> 17:28.870
So for our planner agent.

17:31.870 --> 17:40.350
You might say something like you are an AI planner agent responsible for generating structured, actionable

17:40.390 --> 17:41.230
task plans.

17:41.550 --> 17:48.270
Your goal is to break down objectives into clear steps that guide execution and instructions.

17:50.030 --> 17:51.790
And for our research agent.

17:55.270 --> 17:56.990
The prompt is more complex.

17:58.910 --> 18:05.590
So the role instructions use API to search for relevant results.

18:10.910 --> 18:13.550
Avoid special characters, etc..
