**How to Build a Personal Assistant AI Agent in n8n (Step-by-Step, No Code) — Transcript & Summary | SozAI**
Source: https://sozai.app/transcript/build-personal-assistant-ai-n8n/

Learn how to build a no-code personal assistant AI agent in n8n using Telegram, GPT-4, calendar, and email integrations.

## Key Takeaways

- n8n can be used to build powerful AI personal assistants without coding.
- Telegram integration allows natural voice and text interaction with the assistant.
- GPT-4 serves as an effective AI model for managing multi-tool workflows.
- Memory and session management are crucial for maintaining conversation context.
- The workflow is modular, allowing addition of various agents like calendar and email.

## What the video covers

- Demonstrates creating a personal assistant AI agent in n8n that handles calendar events, emails, and retrieves calendar data.
- Uses Telegram as the interface for voice and text commands to trigger the assistant workflow.
- Integrates GPT-4 as the AI brain to process requests and decide which tools to use.
- Shows step-by-step setup of triggers, memory management, and tool agents within n8n.
- Explains how to configure session IDs for memory persistence when using Telegram triggers.
- Builds multiple agents including calendar, email, and research agents to extend assistant capabilities.
- Includes testing and debugging tips to ensure accurate data handling and responses.
- Provides resources such as free and paid community links and offers custom automation services.
- Emphasizes no-code approach making AI automation accessible without programming skills.
- Shares workflow files and code snippets in the creator's community for easy replication.

## Chapters

1. 00:00 Introduction and Demo of Personal Assistant AI
2. 03:24 Configuring Chat Triggers and Session IDs
3. 06:56 Adding Google Sheets Tool for Data Handling
4. 10:45 Creating Email Agent Workflow
5. 14:47 Testing Queries and Data Pinning
6. 18:39 Using AI Models and Memory Setup
7. 22:55 Configuring Email and Calendar Agents
8. 29:42 Adding Research Agent and Final Testing
9. 33:35 Summary, Resources, and Community Links

Answers

## Questions about this video

How does the personal assistant handle calendar events?

The assistant creates calendar events based on user requests, sends confirmation emails, and retrieves remaining calendar events for the day using integrated calendar and email agents.

What AI model is used for processing user requests?

GPT-4 is used as the AI brain to interpret user commands, decide which tools to use, and generate accurate responses within the n8n workflow.

How is memory managed to maintain conversation context?

Window buffer memory is added in n8n to store previous messages, with session IDs configured based on Telegram chat IDs to maintain context across interactions.

## Full Transcript — Download SRT & Markdown

00:01

Speaker A

Hey personal assistant, can you please create a calendar event for tomorrow with Michael Scott at noon for a meeting? And then can you email him to confirm if that time works? And then finally, can you grab all of my calendar events for the rest of today? Thanks.

00:11

Speaker A

rest of today thanks okay so we just sent that off to telegram it's transcribing that audio it's now hitting the personal assistant and the assistant is going to take the contact information it's going to create that calendar event

00:22

Speaker A

Okay, so we just sent that off to Telegram. It's transcribing that audio. It's now hitting the personal assistant, and the assistant is going to take the contact information. It's going to create that calendar event with Michael Scott. Now it's going to hit the email agent so that it can send out that email to confirm if that time works. And then finally, it should come back to us with a text message as well as a voice file or an audio file that's going to be telling us about what we asked for.

00:32

Speaker A

voice file or an audio file that's going to be telling us about what we asked for so here's the information the C rent was created the email was sent we've got our information about the remaining events for today and now as you can see that

00:44

Speaker A

So here's the information: the event was created, the email was sent, we've got our information about the remaining events for today, and now as you can see, that audio file is being created. So let's listen to that real quick. A calendar event has been created for a meeting with Michael Scott scheduled for tomorrow, November 29th, 2024, from 12:00 p.m. to 1:00 p.m. An email confirming the meeting time was sent to him. Today's remaining calendar events include a meeting with Michael Scott from 12:00 p.m. to 1:00 p.m., dinner from 5:00 p.m. to 6:00 p.m., and dinner with Michael Scott from 7:00 p.m. to 8:00 p.m. If further assistance is needed, please let me know.

00:58

Speaker A

meeting time was sent to him today's remaining calendar events include a meeting with Michael Scott from 12:00 p.m. to 1:00 p.m. dinner from 5:00 p.m.

01:07

Speaker A

Awesome, so that's how this works. So the agent that we just saw right here, we're going to be jumping into the build. So let's get into the video.

01:19

Speaker A

into the build so let's get into the video all right so now we are going to get into the actual step-by-step tutorial for the demo you just saw of the personal assistant so we opened up a new workflow as you can see we've got

01:29

Speaker A

All right, so now we are going to get into the actual step-by-step tutorial for the demo you just saw of the personal assistant. So we opened up a new workflow. As you can see, we've got personal assistant set by step, and we are just going to start building out this agent. So first thing we want to do, obviously, we're going to grab the actual agent. So we're going to grab an AI agent here, and we're going to leave this as a tools agent. We'll get into the prompting of this guy sort of as we start to add more tools, but that's all we got to do to start with. So as you saw in the demo, we were talking to this agent through Telegram, so we're just going to go ahead and get rid of this trigger real quick, and we're going to add a Telegram trigger. So we've got different triggers, we've got different actions, but we are going to do a trigger of on message received so that way anytime that we text our Telegram channel, it will basically start this workflow for a personal assistant.

01:40

Speaker A

tools agent we'll get into the prompting of this guy sort of as we start to add more tools but that's all we got to do to start with so as you saw in the demo we were talking to this agent through

01:49

Speaker A

Just a quick reminder as always, the workflow for this whole assistant and the other agents that we're building out today will be in my free school community. The link for that will be down in the description. And then if you're looking to get a little more hands-on, you're looking to go further with automations with n8n, then feel free to check out my paid community. The link for that will also be down in the description. And then finally, if you're looking for some sort of assistant, if you're looking for automations, if you want me to build out some of the stuff for you or for your business, then go to my website down linked in the description and book a call, and let's chat.

01:59

Speaker A

received so that way anytime that we text our telegram Channel it will basically start this workflow for a personal assistant just a quick reminder as always the workflow for this whole assistant and the other agents that we're building out today will be in my

02:13

Speaker A

Anyways, back to the build. What we want to do now is add the chat model. We have to add the brain for this assistant so that it can, you know, think about what we're asking it, it can think about what agent it needs to go to, what tool it needs to go to, and then it will ultimately give us a response. So in this case, I'm going to be using GPT-4 just because, you know, it's going to have a ton of different tools connected to it, and we want these responses and, you know, the sending of data across workflows to be as accurate as possible. So I'm going to go with GPT-4 here.

02:22

Speaker A

link for that will also be down in the description and then finally if you're looking for some sort of assistant if you're looking for automations if you want me to build out some of the stuff for you or for your business then go to

02:31

Speaker A

Now we're going to add memory so that when we're talking to this assistant, it has context of previous messages. So we'll click on this plus, we're going to add window buffer memory because it's super easy. It's going to store this memory in n8n, and it's super easy to set up. But one thing that you have to do here is we have to set up the session ID because if you leave it like this, it's not going to work. Because it's looking for basically, this would work if you're chatting with it through a chat trigger. So if we go to a chat trigger right here and we connect this, if we chat with this agent through the trigger, we just say this now, it will go to the window buffer memory because we have it configured to take from the previous node automatically. And in this case, it's coming through as, you know, JSON dot text or something, or chat ID.

02:41

Speaker A

assistant so that it can you know think about what we're asking it it can think about what agent it needs to go to what tool it needs to go to and then it will ultimately give us a response so in this

02:52

Speaker A

Anyways, if we're to do this with the Telegram trigger, so if I click, um, let's just get rid of this, we hit test workflow, hello, and then I pull up my Telegram real quick and we just say hello, it's going to go through, but it's not going to actually store in the window buffer memory. So what we need to do is we need to see how the chat's coming through from our Telegram. We can see that it's coming through right here. Let's go to schema actually, and we can see it's coming through as the chat ID. So all we need to do in here is instead of setting this from take previous node automatically, we're going to define it below. It's going to be an expression, and we're going to be pulling that chat ID from the Telegram trigger. So we'll click on Telegram trigger. What we need to do is go to item.json.message.chat, and then we go to ID. So now we have that ID in there. As you can see, that is what's being stored as the key for our session ID. We'll hit save, test this workflow again, we'll come into here in Telegram and say hello, and oops, no prompt specified.

03:04

Speaker A

going to go with foro here now we're going to add memory that way when we're talking to this assistant it has context of previous messages so we'll click on this plus we're going to add window buffer memory because it's super easy

03:14

Speaker A

Okay, we have to do this also. We also have to define where we're getting this from. So the text that's coming into our agent is no longer the chat input that's coming from a chat trigger. What we're wanting is the text that's coming in from Telegram, so chat.text down here. We'll drag this in here, and now we're getting the actual message. We can hit test step now, and we can see that it's being stored in the window buffer memory. So in the past videos, I've had some people ask questions about that. That's all you have to do. You have to define the agent where it's getting the message, and then you have to define for the window buffer memory what channel it's being stored in. So that's how that works.

03:24

Speaker A

work um because it's looking for basically this would work if you're chatting with it through a um a chat trigger so if we go to a chat trigger right here and we connect this if we chat with this agent through the trigger we just

03:39

Speaker A

Another thing I'll touch on real quick is with the actual Telegram trigger. If you're having trouble connecting your credentials, once you create a new credential in here, you basically just need to get your access token, and then you can see you have this URL. So in Telegram, all you're going to do is you're going to set up, you're going to talk to—let me pull up my Telegram real quick. If I just expand this a little bit more, if I go back here, you'll have your BotFather, and so you'll go into your BotFather, and that's how you can get your access token. You'll have to plug in some credentials. It's not super difficult at all. If you are having trouble, you can click CLI on open docs right here. It'll walk you through exactly how to set up your, you know, your API, get your bot access token, you'll talk to BotFather, you'll enter this command, and it's super simple. So then once you get that set up, you'll just pretty much plug it in, and then you'll be good to go for the rest of the time that you want to talk to Telegram in n8n.

03:49

Speaker A

text or something so or chat ID anyways if we're to do this with the telegram trigger so if I click um let's just get rid of this we hit test workow hello and then I pull up my telegram real quick and we

04:04

Speaker A

All right, we have the brain for the agent, we have the memory for the agent, and now we're going to start adding on the tools. This is where the magic really happens. So the first thing we want to do is we want to get a contact database into our agent so that it has access to different email addresses, different phone numbers in case we want to send a text, an email, calendar invite, that sort of stuff. So in this case, we're just going to be using a Google Sheet. You could do a contact database in Airtable, you could do it into Pinecone if you had a big repository of...

04:15

Speaker A

we can see that it's coming through um right here let's go to schema actually and we can see it's coming through as the chat ID so all we need to do in here is instead of setting this from take

04:25

Speaker A

previous note automatically we're going to Define it below it's going to be an expression and we're going going to be pulling that chat ID from the telegram trigger so we'll click on telegram trigger what we need to do is go to

04:36

Speaker A

item. Json message. chat and then we go to ID so now we have that ID in there as you can see that is what's being stored as the key for our session ID we'll hit save test this workflow again we'll come

04:51

Speaker A

into here in Telegram and say hello and oop no prompt specified okay we have to do this also we also have to Define where we're getting this from so the text that's coming into our agent is no longer the chat input that's coming from

05:04

Speaker A

a chat trigger what we're wanting is the text that's coming in from telegram so chat. text down here we'll drag this in here and now we're getting the actual message we can hit test step now and we can see that it's being stored in the

05:16

Speaker A

window buffer memory so the past videos I've I've had some people um ask questions about that that's all you have to do you have to define the agent where it's getting the message and then you have to Define for the window buffer

05:26

Speaker A

memory what channel it's being stored in so that's how that works Works another thing I'll touch on real quick is with the actual telegram trigger if you're having trouble connecting your credentials once you create a new credential in here you basically just

05:37

Speaker A

need to get your access token and then you can see you have this URL so in telegram all you're going to do is you're going to set up you're going to talk to let me pull up my telegram real

05:46

Speaker A

quick if I just expand this a little bit more if I go back here you'll have your Bot father and so you'll go into your Bot father and that's how you can get your access token you'll have to plug in

05:55

Speaker A

some credentials um it's not super difficult at all if you are having trouble you can click CLI on open docs right here it'll walk you through exactly how to set up your you know your API get your Bot access token you'll

06:06

Speaker A

talk to botf Father you'll enter this command and it's super simple so then once you get that set up you'll just pretty much plug it in and then you'll be good to go for the rest of the time

06:14

Speaker A

that you want to talk to telegram um in nadn all right we have the brain for the agent we have the memory for the agent and now we're going to start adding on the tools this is where the magic really

06:24

Speaker A

happens so the first thing we want to do is we want to get a contact database into our agent so that it has access to different email addresses different phone numbers in case we want to send a text an email calendar invite that sort

06:35

Speaker A

of stuff so in this case we're just going to be using a Google sheet you could do a contact database in air table you could do it into pine cone if you had a big um repository of contact

06:46

Speaker A

information you could put that into pine cone a vector database in this case we're just going to be using Google Sheets to keep things simple and as you can see we have information here and this is what we're going to be giving

06:56

Speaker A

our agent so that it can reach out to the correct people so we're going to click on this Plus for Tool we're going to grab a Google Sheets tool you'll have to connect your account here it's very simple you can also click on docs and

07:07

Speaker A

you can figure out how to you know go to Google Cloud set up your your credentials your ooth consent screen all that kind of stuff um and I've also walked through that in other videos like the N Master Class other videos on my

07:18

Speaker A

channel like that but anyways what we're doing here is we want to connect the right document so we're going to grab um this one's called Contact database the sheet there's only one sheet so now that it knows it's pulling the information

07:32

Speaker A

from here we can leave all of this as is we're getting rows all that kind of stuff so we're just going to rename this our contact database Okay so we've got that information into here that's super simple to set up and now we just want to

07:47

Speaker A

make sure that um all this information is working so let us really quickly test the workflow we'll basically just come back into our personal assistant and we will say um can you get me Nate herk email and so this is

08:05

Speaker A

actually not going to send anything back to us in telegram because we haven't set that up yet as you can see but it went through the logic and then the agent would actually be responding Nate herk's email is Nate herk 88@gmail.com as you

08:17

Speaker A

can see it sent over this query to the Google sheet and in here it pulled NK and it found its email and then sent that back to us so real quick what I'll do is we'll just set up the

08:30

Speaker A

message that way for the rest of the time we're testing it's actually going to come back in telegram so we're going to add something after the agent because typically it's going to get a query it's going to figure out what it needs to do

08:41

Speaker A

it's going to hit the specific tools and then it's going to output something over here as you can see one item was output and we want this output to go to telegram so we're going to grab telegram this time we're going to do an action so

08:51

Speaker A

down here we will see message actions and we will see send a text message so at this point we have our Telegram account already connected so we're good to go here now we just need to configure what this note is going to do so we're

09:04

Speaker A

going to be sending a message the resource is going to be a message as you can see there's files there's other stuff we can send we're sending a message and now we need to set up our chat ID and what the message is going to

09:14

Speaker A

be so because we have our trigger connected it's really simple we'll click on telegram trigger over here in schema and we're going to be looking through this information and we're looking for chat ID so the exact same thing that we

09:25

Speaker A

gave our window buffer memory we're going to give that to telegram so it knows what you know Channel it wants to send this message back to so we can grab right here chat ID we'll drag it right in there and it's as simple as that we

09:37

Speaker A

are now set up and then we just need to configure what text is actually going to be coming through through the telegram so text right here all we have to do is we just want what whatever the agent's

09:47

Speaker A

saying that's what we want so we're going to grab the output from the AI agent drag that into there and now we can see we have our Channel setup and we have our um text setup so if I hit test

09:58

Speaker A

step pull up Telegram now we got that information Nate herk's email is nerk 88@gmail.com and then we also got this this message was sent automatically with NN what we can do is go to add field append nadn attribution and then just

10:11

Speaker A

flick that off we'll test that again open up Telegram and now we got that message in telegram but we didn't get that attribution so it's really clean that's exactly how we want it and we've pretty much got this guy set up we'll

10:22

Speaker A

just name this um response and now we can see we have our telegram trigger and then we have our AG agent and it will be actually responding to us in telegram so we've got this kind of foundation set up now let's continue

10:35

Speaker A

to add more tools okay what we're going to add now is an email agent so what we're going to do is we're going to go open up a new tab we'll go back to the home screen of nadn then we're going to

10:45

Speaker A

add a completely new workflow so once this loads up we'll click add workflow and this one is going to be an email agent so now we have an email agent that we're going to be plugging into our personal assistant so the first

10:59

Speaker A

thing we have need to do is add the trigger which is going to be when called by another workflow so this workflow is going to be called by our personal assistant whenever we ask can you send an email can you get my emails that sort

11:10

Speaker A

of stuff so this is the agent that's going to have all the actions within um our Gmail so we're going to add an AI agent once again um we are going to just call this guy the email agent it's going to be a

11:26

Speaker A

tools agent we'll get rid of this chat trigger because that's not how we're going to be interacting with this agent and once again we're going to set up our chat model for this one we'll use 4 because it's only going to have a few

11:37

Speaker A

tools um we don't need to give this guy any memory really and now we just have to add tools to this agent that is going to be a tool for the personal assistant so what we want to do is grab Gmail and this is

11:49

Speaker A

really cool because within Gmail we have a ton of different actions we can take and we're going to keep this this agent very simple just like we did in the the personal assistant 2.0 video but still use cool use cases of what it can do so

12:01

Speaker A

this first one let's just do sending an email so call this guy send email we've got our Gmail account connected um we want to be sending a message and now we need to configure the two the subject the email type and the

12:15

Speaker A

actual message that's coming through so what we're going to do is we're going to use this cool expression called from AI if you want to go more in depth a little bit of how that's going to work you can

12:23

Speaker A

feel free to watch my video I'll tag it right up here where I dive into this actual function but it's just a really cool way to have a interpret an incoming query and actually send out messages on our behalf filling in these fields

12:34

Speaker A

automatically so um the first one we're going to do is the actual two field so in here we're going to grab um from Ai and we are going to put in the key of what what this from AI is looking for and this is

12:49

Speaker A

just going to be we'll just say email address and then I want to Define actually we need we need to throw the quotes in there so we've got email address and then I actually want Define what that means just in case

13:02

Speaker A

so the email um address we are sending to Okay so we've got that set up um we need to do the same a very similar thing with our subject so we're going to come in here also do from

13:17

Speaker A

Ai and then this time we're just going to say subject and we can leave it as simple as that we want to change the email type to text and then in the message we are going to do once again

13:27

Speaker A

from Ai and we are going to say um email body and so this really should work we will test this out of course first thing I want to do is we want to go to append attribution we want to turn that

13:42

Speaker A

off and then in this case we can add a sender name so um let's say you know we're always going to be sending from from me because this is my personal assistant so I'll I'll put Nate in here

13:53

Speaker A

um and this won't actually always sign off the email this is basically just saying when it comes through in Gmail who is it going to be sent for so we'll see that in action we'll save this and then real quick let's come in here and

14:05

Speaker A

we'll just test out what this stuff's going to look like so if we come in here and we put in the query because when um when the personal assistant is going to be sending information to the email agent that we're building right now it's

14:20

Speaker A

going to send off a query so we're just kind of putting in Sample information of what a query could look like so let's say that we asked can you send an email to um Nate herk and then also it would

14:34

Speaker A

be giving that email because the personal assistant is grabbing the contact data and then it's forming a query to send over to the email agent in this case it's already gone and got my email so it would send that over as

14:47

Speaker A

well and we'll just say asking what's up so that's the query that we're going to be testing we this data will be pinned so now we can come through and test this information um and we will pretty much just be testing this

14:59

Speaker A

send email function so we can see how information is coming back we'll hit run um no prompt specified okay so once again we can't just be taking it from previous node we have to Define below and what we're grabbing is json. query

15:11

Speaker A

as you can see now it's coming through and now we'll test up we'll see it's going to hit the send email tool okay so we're airing let's see what's going on here provided authorization okay so I just need to refresh my credential let

15:25

Speaker A

me just log in and do that real quick so good learning opportunity right here if you have your off credential set as just a test app and you put in your information I think those credentials expire every you know few days so you

15:36

Speaker A

just have to log in and do it again but if you publish your app then you should be good to go so anyways this information filled out automatically right so we got the query that was can you send Nate herk an email all this

15:46

Speaker A

kind of stuff and so now this automatically filled that in so it grabs the the two which is Nate herk 88 it grabbed a subject it made a subject what's up and then it made an actual message which as we can see the message

15:57

Speaker A

was hey Nate just wanted check in see what's up with you hope all is well best your name so the reason it signed off as your name is because we just haven't prompted it the sender name as you can

16:06

Speaker A

see we filled out down here is going to be sort of a static sender name in our Gmail so let's open up the email um refresh this and we should see the email that we just sent off so we got what's

16:17

Speaker A

up um so you can see right here this is this is the Nate that's what we put in the sender name but if we wanted to actually sign off we have to prompt the agent so um really quickly what I'm

16:28

Speaker A

going to show you is a cool GPT that you can use if we come into here and we just say an agent who um sends or no who who takes action in Gmail it should sign off all emails

16:48

Speaker A

from Nate never using placeholders okay so we we set that off really easy it's a super simple prompt shout out to Tyler um who showed me this gbt super awesome great work Tyler but anyways it's gonna make it a super cool

17:07

Speaker A

Sim system prompt for you and it's going to be in markdown so the agent going to understand like you know the headers all this kind of stuff so we've got that really quick we'll copy that go into our email agent and we will

17:20

Speaker A

add a system message and then we can come in here paste that in and so now it's going to be signing off as Nate so let's save that let's try this one more time it's going to send us another email I'm

17:31

Speaker A

going to pull up the email in here refresh this and so now at the bottom you see it's signing off best regards Nate so that's sort of how that's going to work let's go back into the email agent and let's add another Gmail

17:47

Speaker A

tool this time we are just going to be so you can see there's you can expand off this agent give it tons of different actions you can add labels you can delete messages you can Mark stuff as unre you have you could basically add a

17:58

Speaker A

tool for all these functions in this case let's just get many emails okay so we have to set up the limit we have to set up um we want to be asking like who they're coming from so we'll say sender

18:09

Speaker A

and as you can see there's different ways you could filter you know um you could filter by date you could filter by the status all this kind of stuff so you could you know configure this to say um

18:19

Speaker A

if you wanted to get all emails from the past um you know five days you could come in here and you could set up the received after and the received before and you could have the from AI figure

18:28

Speaker A

out what it needs to do as far as you know um what filters to put in here but for now we're going to keep it simple we're just going to do a limit and we're going to um do a sender so in the limit

18:39

Speaker A

we're going to again use from AI okay let's get rid of all this we're going to be using from Ai and we're basically just going to be saying um limit and I think we should be good to go with that we'll test it out

18:52

Speaker A

and we don't want this to be simplified because this is going to return a simplified version of response instead of the raw data so in our use case in this example video it should be fine but basically it's going to cut off emails

19:03

Speaker A

so if you have long emails coming back and you don't want them to be simplified you want to get all the content of the email to come through then you're going to want to turn off simplify and then sender once again

19:14

Speaker A

we'll make this an expression we will do um from Ai and then we're basically just going to be saying the sender we need to put the quotes sender email ended off with quotes and we should be good to go here

19:29

Speaker A

and we'll just call this one get messages okay so we got this tool connected also and now let's come in here and change the query so um actually first what I want to do is I need to send some emails to this

19:46

Speaker A

inbox so that we can actually get them back so give me a sec to do that we now have two emails in the inbox um they're coming from a different email as you can see in here they're coming from up at

19:55

Speaker A

digital gmail.com which we have associated with Michael Scott so anyways that's why they're signed off Michael but they're coming through is Nate because my actual email is Nate anyways we have this email stuff coming back and now we're going to put a query in here

20:09

Speaker A

that says can you grab my past emails from Michael Scott and it would also at this point be getting that email so up at digital gmail.com and this is just um something that I like to do when I'm testing out

20:29

Speaker A

different workflows you put obviously the example query that would be coming through and then you can go ahead and test them so let's run this it's now understanding that it needs to get messages rather than send email and it should be giving us

20:43

Speaker A

basically a summary of those couple emails that we just um got back so we'll come in here and we'll see your current emails from Michael Scott so it pulled all this information back and there's actually a ton so um because in here

20:58

Speaker A

it's not just these these two we didn't set them as a filter to only pull back unread messages only pullback um messages from the past couple days and also if you remember in the query we just said past emails we didn't

21:11

Speaker A

say like past two so if I say can you grab my past two emails from Michael Scott now we'll run this again and it should be grabbing that limit because we put in you know the limit of how many

21:22

Speaker A

emails that we were asking for right here so now it says limit two from up a digital and now it's just basically making a summary of those email so right here we only have two emails email one was Project mountain and um

21:35

Speaker A

email two was want to grab lunch so if you can see right here we have project mountain and want to grab lunch so now we see the limits working we see um that it's getting it from the correct email

21:46

Speaker A

and then once you understand this concept you could come and start to add in more filters like if you only want to get you know certain dates if you want them to only be unread messages all that kind of stuff but this is just to give

21:57

Speaker A

you an idea of the found foundations of how these tools work within agents and how this agent is a tool for the overarching agent of the personal assistant so now all we need to do here is we want this agent to respond back to

22:10

Speaker A

the personal assistant so if we grab a set field and we just call this field response and all we have to do is drag in this expression which is the information coming back from um the email so we can see we have two emails

22:24

Speaker A

that's summarizing them and then this is this is what the the agent's going to get um so real quick we'll just call this response we'll hit save and so this workflow is called email agent demo now coming back

22:40

Speaker A

into the personal assistant we're going to add a tool and we're going to do call anded and workflow tool because we're calling a different um workflow this guy's going to be called email agent just copy this into here as

22:55

Speaker A

well call this tool to take action in email sorry about the cursor right there and so now we just need to configure which it is so you can choose from list you can choose by ID but list is really easy we can just come in here

23:09

Speaker A

and grab our um actually we might need to refresh this page because yeah we're going to have to refresh this page so save this refresh the page because um it wasn't refreshed since we made that new workflow called email agent demo so now

23:26

Speaker A

we can come in here grab email agent demo right there as you can see and this is where we set up the response earlier so the field that it's looking for once the personal assistant sends off a query to this AI agent right

23:40

Speaker A

here it's going to be looking for a field called response so that's why back in this workflow we set up this set field we called it response and then we gave it the answer which is the response so now it's looking for that and then it

23:52

Speaker A

will actually hit it and be good to go so if we test this guy from here um you know we'll we'll hit test workflow we'll come into Telegram and we'll say can this Emoji thing is annoying okay can you get my past two emails from

24:11

Speaker A

Michael Scott so just like the query put in as you can see it has to oh this actually might be an issue because it didn't grab the contact data so let's see what it said it looks like there are no pass emails from Michael

24:23

Speaker A

Scott in your inbox if there's anything else you need um let me know so what happened is it didn't understand that it had to first get the contact information from Michael Scott because then in the email agent it was just looking for you

24:35

Speaker A

know it didn't actually know who to go to so let's go into executions of this email agent um this is the one that we just hit off and we can see in here it doesn't have a um sender email it's it

24:47

Speaker A

just made up this sender email michael.sot example.com so that's why we need to prompt this guy to understand that it needs to look for contact database first so let me do the same thing I'll go into that gbt make a

24:58

Speaker A

prompt and then I'll be back in a sec okay made a super quick prompts using that GPT um we outlined the role we outlined its tasks we gave the tool overview and usage guidelines which is super important outlining what each tool

25:10

Speaker A

does when to use it and we basically had to tell it to use the contact database before going to try to send an email or you know make a calendar invite stuff like that and then at the bottom under

25:21

Speaker A

reminders you know we gave it examples too so showing how things should be done which is super important the process of it but then at the bottom we want to add another reminder that says here's the current date and time so we basically

25:31

Speaker A

just came in here and grabbed the function um dollar sign now and it would originally look like this which you know the computer can understand it but it looks ugly so if you type in format then you can grab this and you can change the

25:43

Speaker A

way that the date comes back so that's how that works we're going to hit test workflow that's now lising for us we're going to ask can you get my past two emails from Michael Scott we'll send that off off and now it should be

25:59

Speaker A

hitting the contact database before it actually goes to send that to send that information to the email agent now it's getting those emails it's going to respond to the personal assistant and then it should hit us back with a

26:10

Speaker A

message which is summarizing those two best emails so as you can see we now have email one email 2 which is exactly what we just saw and real quick we'll just test another one we'll say um we'll have it just send an email

26:21

Speaker A

real quick can you send an email to Nate herk asking him how the project mountain is going so same thing it will hit contact database it's going to grab Nate herk's email and then it will pass off that query to the email agent which

26:39

Speaker A

should send an email and then the personal assistant should let us know that it did that so the email has been successfully sent inquiring about project mountain and let's go to the email real quick refresh that so now we

26:50

Speaker A

got inquiry about project Mountain um hope message finds you well I wanted to check in see how project mountain is progressing all that kind of stuff so one thing I think is super important is before you start to add more tools you

27:01

Speaker A

want to play with the prompting you want to play with what's currently going on it's going to save you a headache down the road so now that we know that these functions are working we can now come in

27:09

Speaker A

and add a uh calendar agent that's the next one we're going to build so we're going to hop over to a new workflow um we know that this email agent is pretty much working well and like I said you would start to add more

27:19

Speaker A

tools onto here but now we're going to add a calendar agent so new workflow this one is going to be the calendar agent and First Step as always we're going to be calling it by a another workflow so we've got this

27:33

Speaker A

trigger we're going to add an AI agent and this one's going to be the calendar agent so I'll move a little faster on this one because it's going to be the same principles pretty much as that P one we've got our agent we will once

27:48

Speaker A

again we saw that foral mini worked fine for that that email agent so we'll go with foral mini again we don't need our memory and now we can just come in here and start to add the tools so our

27:58

Speaker A

accounts already Conn connected the first one we're going to do is going to be creating an event we are going to connect our calendar and now we just basically need to configure start time end time and then um an additional

28:09

Speaker A

property that we want to add is you know we can add attendees we can also add the summary which I think the summary is the actual title that shows up as the um what's it called as the title in calendar so this

28:23

Speaker A

is what we're going to do here and yeah let's just start filling in that from AI stuff so first what I want to do is add a sample query so we can play around with this data let's say that we asked the

28:35

Speaker A

calendar agent to set up a calendar event for 5: p.m for um dinner so we've got this and so if it comes through like this it basically means that we're just doing a personal calendar thing that we just want to block up some time um and

28:58

Speaker A

also you can notice here that we haven't specified an end time so all we're giving it is a start time and so this should be interesting because in this node which is creating an event um we have to give it a start time

29:12

Speaker A

and an end time so um from here we're going to do once again we're going to be using from AI which is awesome oops I don't know what just happened there we're going to be grabing from Ai and then we're just

29:24

Speaker A

going to say in quotes start time I'm pretty much just going to copy that and we're going to add that in here and then we're just going to say end time so this is something where in the prompting

29:38

Speaker A

of the actual agent in here this is where we want to say like if an end time isn't specified just assume it's going to be 30 minutes after the start time or an hour after the start time so we'll

29:47

Speaker A

play with that and for summary once again we're going to grab a from Ai and we're just going to say event title okay okay so we got this and we're pretty much just going to test it out um I'm not going to prompt

30:06

Speaker A

anything yet we'll just see what happens so we've got this we will hit oh once again we didn't specify so to find below we want to grab the query and now we'll hit save and now we'll run this again so

30:16

Speaker A

now it understands what we're asking it's going to create an event and um also I just realized okay this will be interesting to see let me pull up the calendar um I don't know where it created it because um we didn't give it

30:30

Speaker A

any sort of yeah so as you can see here it came through as 2023 October 10th so that's interesting but we can see that it made the end time an hour after so let me come in here and prompt this agent we

30:44

Speaker A

want to give it the current date and time so that it also knows when to make these events okay so we want to keep this prompt shorter straight to the point because it's a calendar agent and right now we're only going to give it

30:54

Speaker A

three tools so we're going to give it create an event create event with an attendee and then also to get events so we kept everything super simple and we gave it the current date and time and we're just going to leave it as this for

31:03

Speaker A

now so once again we'll try this we will see that it's going to hit the calendar event you can come in here and see now that it's getting it accurately this is the correct date this is the correct

31:12

Speaker A

start time um and then it called the event dinner so if we go into the calendar um there it is so 5:00 p.m. we have dinner that was just created um Thanksgiving dinner as you can see today is Thanksgiving but anyways um now that

31:26

Speaker A

that's prompted in we can add another tool so if if I can just copy and paste this event right here we are going to call this tool create event um with an attendee and so the reason that we're doing this in a

31:39

Speaker A

separate workflow is because we have this um option here for attendees and so if we were to do this as just one thing and it was not to invite an attendee it would leave this as null and then it would probably it

31:55

Speaker A

would fail on the calendar creation side of things and and so there are you know some options to get through this you can use specific operators like there are some cool operators um which I'm planning on making a video about like

32:06

Speaker A

some Advanced tips and this kind of stuff but like you can use um two question marks you can use two pipes and that sort of stuff will help you sort of almost dynamically tell if something's null you'll go with this but to keep

32:17

Speaker A

things simple in this personal assistant build we're just going to add two different tools and it's super simple so we're going to come in here and we're just going to basically say um um attendee and I think that that should

32:31

Speaker A

understand it if we are seeing that it's not working we will come in here and prompt after the key we'll give it a description but this should be working great so set a calendar event for let's now do 700 p.m. for dinner and we're

32:45

Speaker A

going to say with Michael Scott and it would also have included his email and now we'll test this out so we've got that prompted in already we'll hit it it should go to this one because it realizes that there's an attendee now

33:03

Speaker A

so that came through pop over to the calendar 7 PM dinner with Michael Scott so that's working as it should and now that we have these two tools we will add another calendar one and this one is going to be getting

33:15

Speaker A

events so right now we head it us create we are going to do get many um we're going to select the calendar once again and we'll return all but now we want to do after and before so when we're asking can you get events

33:32

Speaker A

from the past 3 days or when you're asking can you get events from today tomorrow we have to outline the parameters of you know it's going to go search calendar but which events you're going to be looking for so that's what

33:44

Speaker A

we need to set up here okay so we're going to call this one get events um and now this is going to be interesting so let's say we were asking for can you get my events from today the the filters we're looking for are

34:01

Speaker A

events after yesterday and before tomorrow so what we need to do in here is for after we're going to have the AI figure out um we're going to call this one day before and then we're going to outline

34:16

Speaker A

that this is one day before the date the user re requested and so we've got that copy this down and see the after or sorry the before and so now this is going to be one day one day

34:34

Speaker A

after and then we're going to just going to say one day after the date the user requested so if we're thinking about this logically we're asking for can you get my events from today and then it's going to be looking for any events that are

34:48

Speaker A

after yesterday and any events that are before tomorrow so we'll try this out see what it does in this query we're just now going to be saying get my events from today so we'll save that and we'll run

35:05

Speaker A

this see what it does it's going to be getting events and hopefully it filled in these correct parameters so we can see it did yesterday and tomorrow so that's working correctly and we can now see that we have our events from today

35:17

Speaker A

perfect November 28th we've got dinner at 5: and then we have dinner with Michael Scott at s which if you remember those are the events we just created so now that that's working um you know we see that we see the way that this is

35:30

Speaker A

going through and we see that it's pulling back the correct events and um yeah that's pretty much going to be it for the calendar agent except of course we need to add a response so that it's getting back to our agent so we're going

35:43

Speaker A

to add the field here we're going to call this one response and then we're just going to be dragging in this output once again call this response and then all we need to do is um come in here we're going to refresh

35:58

Speaker A

this because it won't have that workflow yet in its knowledge refresh the main agent we're going to add another tool called from another workflow this one is going to be called calendar agent we'll copy that we'll rename the

36:15

Speaker A

tool calendar agent as well call this tool to take action in calendar and I've had people ask me what is the difference between the description you put here and then the description of the tool in the prompt in the system prompts up here and

36:29

Speaker A

really it's not a huge difference the tools are outlining what's going on when you would call this but it's just best practice to also outline that in a tool section within the agent system prompt so we've got calendar agent demos the

36:40

Speaker A

one we just made it's returning response um and yeah let's just test it out we will hit test workflow and then we'll say make an event for tomorrow um with Michael Scott at okay we'll do from 6:00 p.m. to 8:00

37:06

Speaker A

p.m. and we'll just call it for a meeting okay so now it's going to do that it should grab the email so it's that's working well it's going to now hit the calendar agent and then it should respond to us with saying that

37:22

Speaker A

that event was created um it may even provide a link to the event which would be pretty cool obviously we can promp that stuff in but okay so the meeting with Michael Scott's been scheduled um project discussion November 29th 6:00 to

37:35

Speaker A

8:00 p.m. Michael Scott with his email and now let's hop into calendar and we can see right here it got created it got created twice because it did one for us and then one for the email invite with

37:45

Speaker A

uh with Michael Scott but that's great so um that is working and then real quick we'll just test can you get my events for tomorrow get my events from tomorrow so real quick just doing another test to make sure all our tools within our

38:02

Speaker A

calendar agent Works um you know that we we tested out queries but we want to see it working in action the full picture so make sure everything's working before we move on to the next tool and now we can

38:12

Speaker A

see we have two events scheduled for tomorrow like I said the project discussion events got duplicated so we would just have to go in there and fix that but everything's working as far as it's able to create an event it knows

38:22

Speaker A

when to do an event by just us and when to do one with a an attendee it also knows to grab their email so that way if we wanted to do something like um yeah actually let's do that real quick so

38:32

Speaker A

we're going to test this again we're going to say create an event for today at noon with Michael Scott and send him an email to confirm so we got that it should be hitting both tools we'll see it grab the

38:54

Speaker A

email um now it should be as you can see it's hitting both tools which is awesome it's going to send him an email it's going to create an event and then we'll check on both of those things so the

39:03

Speaker A

event should have been created let's just we'll just wait because I think it's really cool to just watch this stuff happen um so we've got the event today it's a meeting with Michael Scott you can view and manage the event here

39:13

Speaker A

so it gave us a link and then Additionally the email confirming has been sent to Michael Scott so in the calendar we've got the meeting right here and then let me pull up that email okay so I switched over to the other

39:23

Speaker A

email that's associated with Michael Scott and it said hi Michael just wanted to confirm that our meeting scheduled for today at noon looking forward to the discussion so that's that's a cool way we just show that it can use multiple

39:33

Speaker A

tools instead of just having to use one um and then you can really you know start to combine tool after tool and be able to text it like hey I I have these five tasks I need you to do can you

39:42

Speaker A

please do them all and it will go to them all so email agent calendar agent let's look at the next tool that we're going to add all right next agent we're doing is a research agent um this one is

39:51

Speaker A

just going to be able to answer questions it can search the internet it can search through articles it has Wikipedia as well um and just another cool use case it will be um this one setting this one up is a lot easier the

40:04

Speaker A

the email and the calendar ones are obviously the ones that you know when people are thinking of a personal assistant that's like what what comes most important to them so let me just put in assistant prompt real quick but

40:14

Speaker A

you know obviously in this video we didn't really go super in depth with those two um what are they called those two agents but the idea is just to to open your eyes to how you can give all

40:24

Speaker A

your agents different tools how you can um you know make make them more robust and really just making it that if you build out one email agent and you have all these different functions you can plug in this email agent to multiple

40:36

Speaker A

different workflows and it's just going to be really scalable really modular and um you know you can just basically reuse the same build and just improve on this workflow and it will just be able to plug in anywhere so that's sort of what

40:48

Speaker A

I wanted to show you guys with those two agents but now we have a research agent um we're going to set up this model real quick for Min is good um and then we're going to give it different tool TOS so the first one is

40:58

Speaker A

going to be Wikipedia this is going to be the first thing that we wanted to go through so as you can see sorry I didn't I didn't read this prompt basically what I said in here is your research assistant you have

41:09

Speaker A

Wikipedia Hacker News API and ser API and you first want to search Wikipedia if you can't find your answer then you're going to search articles with Hacker News and then if that doesn't work you'll use Ser API and we set it up

41:20

Speaker A

like this so that you basically can get all the answers you need in here but we don't always want it to be first going to surf API because um that one has credits and it's an API call and you don't want to burn through

41:35

Speaker A

all those so what we're doing is pretty much giving it almost like a tier system to do so in Surf API if you make an account you'll have a certain amount of free credits per month you'll just connect your API key

41:47

Speaker A

there um but yeah so this is pretty much the framework and then what we want to do in here is give it an expression so um that's what we want wanted to do so wait anyways we have to limit the articles

42:02

Speaker A

that it's going to come back so same thing this is such a cool a cool tool that we have is the from Ai and this is just going to say limit so that way we can limit the amount of Articles we want

42:12

Speaker A

back you could ask for five you could ask for 10 um whatever that is okay so the reason that the right field wasn't coming up the way I wanted it to is because now we're looking for all getting many um and now we just need to

42:25

Speaker A

basically set this stuff up again so um I don't know why it always does that but we're going to just do the same thing we're typing in our our limit here which is going to just obviously do its

42:37

Speaker A

thing and then we want to add the keyword which this is going to be another expression it's going to be another from AI we're basically just grabbing um this is how it's going to specify what type of Articles to look for so we should be

42:51

Speaker A

able to just go through like that so we've got Wikipedia Hacker News surf API um and then we're just going to give it the response once again which should be um an expression and I believe it's going to

43:09

Speaker A

be json. output okay so now we'll just test out this thing um yeah okay so let's actually just test this out with um telegram so we'll make this guy pretty much active we will come back into here refresh this page so we can

43:32

Speaker A

add our tool which is going to be that research agent that we just built and then we'll just test it out and we'll see if it goes through um you know Hacker News or what what it's coming through

43:45

Speaker A

so this is going to be the research agent um this in here call this tool to search the internet to answer the user's question we're going to choose the research agent and we're good to go so sorry I really like to make sure it's

44:13

Speaker A

like set up almost I like to make him sort of symmetrical but it's not perfect anyways um yeah we'll test this guy out so first if we just say something like what is the biggest mountain in the world maybe Tallis would have

44:30

Speaker A

been a better word but anyways okay so we got a already in the research agent um I wonder okay I've done this every time I think we need to Define below obviously and it's going to be json. query so um

44:48

Speaker A

hopefully you guys like you probably noticed when I was setting this up you're like oh it's going to fail because I've done that every time but anyways we can pretty much I I think we can just run that query again no it's

45:00

Speaker A

it's waiting okay okay interesting so I think what it did is that it was able to answer that just using its its open AI model right here which is pretty cool I don't know why that wasn't going okay it's listening for us but it

45:16

Speaker A

was able to answer that last time with the open AI chat model because it just has information but now it's hitting the research agent um and then we'll hop into the execution of the research agent so we've got the information about Mount

45:28

Speaker A

Everest I'm going to assume that this one just used um Wikipedia okay so it actually used all of them which is interesting so it got information here it probably pulled back some articles so that's not really what we wanted to be doing because it grabbed

45:45

Speaker A

five articles with highest mountain um and obviously it could have just answered that question with using Wikipedia so because it passed through the query of biggest mountain in the world so let's let's fix this up real quick to make sure that it's only using

46:00

Speaker A

what we want it to use okay so in the reminder we just said you should only be calling one tool never call all three tools if you can get an answer with just one and then we just gave it a reminder

46:09

Speaker A

of what the tools are so we'll just test it in here so we can see it happen live um let's ask it about like something where something trendy so what are the current trends with with um cryptocurrency so we've got that

46:31

Speaker A

query we'll test this guy out and see so now it's using surf API and it's going to respond back to us just using that one so that's perfect it's going to give us the current trends in the cryptocurrency bull market

46:44

Speaker A

emergence Ai and crypto all that kind of stuff that's perfect now let's ask something about um can you get me three articles about the um election so we'll go with that fire that off this one I assume we'll go to Hacker News it's just going

47:05

Speaker A

to use one tool perfect just the way we want it to and then respond back with those articles so it's also going to give us the actual link to each article which is cool so let's real quick just go back

47:18

Speaker A

into the personal assistant we will test the workflow and we'll say get me three articles about Finance so we've got that research agent it's going to give us those articles and then we'll just click on one of those links and see um you know

47:36

Speaker A

that we can actually go look at them which is going to be cool there we go so we've got um personal finance for engineers so if we open this link we've got this blog course material awesome and then of course you can click

47:51

Speaker A

on those other links which are right here so that's pretty much how the research agent is going to work so I don't want this tutorial to go super long but at this point you should understand how you can

48:03

Speaker A

build agents as separate workflows give them access to or give the personal assistant access to these different agents if you were to build on more it's super simple um once you've seen these it's just a matter of prompting them so

48:13

Speaker A

that it knows when to use them you could add on Vector store stuff like that too but now I want to show you guys something really cool which wasn't in the original build which is how you can make the agent understand an audio file

48:24

Speaker A

and also output back an audio file so you can talk to it and listen to it rather than having to text it all the time so what we're going to do we're going to drag this out over here um and

48:35

Speaker A

so as you see when we're texting with the agent we're getting back the actual text which is you know json. chat. text whatever and then we're feeding it into this guy as message.

48:46

Speaker A

text so what we want to do now is add a switch node so in here we have basically two paths that it's going to go down we're going to have one for voice um actually that want yeah we want to

49:00

Speaker A

rename it down here voice and that's how we want to do so we're going to have two paths right like I said one for voice and one for text so what we want to do is if text exists so

49:15

Speaker A

right here is a text message if this exists then it's going to go down this path right here called text and if it doesn't exist or not it doesn't exist but if a voice file exists um which actually we

49:30

Speaker A

could make it as simple as just this but if a voice file exists it's going to go down this path so how do we get this voice file we are going to have this listen for an event we're going to come in here and

49:42

Speaker A

just say hello testing so now we've gotten back in here a voice file and then what we can do in here is we see that we're getting this voice file rather than a text file so what we want to do is grab that voice file which

49:55

Speaker A

will be file ID right here and we're going to say well now if this one exists you're going to go down this route so we have two routes um in order to talk to our agent and so the first

50:06

Speaker A

thing we want to do is we need to make sure that this input right here is going to be consistent so it needs to always be called the same thing that way if it's a voice file or a text file we're

50:17

Speaker A

going to get it no matter what so we're just going to come in here and we're going to call this one I hate that it does that we're going to call this one um json. text and now we just need to map out and make

50:28

Speaker A

sure that each file coming through is going to be or each in output is going to be json. text so how we can do that with text is we're going to add a an edit field set we're going to map this

50:41

Speaker A

one um and just call it text and we'll drag in that that input real quick so I'm just naming this for organization so we're going to have this one setting as text and coming through and I'll show that in a sec but now if

51:00

Speaker A

it's a voice file the first thing that we need to do is actually download that file so we're going to go to telegram we're going to let's see chat actions file actions get a file right there so we're getting a file the operations get

51:14

Speaker A

resources file and then we need the file ID so if we can test this guy we'll see it's a voice file it's going to come up here and now the file ID is just pretty much down here which is what earlier we

51:24

Speaker A

said does the file ID exist so download voice file now we've got the file put in here we want to download it we test the step and now you can see it's going to come back over here um and

51:37

Speaker A

this is what we're looking for so now what we need to do with this file is we want to grab an open AI node and we're going to grab one that is going to transcribe a recording so we're

51:48

Speaker A

transcribing this one um transcribe audio we're transcribing recording in it's coming in from here and then we just I think we actually should be good with that so if we hit test it's grabbing the input data field data and we just said hello testing we

52:06

Speaker A

got that file coming back and as you can see it's coming back as json. text so we'll route this into here and now we can see in the personal assistant it's getting our message that said hello testing and now we just need to make

52:18

Speaker A

sure that it's going to get this message as well so now if we have this guy listening for us we will just say hello it got that file it understands that it's a text file now because we routed

52:31

Speaker A

it right here and then we'll run this guy and in here it took it didn't do it yet so we have to set it up it's going to take this input which is our text which is currently being called json.

52:43

Speaker A

message. text we'll test it now it's coming out as json. text and now our assistant is going to be getting that message regardless whether it's a voice file or a text file so that's super cool and now we

52:55

Speaker A

just need to Output over here here when we're getting an answer from the assistant that it's going to respond to us with a text message but also with a voice file all right so we've already got the text message coming through we

53:06

Speaker A

know that this works so let's drag it up here and now we need to go down another path which is going to obviously give us the information as a text file so first what we want to do is I'm going to use a

53:18

Speaker A

summarization chain because we don't exactly want um we don't want the exact text coming back what we want is a summary of it so that we can see the details but then visually or sorry um audibly we're just

53:33

Speaker A

getting a summarization so actually I don't know why I was going to rename that that's fine so we've got this um it will be summarizing the actual text that we would be getting back and then now with the summary we want to feed this

53:46

Speaker A

into a post request we're going to be sending it to 11 Labs which is going to be helping us make the actual audio file so HTTP request um we're going to be doing a post like I said and then we

53:58

Speaker A

need the URL we need to set up some headers and stuff like that so in 11 laps if you haven't made an account go ahead and make one real quick um I also want to mention that when I was testing

54:08

Speaker A

this kind of stuff I was on the free plan and I was getting some errors with like it was saying my credentials were incorrect so if you are experiencing those errors then you may want to try the starter plan which is only five

54:18

Speaker A

bucks and you get 40,000 credits which lasts a decent amount of time as long as you're not getting files like 2 minute long but anyways um if you're getting that error that may be why but once we're in here

54:29

Speaker A

we're looking at text to speech because we're going to be feeding it in text obviously and then it's going to be coming back with our um audio file so up here we click on curl and you could copy

54:41

Speaker A

this in and you could import your curl into NN but what we're going to do is just grab this this URL and so we're going to grab um actually yeah we can just grab this whole thing and we're

54:52

Speaker A

going to paste that in here but what follows the text to speech slash as you can see right here is the voice ID so if you go into voices in 11 Labs you can listen to these different voices um and

55:08

Speaker A

you can figure out which one you want I'm going to be using Ryan Kirk and then you're going to click on view you're going to click on ID and you've copied the ID so now all we have to do is after the text of

55:20

Speaker A

speech forward slash we just copy in that ID so now 11 Labs knows um which voice we want to use so we've got the that set up and now all we need to do is set up our our headers so with our and

55:30

Speaker A

our Json body but headers the first one that we have to do if you go back to the API documentation is our API key so it's going to be xi- api-key we'll grab that um paste that in there and then we

55:49

Speaker A

need the actual API key of course so we'll go back into um 11 Labs we will we will just basically create a new key this one will be called test we've got our value we copy that in and then we're going to paste that right

56:06

Speaker A

here just make sure there's no trailing white space anywhere and then we're going to add another header as you can see this header is content content-type so we'll grab that back and end it in that's our header name and

56:19

Speaker A

then the actual value is going to be application sljs so we paste that into there and so should be set up now we just need to set up the actual body what we're sending over to um 11 Labs so first what I want

56:33

Speaker A

to do is I'm just going to test this assistant because we want some actual data to be coming through so um I'm just going to say testing so now it should be going through it's probably going to respond

56:45

Speaker A

with something like you know we don't actually you know the assistant said if you're testing please let me know if there's any specific but now we have data coming through our summarization chain which is the speaker offers assistance and invites input so

56:57

Speaker A

now we have that information coming back we'll go into our send body we're going to be using Json expression and we'll open this up I want to paste that in here um and what we want is to make this

57:10

Speaker A

Json do let's see json. response. text and so now we have this and I will paste this code in here as far as the replace and the stringify I'll paste this in the free school Community as well link for that will in

57:26

Speaker A

the description go to ret YouTube resources and you can grab this um little code snippet as well as the workflows that were shown in this video but now we're just getting a nice clean string that will be sent over to 11 Labs

57:40

Speaker A

so it can turn this right here into audio so um let's actually just test this real quick and that went through okay it's it's being all weird because of the what's it called because of the multiple switch routes but

57:57

Speaker A

anyways from here we'd have an audio file and then once again it's just as simple as adding Telegram and we're going to be sending an audio file is the resource send audio file chat ID once again we're doing the same chat

58:11

Speaker A

ID from earlier which is going to be we get that from the telegram trigger we want item. json. message.

58:21

Speaker A

chat. ID there we go and this should be the correct one we can always just check that in here that we're getting the chat ID you could also just copy and paste that into there and send audio and then we just need the actual

58:38

Speaker A

audio it's going to be a binary file and so it should just be coming through as data um we should be good to go with that so let's do a test um let me just make this stuff a

58:51

Speaker A

little more concise so that we can see the stuff happening I like the way it does that that's fine that's fine okay anyways testing workflow we'll send over an audio file can you send an email to Nate herk um just checking in on his day

59:12

Speaker A

so now we're getting that file you can see it's being downloaded it's being transcribed the actual assist is now taking place it should be hitting the email agent okay it actually didn't so it had an inform it had an issue with my

59:24

Speaker A

contact data so we'll fix that in a sec but now we just need to make sure file name is needed to send audio um okay right so we have to add a file name and that's just going to be

59:37

Speaker A

data. MPEG hit test again okay and now we have to do that again so anyways this is the the beauty of the um almost sort of live builds but anyways let's see what the issue was I found it Nate herk in the database with

59:54

Speaker A

the email address nerk gmail.com H okay it's because it it transcribes my name as Nate herk with a u so let's just try something else let's say um can you send an email to Michael Scott checking in on his day so that's actually kind of

60:10

Speaker A

ridiculous with the transcribing um because it couldn't find Nate herk anyways so it's finding Michael Scott now it's going to hit the email agent um we should see it get summarized so there's the text and then the audio file

60:22

Speaker A

coming back should be a little different so we've got this the email to Michael Scott has been sent inquiring about his day okay awesome so that's pretty much how it works the way that you can talk to it you can see a detailed breakdown

60:37

Speaker A

um but then you also get something else back so if I said let's test this workflow can you summarize my calendar events for today so same thing it's going to get that information hit the right agent it's going to send us a text

60:54

Speaker A

that'll be a little more detailed but then the summary will be um well a summary that's kind of the whole point of the summary anyways so this the information we got back now it's creating that audio file for us and it

61:07

Speaker A

shouldn't be as detailed as we get here so let's listen to this we won't listen to the whole thing today's calendar events for November 28th 2024 include one asterisk asterisk meeting with Michael Scott asterisk asterisk okay so that was awful it was reading

61:25

Speaker A

off asterisk asteris we don't want that um I was trying to play around the sum with the summarization chain but what we're going to do is just um we're going to grab an open AI message model and basically when we're telling it to

61:38

Speaker A

summarize we're going to say like to make it as plain text we don't want any of the um you know Asters coming through so real quick am I able to yeah anyways we're just going to come in here um we grab foral mini and your goal

61:58

Speaker A

is just to summarize this incoming information which will be this output right here and yeah so we got that and then we're just going to say output only plain text there should be no um like markdown formatting or

62:29

Speaker A

um or any symbols okay so that should be simple enough we'll test that out it is going to be weird about that because um you know the the whole looping but this should be json. message. content now I believe so

62:51

Speaker A

we'll give it another run please summarize my calendar events for today okay what is this I don't know what what try I was about to say third times's a charm but we'll see it should now be just summarizing

63:09

Speaker A

information it should be a plain string um that way when the audio file is being created it's going to be much cleaner let's see what we got okay this looks a lot cleaner and then we'll see what the

63:20

Speaker A

actual file sounds like hopefully this one's better your calendar events for today November 28th 2024 include 1 meeting with Michael Scott from 12:00 p.m. to 1:00 p.m. MDT status confirmed response needed from up at digital gmail.com two dinner from 5:00 p.m. to 6 p.m. so that

63:40

Speaker A

one comes to cleaner we would probably want to play with the prompting so it's gives you an even more high level summary we don't want to maybe hear that it's confirmed or if it needs a response or maybe we do but anyways that's just

63:49

Speaker A

you know You' play with the prompting within that opening I node right there but yeah I mean that's the foundations really we could you know obviously come in here and we could add something like a a vector store um let's just call this

64:03

Speaker A

data retrieves information about company projects so we can do that obviously we'd set up the other information we need for the vector store um but yeah obviously the idea is that we're just pretty much building on top of the the agent um type workflow

64:29

Speaker A

you can continue to come in here and add more and more tools which is obviously the super cool part and um yeah just the whole theory of like being able to build out workflows in end andn and being able

64:39

Speaker A

to you know call them in multiple different workflows they're very scalable it's very flexible and yeah the whole idea is that you have all these different workflows you can sort of Plug and Play which is super cool um so yeah I hope that this

64:52

Speaker A

workflow or I hope that this step-by-step tutorial was insight um you know there's a lot of things that we could do to improve upon this one thing I'll just show really quick is a cool way that you could have your agents

65:04

Speaker A

be able to like talk to each other a little bit more so you know obviously we're calling email agent we're calling calendar agent stuff like that let's say we were calling the calendar agent and it aired right um so this is the an

65:17

Speaker A

actual workflow that I was using for the personal assistant build and this is not the one we just built but anyways you come into here and you want to go to settings and then you want to make it

65:25

Speaker A

continue using an output so if we do that we have two different options so if the workflows errors for some reason rather than it just stopping or rather than the agent responding to us on Telegram and saying we couldn't do that

65:38

Speaker A

it's going to go down this path and it's going to respond to that personal assistant with the response of unable to perform task please try again so this agent would hit this it would get a response and then rather than responding

65:49

Speaker A

to us it would be like okay well that didn't work what do we need to do differently and you would maybe prompt that a little more specifically but let's say for some reason it didn't grab the email then it

65:58

Speaker A

would try again it would run through that whole query and then this time it may go grab the email and then understand okay well that's sort of where I messed up there anyways I hope this video was insightful like I said

66:07

Speaker A

the workflows that we used in this video as well as the code Snippets will be in the school Community you'll just go to YouTube resources find this video everything will be attached there and you know I mentioned there's a lot of

66:17

Speaker A

ways to improve on this build to make it really more production ready and if you want to dive deeper into that please check out the paid Community if you have any questions about that reach out to me um the link for that will o be down in

66:26

Speaker A

the description but thank you guys really appreciate your time today and um we'll see you in the next one

Topics: n8n personal assistant AI agent no code automation Telegram integration GPT-4 calendar automation email automation workflow tutorial

Study this video

- [Flashcards from this video](https://sozai.app/tools/ai-flashcard-generator/?from=transcript&id=81195)
- [Quiz on this video](https://sozai.app/tools/quiz-generator/?from=transcript&id=81195)

Free, made by AI from this transcript. No signup.


---
This is the markdown twin of https://sozai.app/transcript/build-personal-assistant-ai-n8n/ — the same content, without the markup.
Published by SozAI (https://sozai.app). Reuse and quotation are allowed with attribution and a link back.
Machine-readable index: https://sozai.app/llms.txt · data API: https://sozai.app/api/
